Threat Modeling
Threat Modeling Methodologies
STRIDE
STRIDE is a threat modeling framework developed by Microsoft that categorizes threats into six categories:
Spoofing: Impersonating something or someone else
- Examples: Fake authentication tokens, DNS spoofing, email spoofing
- Controls: Strong authentication, certificate validation, anti-spoofing measures
Tampering: Modifying data or code without authorization
- Examples: Man-in-the-middle attacks, code injection, data tampering
- Controls: Digital signatures, integrity checks, secure communication channels
Repudiation: Denying having performed an action
- Examples: Denying a transaction, denying access to resources
- Controls: Audit logging, non-repudiation services, digital signatures
Information Disclosure: Exposing information to unauthorized parties
- Examples: Data leakage, sensitive information in logs, insecure storage
- Controls: Encryption, access controls, data masking, secure logging
Denial of Service: Making a service unavailable
- Examples: DDoS attacks, resource exhaustion, application crashes
- Controls: Rate limiting, throttling, redundancy, monitoring
Elevation of Privilege: Gaining unauthorized higher-level access
- Examples: Privilege escalation, bypassing authorization checks
- Controls: Principle of least privilege, secure authorization, input validation
PASTA Framework
Process for Attack Simulation and Threat Analysis (PASTA) is a seven-step risk-centric methodology:
- Define Objectives: Establish business objectives and compliance requirements
- Define Technical Scope: Identify assets, data flows, and technical architecture
- Application Decomposition: Analyze application architecture and data flows
- Threat Analysis: Identify threats using threat intelligence and attack patterns
- Vulnerability Analysis: Identify and assess vulnerabilities in the system
- Attack Modeling: Model potential attacks and their impact
- Risk Analysis: Assess and prioritize risks based on business impact
LINDDUN Framework
LINDDUN is a privacy-focused threat modeling framework:
- Linkability: Ability to link data to individuals
- Identifiability: Ability to identify individuals from data
- Non-repudiation: Inability to deny actions
- Detectability: Ability to detect data processing
- Disclosure of Information: Unauthorized information disclosure
- Unawareness: Individuals unaware of data processing
- Non-compliance: Failure to comply with regulations
Attack Tree Analysis
Attack Tree Structure
Attack trees are hierarchical diagrams that represent different ways an attacker might achieve a goal:
- Root Node: The attacker's ultimate goal
- Intermediate Nodes: Sub-goals or attack vectors
- Leaf Nodes: Specific attack techniques or exploits
Attack Tree Analysis Process
- Define Attack Goal: Identify what the attacker wants to achieve
- Identify Attack Vectors: Brainstorm different ways to achieve the goal
- Break Down Vectors: Decompose each vector into smaller steps
- Assign Values: Assign difficulty, cost, and risk values to each node
- Analyze Paths: Identify the most likely attack paths
- Identify Mitigations: Determine controls to block each path
Common Attack Patterns
- Authentication Attacks: Credential stuffing, brute force, password spraying
- Authorization Attacks: Privilege escalation, IDOR, broken access controls
- Injection Attacks: SQL injection, command injection, XSS, LDAP injection
- Cryptographic Attacks: Weak algorithms, key management issues, padding oracle
- Network Attacks: MITM, DNS poisoning, ARP spoofing, BGP hijacking
- Social Engineering: Phishing, pretexting, baiting, tailgating
Common Attack Patterns
OWASP Top 10
- Broken Access Control: Restrictions on authenticated users are not properly enforced
- Cryptographic Failures: Failures related to cryptography and protection of sensitive data
- Injection: Injection flaws allow attackers to execute malicious commands
- Insecure Design: Flaws in design and architecture that enable security issues
- Security Misconfiguration: Improperly configured security settings
- Vulnerable and Outdated Components: Using components with known vulnerabilities
- Identification and Authentication Failures: Weaknesses in identity and authentication
- Software and Data Integrity Failures: Code and infrastructure without integrity protection
- Security Logging and Monitoring Failures: Insufficient logging and monitoring
- Server-Side Request Forgery (SSRF): Server makes requests to unintended locations
Common Weakness Enumeration (CWE)
- CWE-79: Cross-site Scripting (XSS)
- CWE-89: SQL Injection
- CWE-200: Information Exposure
- CWE-352: Cross-Site Request Forgery (CSRF)
- CWE-400: Uncontrolled Resource Consumption
- CWE-502: Deserialization of Untrusted Data
- CWE-732: Incorrect Permission Assignment
- CWE-798: Use of Hard-coded Credentials
- CWE-862: Missing Authorization
- CWE-863: Incorrect Authorization
Risk Assessment Frameworks
CVSS (Common Vulnerability Scoring System)
CVSS provides a standardized way to assess vulnerability severity:
- Base Score: Intrinsic qualities of the vulnerability (Exploitability, Impact)
- Temporal Score: Characteristics that change over time (Exploit Code Maturity, Remediation Level)
- Environmental Score: Characteristics specific to the user's environment
DREAD
DREAD is a risk assessment model:
- Damage: How much damage could be caused?
- Reproducibility: How easily can the vulnerability be reproduced?
- Exploitability: How easy is it to exploit?
- Affected Users: How many users are affected?
- Discoverability: How easy is it to discover?
OWASP Risk Rating
OWASP provides a risk rating methodology:
- Likelihood: Ease of discovery, ease of exploit, awareness, intrusion detection
- Impact: Technical impact, business impact
- Risk Score: Likelihood × Impact
Security Architecture Patterns
Defense in Depth
Layered security controls provide multiple levels of protection:
- Perimeter Security: Firewalls, WAFs, DDoS protection
- Network Security: Network segmentation, IDS/IPS, VPN
- Host Security: Endpoint protection, HIDS, application whitelisting
- Application Security: Input validation, authentication, authorization
- Data Security: Encryption, access controls, data loss prevention
Zero Trust Architecture
Never trust, always verify:
- Identity Verification: Strong authentication for all access requests
- Device Trust: Verify device health and compliance
- Least Privilege: Grant minimum necessary access
- Micro-segmentation: Segment networks to limit lateral movement
- Continuous Monitoring: Monitor and log all access and activity
Secure by Design
Incorporate security from the beginning:
- Threat Modeling: Identify threats early in design
- Secure Defaults: Default to secure configurations
- Principle of Least Privilege: Minimize permissions
- Defense in Depth: Multiple layers of security
- Fail Secure: Fail to a secure state
- Security by Design: Design security into the system
1---2name: threat-modeling3description: Threat modeling methodologies (STRIDE, PASTA, LINDDUN), attack tree analysis, common attack patterns (OWASP Top 10, CWE), risk assessment frameworks, and security architecture patterns4---5
6# Threat Modeling
7
8## Threat Modeling Methodologies
9
10### STRIDE
11
12STRIDE is a threat modeling framework developed by Microsoft that categorizes threats into six categories:
13
14- **Spoofing**: Impersonating something or someone else
15 - Examples: Fake authentication tokens, DNS spoofing, email spoofing
16 - Controls: Strong authentication, certificate validation, anti-spoofing measures
17
18- **Tampering**: Modifying data or code without authorization
19 - Examples: Man-in-the-middle attacks, code injection, data tampering
20 - Controls: Digital signatures, integrity checks, secure communication channels
21
22- **Repudiation**: Denying having performed an action
23 - Examples: Denying a transaction, denying access to resources
24 - Controls: Audit logging, non-repudiation services, digital signatures
25
26- **Information Disclosure**: Exposing information to unauthorized parties
27 - Examples: Data leakage, sensitive information in logs, insecure storage
28 - Controls: Encryption, access controls, data masking, secure logging
29
30- **Denial of Service**: Making a service unavailable
31 - Examples: DDoS attacks, resource exhaustion, application crashes
32 - Controls: Rate limiting, throttling, redundancy, monitoring
33
34- **Elevation of Privilege**: Gaining unauthorized higher-level access
35 - Examples: Privilege escalation, bypassing authorization checks
36 - Controls: Principle of least privilege, secure authorization, input validation
37
38### PASTA Framework
39
40Process for Attack Simulation and Threat Analysis (PASTA) is a seven-step risk-centric methodology:
41
421. **Define Objectives**: Establish business objectives and compliance requirements
432. **Define Technical Scope**: Identify assets, data flows, and technical architecture
443. **Application Decomposition**: Analyze application architecture and data flows
454. **Threat Analysis**: Identify threats using threat intelligence and attack patterns
465. **Vulnerability Analysis**: Identify and assess vulnerabilities in the system
476. **Attack Modeling**: Model potential attacks and their impact
487. **Risk Analysis**: Assess and prioritize risks based on business impact
49
50### LINDDUN Framework
51
52LINDDUN is a privacy-focused threat modeling framework:
53
54- **Linkability**: Ability to link data to individuals
55- **Identifiability**: Ability to identify individuals from data
56- **Non-repudiation**: Inability to deny actions
57- **Detectability**: Ability to detect data processing
58- **Disclosure of Information**: Unauthorized information disclosure
59- **Unawareness**: Individuals unaware of data processing
60- **Non-compliance**: Failure to comply with regulations
61
62## Attack Tree Analysis
63
64### Attack Tree Structure
65
66Attack trees are hierarchical diagrams that represent different ways an attacker might achieve a goal:
67
68- **Root Node**: The attacker's ultimate goal
69- **Intermediate Nodes**: Sub-goals or attack vectors
70- **Leaf Nodes**: Specific attack techniques or exploits
71
72### Attack Tree Analysis Process
73
741. **Define Attack Goal**: Identify what the attacker wants to achieve
752. **Identify Attack Vectors**: Brainstorm different ways to achieve the goal
763. **Break Down Vectors**: Decompose each vector into smaller steps
774. **Assign Values**: Assign difficulty, cost, and risk values to each node
785. **Analyze Paths**: Identify the most likely attack paths
796. **Identify Mitigations**: Determine controls to block each path
80
81### Common Attack Patterns
82
83- **Authentication Attacks**: Credential stuffing, brute force, password spraying
84- **Authorization Attacks**: Privilege escalation, IDOR, broken access controls
85- **Injection Attacks**: SQL injection, command injection, XSS, LDAP injection
86- **Cryptographic Attacks**: Weak algorithms, key management issues, padding oracle
87- **Network Attacks**: MITM, DNS poisoning, ARP spoofing, BGP hijacking
88- **Social Engineering**: Phishing, pretexting, baiting, tailgating
89
90## Common Attack Patterns
91
92### OWASP Top 10
93
941. **Broken Access Control**: Restrictions on authenticated users are not properly enforced
952. **Cryptographic Failures**: Failures related to cryptography and protection of sensitive data
963. **Injection**: Injection flaws allow attackers to execute malicious commands
974. **Insecure Design**: Flaws in design and architecture that enable security issues
985. **Security Misconfiguration**: Improperly configured security settings
996. **Vulnerable and Outdated Components**: Using components with known vulnerabilities
1007. **Identification and Authentication Failures**: Weaknesses in identity and authentication
1018. **Software and Data Integrity Failures**: Code and infrastructure without integrity protection
1029. **Security Logging and Monitoring Failures**: Insufficient logging and monitoring
10310. **Server-Side Request Forgery (SSRF)**: Server makes requests to unintended locations
104
105### Common Weakness Enumeration (CWE)
106
107- **CWE-79**: Cross-site Scripting (XSS)
108- **CWE-89**: SQL Injection
109- **CWE-200**: Information Exposure
110- **CWE-352**: Cross-Site Request Forgery (CSRF)
111- **CWE-400**: Uncontrolled Resource Consumption
112- **CWE-502**: Deserialization of Untrusted Data
113- **CWE-732**: Incorrect Permission Assignment
114- **CWE-798**: Use of Hard-coded Credentials
115- **CWE-862**: Missing Authorization
116- **CWE-863**: Incorrect Authorization
117
118## Risk Assessment Frameworks
119
120### CVSS (Common Vulnerability Scoring System)
121
122CVSS provides a standardized way to assess vulnerability severity:
123
124- **Base Score**: Intrinsic qualities of the vulnerability (Exploitability, Impact)
125- **Temporal Score**: Characteristics that change over time (Exploit Code Maturity, Remediation Level)
126- **Environmental Score**: Characteristics specific to the user's environment
127
128### DREAD
129
130DREAD is a risk assessment model:
131
132- **Damage**: How much damage could be caused?
133- **Reproducibility**: How easily can the vulnerability be reproduced?
134- **Exploitability**: How easy is it to exploit?
135- **Affected Users**: How many users are affected?
136- **Discoverability**: How easy is it to discover?
137
138### OWASP Risk Rating
139
140OWASP provides a risk rating methodology:
141
142- **Likelihood**: Ease of discovery, ease of exploit, awareness, intrusion detection
143- **Impact**: Technical impact, business impact
144- **Risk Score**: Likelihood × Impact
145
146## Security Architecture Patterns
147
148### Defense in Depth
149
150Layered security controls provide multiple levels of protection:
151
152- **Perimeter Security**: Firewalls, WAFs, DDoS protection
153- **Network Security**: Network segmentation, IDS/IPS, VPN
154- **Host Security**: Endpoint protection, HIDS, application whitelisting
155- **Application Security**: Input validation, authentication, authorization
156- **Data Security**: Encryption, access controls, data loss prevention
157
158### Zero Trust Architecture
159
160Never trust, always verify:
161
162- **Identity Verification**: Strong authentication for all access requests
163- **Device Trust**: Verify device health and compliance
164- **Least Privilege**: Grant minimum necessary access
165- **Micro-segmentation**: Segment networks to limit lateral movement
166- **Continuous Monitoring**: Monitor and log all access and activity
167
168### Secure by Design
169
170Incorporate security from the beginning:
171
172- **Threat Modeling**: Identify threats early in design
173- **Secure Defaults**: Default to secure configurations
174- **Principle of Least Privilege**: Minimize permissions
175- **Defense in Depth**: Multiple layers of security
176- **Fail Secure**: Fail to a secure state
177- **Security by Design**: Design security into the system