Skip to content

Commit 4981c4b

Browse files
authored
Added Sections For Zero Trust and Defense In Depth in SSDLC module (#50)
1 parent 778b2ae commit 4981c4b

File tree

2 files changed

+94
-5
lines changed

2 files changed

+94
-5
lines changed

modules/3-ssdlc.livemd

Lines changed: 78 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@ Welcome to Part 3! This section is dedicated to discussing some of the more abst
99
* [No Secrets In Code](#no-secrets-in-code)
1010
* [Making Secret Rotation Easy](#making-secret-rotation-easy)
1111
* [Rate Limiting](#rate-limiting)
12-
* [Principle of Least Privilege](#principle-of-least-privlege)
12+
* [Zero Trust Model](#zero-trust-model)
13+
* [Principle of Least Privilege](principle-of-least-privlege)
14+
* [Device Access Control](device-access-control)
15+
* [Microsegmentation](microsegmentation)
16+
* [Preventing Lateral Movement](preventing-lateral-movement)
17+
* [Multi Factor Authentication](multi-factor-authentication)
18+
* [Defense In Depth](#defense-in-depth)
1319

1420
## No Secrets In Code
1521

@@ -75,18 +81,86 @@ If the answer to one or more of those questions is yes, consider putting a limit
7581

7682
More often than not, rate limiting should be as specific as possible. For instance, it is better to add rate limiting on a single GraphQL type than to add a generic limit to the entire /GraphQL endpoint.
7783

78-
## Principle of Least Privilege
84+
## Zero Trust Model
85+
86+
### Principle of Least Privilege
7987

8088
Sometimes known as the Principle of Minimal Privilege or the Principle of Least Authority, the Principle of Least Privilege (PoLP) means that every entity* is only strictly given the essential privileges needed to perform its requirement.
8189

8290
E.g. A script that executes on a cron schedule that monitors the output of a log file only needs read privileges and should not be given write privileges.
8391

8492
**Entity: generic term for an arbitrary process, user, program, etc. found within a Data System*
8593

86-
### Benefits of the Principle
94+
#### Benefits of the Principle
8795

8896
* **Better Data System Stability** - When an entity is limited in the scope of changes it can make to a system, it is easier to test its possible actions and interactions in the context of the Data System.
8997
* **Better Data System Security** - When an entity is limited in the system-wide actions it may perform, vulnerabilities / compromises in one application cannot be used to exploit the rest of the business or adjacent Data Systems.
9098
* **Ease of Deployment** - In general, the fewer privileges an entity requires, the easier it is to deploy within a larger environment.
9199
<br /><br />
92-
[**<- Previous Module: OWASP**](./2-owasp.livemd) || [**Next Module: GraphQL Security ->**](./4-graphql.livemd)
100+
101+
### Device Access Control
102+
103+
Zero Trust is not only about controlling user access, but requires strict controls on device access as well. With this, Zero Trust systems need to monitor how many different devices are trying to access their network, ensure that every device is authorized, and assess all devices to make sure they have not been compromised. This further minimizes the attack surface of the network.
104+
105+
### Microsegmentation
106+
107+
Microsegmentation is the practice of breaking up security perimeters into small zones to maintain separate access for separate parts of the network. Some of the benefits of doing so are:
108+
* Granular Access Policies - we can create super specific policies for access to each segment!
109+
* Targeted Security Controls - we can develop each micro-perimeter to specifically target the security risks and vulnerabilities of the resources in that micro-segment!
110+
* Establishing Identities and Trust - we can implement, monitor, and control the “never trust, always verify” principle much easier!
111+
112+
### Preventing Lateral Movement
113+
114+
Zero Trust is designed to contain attackers so that they can not move laterally. You may be asking what does that even mean? In network security, “lateral movement” is when an attacker moves within a network after gaining access to it, which can be very difficult to detect.
115+
116+
Zero Trust helps contain attackers because the access is segmented and has to be reestablished periodically, limiting them from moving across to other microsegments within the network.
117+
118+
### Multi Factor Authentication
119+
120+
It's no surprise that MFA is a core part of the Zero Trust Model. Systems using MFA require more than one piece of evidence to authenticate a user, with the most common form being a one time password (OTP).
121+
122+
### Resource
123+
1. https://www.cloudflare.com/learning/security/glossary/what-is-zero-trust/
124+
125+
## Defense In Depth
126+
127+
Defense in depth is a security approach of having defense mechanisms in a layered approach to protect valuable assets. Castles take a similar approach, where they have a moat, ramparts, towers, and drawbridges instead of just one wall as protection.
128+
129+
An example of developing a web application using defense in depth could be:
130+
* The developers (like yourself) receive secure coding training
131+
* The codebase is checked automatically for vulnerabilities using Semgrep
132+
* The codebase is also checked for outdated dependencies using Dependabot
133+
* The application is regularly tested by the internal security team
134+
* Multiple development environments are used such as Develpoment, Staging, and Production
135+
136+
<br> </br>
137+
138+
Using more than one of the following layers constitutes an example of defense in depth:
139+
140+
### System and Application
141+
142+
* Authentication and password security
143+
* Hashing passwords
144+
* Multi factor authentication (MFA)
145+
* Encryption
146+
* Security Tooling
147+
* Security Awareness Training (sounds familiar 😉)
148+
* Logging and Monitoring
149+
150+
### Network
151+
152+
* Firewalls (hardware and software)
153+
* Demilitarized zones (DMZ)
154+
* Virtual Private Networks (VPN)
155+
156+
### Physical
157+
158+
* Biometrics
159+
* Data-centric security
160+
* Physical Security (such as locked server rooms)
161+
162+
### Resource
163+
1. https://www.forcepoint.com/cyber-edu/defense-depth
164+
165+
166+
[**<- Previous Module: OWASP**](./2-owasp.livemd) || [**Next Module: GraphQL Security ->**](./4-graphql.livemd)

modules/5-elixir.livemd

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ But even the dullest blades can hurt someone! This module goes over Elixir speci
1313
## Table of Contents
1414

1515
* [Atom Exhaustion](#atom-exhaustion)
16-
* [Protecting Sensitive Data](#protecting-sensitive-data)
16+
* [Serialization and Deserialization](#serialization-and-deserialization)
1717
* [Untrusted Code](#untrusted-code)
1818
* [Timing Attacks](#timing-attacks)
1919
* [Boolean Coercion](#boolean-coercion)
@@ -61,6 +61,21 @@ IO.puts("Are you protected against Atom Exhaustion?")
6161
IO.puts(:erlang.system_info(:atom_count) == prev_count)
6262
```
6363

64+
## Serialization and Deserialization
65+
66+
### Description
67+
68+
Deserialization of untrusted input can result in atom creation, which can lead to your application being vulnerable to denial of service (DOS) attacks. When you do use a deserialization library, make sure that the library does not create arbitrary atoms: either configure the library to return strings/binaries or enable schema validation to constrain the input
69+
70+
### Prevention
71+
72+
* Use the :safe option when calling `:erlang.binary_to_term/2` on untrusted input (should be familiar from atom exhaustion 😀)
73+
* Prevent function deserialisation from untrusted input, e.g. using `Plug.Crypto.non_executable_binary_to_term/1,2`
74+
75+
### Resource
76+
1. https://erlef.github.io/security-wg/secure_coding_and_deployment_hardening/serialisation
77+
78+
6479
## Untrusted Code
6580

6681
### Description

0 commit comments

Comments
 (0)