Threat Modeling (STRIDE)
Systematic process to identify, score, and mitigate security threats before they become vulnerabilities.
When to Threat Model
- New system or service being designed
- Significant architectural change to existing system
- New data flow involving sensitive/regulated data
- Integration with external/untrusted systems
- Before security-critical feature development
Workflow
Step 1: Decompose the System
Identify and document:
- Assets: What are we protecting? (data, services, credentials, reputation)
- Entry points: Where can external actors interact? (APIs, UI, file uploads, webhooks, message queues)
- Trust boundaries: Where do privilege levels change? (client→server, public→private subnet, service→database)
- Data flows: How does data move between components? (HTTP, gRPC, events, files)
- Technologies: What stack is used? (language, framework, database, cloud services)
Output: A data flow diagram (DFD) showing components, data stores, data flows, and trust boundaries.
[Browser] --HTTPS--> |TRUST BOUNDARY| --> [API Gateway] --gRPC--> [User Service] --SQL--> [(User DB)]
|
--gRPC--> [Order Service] --SQL--> [(Order DB)]
|
--HTTPS--> [Payment Provider (external)]
Step 2: Identify Threats (STRIDE)
For each component and data flow, systematically check each STRIDE category:
| Category |
Threat |
Question to Ask |
| Spoofing |
Identity fraud |
Can an attacker pretend to be someone/something else? |
| Tampering |
Data modification |
Can data be modified in transit or at rest without detection? |
| Repudiation |
Deniability |
Can an actor deny performing an action? Do we have audit trails? |
| Information Disclosure |
Data leakage |
Can sensitive data be exposed to unauthorized parties? |
| Denial of Service |
Availability loss |
Can the system be made unavailable? |
| Elevation of Privilege |
Unauthorized access |
Can a user gain higher privileges than intended? |
Process: Walk through each component on the DFD and ask all 6 STRIDE questions. Document every plausible threat.
Step 3: Score Severity
Use simplified DREAD scoring (1–3 scale for speed):
| Factor |
1 (Low) |
2 (Medium) |
3 (High) |
| Damage |
Minor inconvenience |
Data exposure, partial outage |
Full data breach, complete outage |
| Reproducibility |
Complex conditions needed |
Reproducible with effort |
Trivially reproducible |
| Exploitability |
Requires insider/physical access |
Requires skill + tools |
Script kiddie can do it |
| Affected Users |
Single user |
Subset of users |
All users |
| Discoverability |
Requires source code access |
Discoverable with testing |
Publicly visible |
Score = sum of all factors (range 5–15)
| Total Score |
Priority |
| 12–15 |
Critical — fix before launch |
| 8–11 |
High — fix in current sprint |
| 5–7 |
Medium — schedule in backlog |
Step 4: Prioritize Mitigations
For each threat above the acceptable risk threshold:
- Eliminate: Remove the feature/component that creates the threat
- Mitigate: Add controls that reduce likelihood or impact
- Transfer: Shift risk to a third party (insurance, managed service)
- Accept: Document as known risk with owner and review date
Prioritize mitigations by:
- Score (highest first)
- Cost of mitigation (prefer cheap, structural fixes)
- Coverage (one fix that addresses multiple threats)
Step 5: Document Residual Risks
After mitigations are planned, document what remains:
- Threats accepted without mitigation (with justification)
- Threats partially mitigated (residual risk level)
- Assumptions that must hold for mitigations to be effective
- Monitoring/detection for accepted risks
STRIDE Mitigation Patterns
| STRIDE Category |
Standard Mitigations |
| Spoofing |
Strong authentication, MFA, mTLS, API key rotation |
| Tampering |
Input validation, HMAC/signatures, checksums, immutable audit logs |
| Repudiation |
Comprehensive audit logging, digital signatures, timestamps |
| Information Disclosure |
Encryption (transit + rest), access control, data masking, minimize exposure |
| Denial of Service |
Rate limiting, autoscaling, circuit breakers, input size limits, CDN |
| Elevation of Privilege |
Least privilege, RBAC/ABAC, input validation, sandboxing, capability dropping |
Reusable Template
# Threat Model: [System/Feature Name]
**Date**: YYYY-MM-DD
**Author**: [Name]
**Reviewers**: [Names]
**Status**: Draft | Reviewed | Approved
## 1. System Overview
[Brief description of the system and its purpose]
### 1.1 Assets
| Asset | Sensitivity | Description |
|-------|-------------|-------------|
| | | |
### 1.2 Entry Points
| ID | Entry Point | Protocol | Auth Required |
|----|-------------|----------|---------------|
| EP1 | | | |
### 1.3 Trust Boundaries
| Boundary | From | To | Controls |
|----------|------|-----|----------|
| TB1 | | | |
### 1.4 Data Flow Diagram
[Diagram or description showing components, flows, and trust boundaries]
## 2. Threats Identified
| ID | Component | STRIDE | Threat Description | Score (DREAD) | Priority |
|----|-----------|--------|-------------------|---------------|----------|
| T1 | | | | /15 | |
| T2 | | | | /15 | |
## 3. Mitigations
| Threat ID | Mitigation | Strategy | Owner | Status |
|-----------|-----------|----------|-------|--------|
| T1 | | Eliminate/Mitigate/Transfer/Accept | | |
## 4. Residual Risks
| Threat ID | Residual Risk | Justification | Review Date |
|-----------|--------------|---------------|-------------|
| | | | |
## 5. Assumptions
- [Assumption 1]
- [Assumption 2]
## 6. Review Schedule
Next review: [Date or trigger condition]
Tips for Effective Threat Modeling
- Timebox: 60–90 minutes per session. Multiple short sessions beat one marathon.
- Right people: Developer(s) who built it + security-minded reviewer + ops/infrastructure if relevant.
- Iterate: Update the threat model when the system changes, not just at initial design.
- Focus on high-value targets: Start with the most sensitive data flows and exposed entry points.
- Use "what if" thinking: "What if this service is compromised? What if this credential leaks? What if this input is 10GB?"
- Don't boil the ocean: A focused threat model on the critical path beats a shallow model of everything.
Quick-Reference: Per-Component Checks
| Component Type |
Key Threats to Check |
| Public API endpoint |
Injection, AuthN/AuthZ bypass, rate limiting, input validation |
| Database |
SQL injection, access control, encryption at rest, backup security |
| File upload |
Path traversal, malware, size limits, type validation |
| Authentication flow |
Credential stuffing, session fixation, token theft, MFA bypass |
| Third-party integration |
SSRF, data leakage, supply chain, availability dependency |
| Message queue |
Message tampering, unauthorized publish/subscribe, poison messages |
| Admin interface |
Privilege escalation, weak auth, insufficient logging |
Cross-References
knowledge-owasp-top-10 — Specific vulnerability categories to check for
knowledge-secure-by-design — Architectural principles that mitigate structural threats
knowledge-auth-patterns — Authentication/authorization threat mitigations
knowledge-privacy-by-design — Data sensitivity classification and PII threat considerations
1---2name: execution-threat-modeling3description: Step-by-step STRIDE-based threat modeling workflow with scoring, prioritization, and a reusable template. Use when designing new systems, reviewing architecture for security risks, or when asked to perform a threat model on a component or system.4---56# Threat Modeling (STRIDE)78Systematic process to identify, score, and mitigate security threats before they become vulnerabilities.910## When to Threat Model1112- New system or service being designed13- Significant architectural change to existing system14- New data flow involving sensitive/regulated data15- Integration with external/untrusted systems16- Before security-critical feature development1718## Workflow1920### Step 1: Decompose the System2122Identify and document:23241. **Assets**: What are we protecting? (data, services, credentials, reputation)252. **Entry points**: Where can external actors interact? (APIs, UI, file uploads, webhooks, message queues)263. **Trust boundaries**: Where do privilege levels change? (client→server, public→private subnet, service→database)274. **Data flows**: How does data move between components? (HTTP, gRPC, events, files)285. **Technologies**: What stack is used? (language, framework, database, cloud services)2930**Output**: A data flow diagram (DFD) showing components, data stores, data flows, and trust boundaries.3132```33[Browser] --HTTPS--> |TRUST BOUNDARY| --> [API Gateway] --gRPC--> [User Service] --SQL--> [(User DB)]34 |35 --gRPC--> [Order Service] --SQL--> [(Order DB)]36 |37 --HTTPS--> [Payment Provider (external)]38```3940### Step 2: Identify Threats (STRIDE)4142For each component and data flow, systematically check each STRIDE category:4344| Category | Threat | Question to Ask |45|----------|--------|-----------------|46| **S**poofing | Identity fraud | Can an attacker pretend to be someone/something else? |47| **T**ampering | Data modification | Can data be modified in transit or at rest without detection? |48| **R**epudiation | Deniability | Can an actor deny performing an action? Do we have audit trails? |49| **I**nformation Disclosure | Data leakage | Can sensitive data be exposed to unauthorized parties? |50| **D**enial of Service | Availability loss | Can the system be made unavailable? |51| **E**levation of Privilege | Unauthorized access | Can a user gain higher privileges than intended? |5253**Process**: Walk through each component on the DFD and ask all 6 STRIDE questions. Document every plausible threat.5455### Step 3: Score Severity5657Use simplified DREAD scoring (1–3 scale for speed):5859| Factor | 1 (Low) | 2 (Medium) | 3 (High) |60|--------|---------|------------|----------|61| **D**amage | Minor inconvenience | Data exposure, partial outage | Full data breach, complete outage |62| **R**eproducibility | Complex conditions needed | Reproducible with effort | Trivially reproducible |63| **E**xploitability | Requires insider/physical access | Requires skill + tools | Script kiddie can do it |64| **A**ffected Users | Single user | Subset of users | All users |65| **D**iscoverability | Requires source code access | Discoverable with testing | Publicly visible |6667**Score** = sum of all factors (range 5–15)6869| Total Score | Priority |70|-------------|----------|71| 12–15 | Critical — fix before launch |72| 8–11 | High — fix in current sprint |73| 5–7 | Medium — schedule in backlog |7475### Step 4: Prioritize Mitigations7677For each threat above the acceptable risk threshold:78791. **Eliminate**: Remove the feature/component that creates the threat802. **Mitigate**: Add controls that reduce likelihood or impact813. **Transfer**: Shift risk to a third party (insurance, managed service)824. **Accept**: Document as known risk with owner and review date8384**Prioritize mitigations by**:85- Score (highest first)86- Cost of mitigation (prefer cheap, structural fixes)87- Coverage (one fix that addresses multiple threats)8889### Step 5: Document Residual Risks9091After mitigations are planned, document what remains:92- Threats accepted without mitigation (with justification)93- Threats partially mitigated (residual risk level)94- Assumptions that must hold for mitigations to be effective95- Monitoring/detection for accepted risks9697## STRIDE Mitigation Patterns9899| STRIDE Category | Standard Mitigations |100|-----------------|---------------------|101| Spoofing | Strong authentication, MFA, mTLS, API key rotation |102| Tampering | Input validation, HMAC/signatures, checksums, immutable audit logs |103| Repudiation | Comprehensive audit logging, digital signatures, timestamps |104| Information Disclosure | Encryption (transit + rest), access control, data masking, minimize exposure |105| Denial of Service | Rate limiting, autoscaling, circuit breakers, input size limits, CDN |106| Elevation of Privilege | Least privilege, RBAC/ABAC, input validation, sandboxing, capability dropping |107108## Reusable Template109110```markdown111# Threat Model: [System/Feature Name]112113**Date**: YYYY-MM-DD114**Author**: [Name]115**Reviewers**: [Names]116**Status**: Draft | Reviewed | Approved117118## 1. System Overview119120[Brief description of the system and its purpose]121122### 1.1 Assets123| Asset | Sensitivity | Description |124|-------|-------------|-------------|125| | | |126127### 1.2 Entry Points128| ID | Entry Point | Protocol | Auth Required |129|----|-------------|----------|---------------|130| EP1 | | | |131132### 1.3 Trust Boundaries133| Boundary | From | To | Controls |134|----------|------|-----|----------|135| TB1 | | | |136137### 1.4 Data Flow Diagram138139[Diagram or description showing components, flows, and trust boundaries]140141## 2. Threats Identified142143| ID | Component | STRIDE | Threat Description | Score (DREAD) | Priority |144|----|-----------|--------|-------------------|---------------|----------|145| T1 | | | | /15 | |146| T2 | | | | /15 | |147148## 3. Mitigations149150| Threat ID | Mitigation | Strategy | Owner | Status |151|-----------|-----------|----------|-------|--------|152| T1 | | Eliminate/Mitigate/Transfer/Accept | | |153154## 4. Residual Risks155156| Threat ID | Residual Risk | Justification | Review Date |157|-----------|--------------|---------------|-------------|158| | | | |159160## 5. Assumptions161162- [Assumption 1]163- [Assumption 2]164165## 6. Review Schedule166167Next review: [Date or trigger condition]168```169170## Tips for Effective Threat Modeling171172- **Timebox**: 60–90 minutes per session. Multiple short sessions beat one marathon.173- **Right people**: Developer(s) who built it + security-minded reviewer + ops/infrastructure if relevant.174- **Iterate**: Update the threat model when the system changes, not just at initial design.175- **Focus on high-value targets**: Start with the most sensitive data flows and exposed entry points.176- **Use "what if" thinking**: "What if this service is compromised? What if this credential leaks? What if this input is 10GB?"177- **Don't boil the ocean**: A focused threat model on the critical path beats a shallow model of everything.178179## Quick-Reference: Per-Component Checks180181| Component Type | Key Threats to Check |182|---------------|---------------------|183| Public API endpoint | Injection, AuthN/AuthZ bypass, rate limiting, input validation |184| Database | SQL injection, access control, encryption at rest, backup security |185| File upload | Path traversal, malware, size limits, type validation |186| Authentication flow | Credential stuffing, session fixation, token theft, MFA bypass |187| Third-party integration | SSRF, data leakage, supply chain, availability dependency |188| Message queue | Message tampering, unauthorized publish/subscribe, poison messages |189| Admin interface | Privilege escalation, weak auth, insufficient logging |190191## Cross-References192193- **`knowledge-owasp-top-10`** — Specific vulnerability categories to check for194- **`knowledge-secure-by-design`** — Architectural principles that mitigate structural threats195- **`knowledge-auth-patterns`** — Authentication/authorization threat mitigations196- **`knowledge-privacy-by-design`** — Data sensitivity classification and PII threat considerations