Skip to content

Commit 3b2002b

Browse files
committed
feat(threat-model): Add risk scoring frameworks, clarify CVSS usage, and improve traceability
Major enhancements to threat modeling chapter addressing accuracy and completeness: Content Accuracy Fixes: - Clarify CVSS is for vulnerability severity, not threat risk scoring - Update core activities to reference OWASP Risk Rating instead of CVSS - Add explicit guidance on when to use CVSS vs. risk frameworks New Risk Scoring Frameworks (+130 lines): - Add OWASP Risk Rating Methodology with embedded example - Add FAIR framework for quantitative financial risk analysis - Add framework selection guide with decision matrix - Note DREAD deprecation by Microsoft but continued utility Risk Register & Pre-Release Testing (+110 lines): - Add risk register schema with threat-to-test-case mapping - Define 4-phase lifecycle: Identification → Tracking → Testing → Sign-off - Include automation examples for Threagile → pentest integration - Smart thermostat release example with conditional approval Input Artifacts Checklist (+31 lines): - Add comprehensive artifact checklist for "What are we working on?" - Cover Business/Product (PRDs, product briefs, compliance) - Cover Technical/Engineering (functional specs, hardware PRDs, datasheets) - Cover Software/Firmware (SBOM, APIs, architecture, interfaces) - Include rationale for why incomplete artifacts lead to missed threats Impact: - Corrects CVSS misuse throughout document - Adds 2 missing industry-standard frameworks (OWASP Risk Rating, FAIR) - Provides concrete guidance for framework selection - Enables traceability from design through pre-release validation - Makes threat modeling preparation actionable with artifact checklist
1 parent dbc26ed commit 3b2002b

1 file changed

Lines changed: 278 additions & 5 deletions

File tree

docs/threat-model.md

Lines changed: 278 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Threat modeling typically includes the following activities:
1919
2. **Decompose the system** (or device) into components, trust boundaries, and data flows
2020
3. **Identify threats** using structured frameworks (STRIDE, PASTA, LINDDUN, TARA, STRIDE-AI)
2121
4. **Document all threats** with their respective scenarios and attack vectors
22-
5. **Rate each threat** by its likelihood and impact using a risk scoring system (DREAD, CVSS v4.0)
22+
5. **Rate each threat** by its likelihood and impact using a risk scoring system (DREAD, OWASP Risk Rating)
2323
6. **Define mitigations** and prioritize remediation based on risk scores
2424
7. **Validate and iterate** as the system evolves
2525

@@ -775,7 +775,72 @@ DREAD is scored on a scale of 1 to 3 (or 0 to 10) according to each category:
775775

776776
**DREAD Score = (D + R + E + A + D) / 5**
777777

778-
### CVSS v4.0 (Common Vulnerability Scoring System - 2025 Standard)
778+
Note: DREAD was Microsoft's original framework (now deprecated by Microsoft), but remains useful for quick qualitative assessments.
779+
780+
### OWASP Risk Rating Methodology (Recommended)
781+
782+
OWASP Risk Rating is the **recommended approach for threat modeling** in web and embedded applications. It combines threat agent factors, vulnerability factors, and business impact to produce a holistic risk score.
783+
784+
**Risk = Likelihood × Impact**, where:
785+
786+
**Likelihood = (Threat Agent Factors + Vulnerability Factors) / 2**
787+
788+
| Factor | High (3) | Medium (2) | Low (1) |
789+
|--------|----------|-----------|--------|
790+
| **Threat Agent Skills** | Expert attackers (nation-state) | Skilled attackers (organized crime) | Script kiddies, untrained |
791+
| **Threat Agent Motive** | High financial/political gain | Medium gain | Curiosity, low motivation |
792+
| **Threat Agent Opportunity** | Network-accessible, automated | Requires interaction/proximity | Requires physical access |
793+
| **Threat Agent Size** | Large attacker community | Medium-sized groups | Single individuals |
794+
| **Ease of Discovery** | Published/obvious (CVSS, GitHub) | Requires research/analysis | Obscure, requires deep knowledge |
795+
| **Ease of Exploit** | Automated tools, public PoC | Moderate effort required | Custom exploit needed |
796+
| **Awareness** | Well-known vulnerability | Somewhat known | Unknown to most |
797+
| **Intrusion Detection** | Easy to detect/logs | Difficult to detect | Very hard/no logging |
798+
799+
**Impact = (Technical Impact + Business Impact) / 2**
800+
801+
| Impact Type | High | Medium | Low |
802+
|------------|------|--------|-----|
803+
| **Confidentiality** | All data exposed | Sensitive data leaked | Trivial data |
804+
| **Integrity** | Complete system compromise | Partial modification possible | Minimal impact |
805+
| **Availability** | System completely down | Degraded performance | Minor interruption |
806+
| **Accountability** | Attacker actions undetectable | Partial audit trail | Full audit trail |
807+
| **Financial** | $1M+ loss | $100K-$1M | <$100K |
808+
| **Reputation** | Severe brand damage | Moderate damage | Minor impact |
809+
| **Compliance** | Critical violations (fines, recall) | Reportable violations | Minor non-compliance |
810+
811+
**Risk Score = Likelihood × Impact** (0-9 scale):
812+
- **9 (Critical)**: Immediate remediation, block deployment
813+
- **6-8 (High)**: Fix before release, board visibility
814+
- **3-5 (Medium)**: Fix in next release, standard testing
815+
- **1-2 (Low)**: Document, defer unless easy fix
816+
817+
**OWASP Risk Rating Example - Smart Thermostat BLE Pairing**:
818+
```
819+
Threat: Attacker spoofs mobile app, pairs with thermostat, changes temperature
820+
821+
Likelihood Calculation:
822+
Threat Agent: Skill=2 (skilled), Motive=2 (medium), Opportunity=3 (BLE proximity ~50m), Size=2 → avg=2.25
823+
Vulnerability: Discovery=3 (BLE pairing public), Exploit=2 (moderate), Awareness=2, Detection=1 → avg=2
824+
Likelihood = (2.25 + 2) / 2 = 2.125 → round to 2 (Medium)
825+
826+
Impact Calculation:
827+
Technical: Confidentiality=2 (thermostat settings), Integrity=3 (can change setpoints),
828+
Availability=2 (device still operates), Accountability=2 → avg=2.25
829+
Business: Financial=1 (low direct cost), Reputation=2 (user frustration),
830+
Compliance=1 (residential device) → avg=1.33
831+
Impact = (2.25 + 1.33) / 2 = 1.79 → round to 2 (Low-Medium)
832+
833+
Risk Score = 2.125 × 1.79 ≈ 3.8 → **Medium (4)** Priority
834+
Mitigation: Implement BLE Secure Connections Numeric Comparison to raise Exploit difficulty to 3 → Risk drops to Low
835+
```
836+
837+
### CVSS v4.0 (Common Vulnerability Scoring System - Vulnerability Severity)
838+
839+
**Important Distinction**: CVSS v4.0 scores the **technical severity** of *known vulnerabilities* (CVEs, CWEs), not the **business risk** of threat scenarios. For threat modeling:
840+
- **Use CVSS** when scoring identified vulnerabilities during code review or against public CVE databases (e.g., "CVE-2025-12345 scores CVSS 8.5")
841+
- **Use OWASP Risk Rating/DREAD** when scoring threat scenarios from threat modeling (e.g., "BLE pairing bypass threat scores 7.5")
842+
843+
CVSS lacks business context (financial impact, compliance consequences, market segment), which are essential for prioritizing mitigations. Threat models combine CVSS scores on known vulnerabilities with risk scoring frameworks for threat scenarios.
779844

780845
CVSS v4.0 (released June 2023) is the **current industry standard** for vulnerability severity scoring. It addresses IoT/OT-specific contexts better than v3.1.
781846

@@ -866,6 +931,183 @@ cvss_v4_t smart_lock_rce = {
866931
float score = calculate_cvss_v4_base_score(&smart_lock_rce);
867932
```
868933
934+
### FAIR Framework (Quantitative Risk Analysis)
935+
936+
FAIR (Factor Analysis of Information Risk) is a **quantitative framework** for calculating financial risk, essential for executive/board communication and investment decisions. Unlike qualitative frameworks (DREAD, OWASP Risk Rating), FAIR expresses risk in **financial terms**.
937+
938+
**FAIR Formula**:
939+
```
940+
Loss Event Frequency (LEF) = (Threat Event Frequency × Vulnerability) per year
941+
Loss Magnitude (LM) = Financial impact per incident ($)
942+
Annual Loss Expectancy (ALE) = LEF × LM
943+
```
944+
945+
**When to Use FAIR**:
946+
- Executive reporting: "This threat costs $X/year on average"
947+
- ROI justification: "Mitigation investment of $Y reduces risk by $Z/year"
948+
- Cyber insurance: "Annual loss expectancy is $M"
949+
- Board risk appetite discussions
950+
- Budgeting security controls
951+
952+
**FAIR Example - Medical Device Firmware Update Server Compromise**:
953+
```
954+
Asset: Cloud-hosted firmware update server
955+
Threat: Attacker compromises server, injects malicious firmware → recall, litigation, regulatory fines
956+
957+
Threat Event Frequency: 0.2 events per year (historical analysis of similar infrastructure)
958+
Vulnerability: If breach occurs, 85% chance attacker goes undetected for 48 hours (detection capability)
959+
960+
Probability Loss Event = 0.2 × 0.85 = 0.17 breaches/year detected too late
961+
962+
Loss per Incident:
963+
- Recall costs: $5M (logistics, replacement units)
964+
- Regulatory fines (FDA, FCC): $2M
965+
- Litigation/settlements: $10M
966+
- Reputation/lost revenue: $3M
967+
- Total: $20M per incident
968+
969+
Annual Loss Expectancy (ALE) = 0.17 × $20M = $3.4M/year
970+
971+
Mitigation Options:
972+
A) Implement redundant servers + 24/7 monitoring = $500K/year cost → Reduces detection time to 2 hours
973+
→ Reduces loss per incident to $8M (fewer devices auto-updated with malware)
974+
→ New ALE = 0.17 × $8M = $1.36M/year
975+
→ Net savings = $3.4M - $1.36M - $500K = $1.54M/year ✅ Justifies investment
976+
977+
B) Do nothing, accept risk = $3.4M/year loss expectancy (uninsurable)
978+
```
979+
980+
### Framework Selection Guide
981+
982+
Choose the appropriate framework based on your context:
983+
984+
| Framework | Purpose | Output Format | Time to Score | Best For |
985+
|-----------|---------|----------------|---------------|----------|
986+
| **DREAD** | Quick threat assessment | Qualitative (1-3 scale) | 5 min/threat | Early design, brainstorming |
987+
| **OWASP Risk Rating** | Business-aligned risk | Qualitative + business impact (1-9 scale) | 15 min/threat | Regulatory products, compliance evidence |
988+
| **FAIR** | Financial risk quantification | Quantitative ($/year, ALE) | 30-60 min/threat | Executive reporting, budget justification |
989+
| **CVSS** | Known vulnerability severity | Technical (0-10 scale) | 5 min/CVE | Vulnerability management, patch prioritization |
990+
991+
**Decision Tree**:
992+
1. Are you scoring a **known CVE/vulnerability** from a public database? → Use **CVSS**
993+
2. Do you need **financial risk** for executives/insurance? → Use **FAIR**
994+
3. Do you need **regulatory compliance evidence** for audits? → Use **OWASP Risk Rating**
995+
4. Do you need a **quick assessment** for sprint planning? → Use **DREAD**
996+
5. Combining multiple? → **OWASP Risk Rating + FAIR** (qualitative assessment, then quantify high-risk items)
997+
998+
---
999+
1000+
## Threat Model Risk Register (Design → Test → Release)
1001+
1002+
A **risk register** is a structured artifact that tracks identified threats from threat modeling through implementation, pre-release testing, and final sign-off. It bridges the gap between threat modeling and penetration testing by maintaining traceability.
1003+
1004+
### Risk Register Schema
1005+
1006+
Threat registers should include:
1007+
```json
1008+
{
1009+
"threat_registry": [
1010+
{
1011+
"threat_id": "THR-BLE-001",
1012+
"title": "BLE Pairing Bypass",
1013+
"description": "Attacker spoofs mobile app to pair with device",
1014+
"stride_category": "Spoofing",
1015+
"likelihood": "Medium",
1016+
"impact": "High",
1017+
"risk_score": 7.5,
1018+
"risk_framework": "OWASP Risk Rating",
1019+
"priority": "High",
1020+
1021+
"mitigation": {
1022+
"strategy": "Implement BLE Secure Connections with Numeric Comparison",
1023+
"owner": "Firmware Team",
1024+
"target_date": "2025-02-15",
1025+
"status": "In Progress"
1026+
},
1027+
1028+
"validation": {
1029+
"test_case_id": "ISTG-WRLS-INFO-001",
1030+
"test_description": "Attempt pairing without Numeric Comparison validation",
1031+
"pentest_status": "Scheduled",
1032+
"pentest_date": "2025-03-01",
1033+
"result": null,
1034+
"sign_off": false
1035+
},
1036+
1037+
"residual_risk": {
1038+
"likelihood": "Low",
1039+
"impact": "Medium",
1040+
"risk_score": 2.0,
1041+
"accepted": false
1042+
}
1043+
}
1044+
]
1045+
}
1046+
```
1047+
1048+
### Risk Register Lifecycle
1049+
1050+
**Phase 1: Identification (Design)**
1051+
- Threat modeling team identifies threat using STRIDE/PASTA
1052+
- Assign risk score using OWASP Risk Rating or FAIR
1053+
- Create mitigation strategy with owner and timeline
1054+
1055+
**Phase 2: Tracking (Development)**
1056+
- Development team updates mitigation status in risk register
1057+
- Weekly reviews in sprint planning/security meetings
1058+
- Escalate blocked items to security team lead
1059+
1060+
**Phase 3: Pre-Release Testing (QA/Security)**
1061+
- Security team creates pentest test cases mapped to each threat
1062+
- Penetration testers execute tests and update validation status
1063+
- Document findings and mitigation verification
1064+
1065+
**Phase 4: Sign-Off (Release)**
1066+
- Security team reviews risk register completeness
1067+
- All threats must have validation evidence (pentest report, code review)
1068+
- Residual risk assessment: Accept or defer release
1069+
- Compliance review for regulated industries (medical, automotive, defense)
1070+
1071+
### Automated Risk Register Integration
1072+
1073+
**Example: Map Threagile threats to pentest test plan**:
1074+
```bash
1075+
#!/bin/bash
1076+
# Generate test plan from threat model
1077+
1078+
threagile analyze --model threat-model.yaml --output threats.json
1079+
1080+
# Extract critical threats
1081+
jq -r '.risks[] | select(.severity=="critical") |
1082+
"Test: \(.title)\nDescription: \(.description)\nMitigation: \(.mitigations[0])\n"' \
1083+
threats.json > pentest-testplan.txt
1084+
1085+
# Track in issue system
1086+
for threat in $(jq -r '.risks[].id' threats.json); do
1087+
gh issue create \
1088+
--title "Validate Mitigation: $threat" \
1089+
--body "Test for threat $threat per threat model" \
1090+
--label "security,pentest-required" \
1091+
--project "Release 2025-Q1"
1092+
done
1093+
```
1094+
1095+
### Risk Register Example - Smart Thermostat Release
1096+
1097+
| Threat ID | Threat | Risk Score | Mitigation | Pentest Status | Sign-Off |
1098+
|-----------|--------|------------|-----------|-----------------|----------|
1099+
| THR-001 | BLE pairing bypass | 7.5 | Numeric Comparison | ✅ Pass | ✅ Approved |
1100+
| THR-002 | Hardcoded API key | 8.2 | Environment variables | ✅ Pass | ✅ Approved |
1101+
| THR-003 | Unencrypted settings | 6.1 | AES-256-GCM | ✅ Pass | ✅ Approved |
1102+
| THR-004 | Debug interface exposed | 5.0 | JTAG disabled in release | 🟡 Pending | ❌ Blocked |
1103+
| THR-005 | Firmware rollback | 4.2 | Anti-rollback counter | ⏳ Scheduled | ⏳ Pending |
1104+
1105+
**Release Decision**:
1106+
- ✅ 3 threats fully mitigated and validated
1107+
- 🟡 1 threat mitigation pending pentest (defer release by 1 week)
1108+
- ⏳ 1 threat in progress (acceptable for this release per risk appetite)
1109+
- **Release Status**: Conditional approval pending THR-004 pentest pass
1110+
8691111
---
8701112

8711113
## Open Source Threat Modeling Tools (OWASP Focus)
@@ -2247,6 +2489,39 @@ generate_dfd_from_config('network-config.yaml')
22472489

22482490
## Threat Model Documentation Standards
22492491

2492+
### Input Artifacts for Threat Modeling
2493+
2494+
Before beginning threat modeling, gather these artifacts to answer **"What are we working on?"** Complete documentation enables thorough threat identification and accurate risk assessment.
2495+
2496+
**Business & Product Context** (defines scope and risk appetite):
2497+
- [ ] Product Requirements Document (PRD) - Features, user workflows, business objectives
2498+
- [ ] Product management briefs - Target market, deployment scale, product lifecycle, go-to-market strategy
2499+
- [ ] Business requirements - Revenue model, competitive positioning, stakeholder priorities
2500+
- [ ] Regulatory/compliance requirements - FDA, ISO 26262, IEC 62443, GDPR, industry-specific standards
2501+
2502+
**Technical & Engineering Design** (defines attack surface):
2503+
- [ ] Functional Specifications (FSD) - How each feature is implemented technically
2504+
- [ ] Hardware PRD - Component selection, power requirements, form factor, interface options
2505+
- [ ] Engineering commitment slides - Design decisions, technical milestones, trade-offs, risk acceptance
2506+
- [ ] System architecture diagrams - Block diagrams, trust boundaries, component interactions
2507+
- [ ] Component datasheets - MCU specs, radio modules (BLE/Wi-Fi), sensors, cryptographic accelerators
2508+
2509+
**Software & Firmware** (defines implementation details):
2510+
- [ ] Software architecture - Firmware components, OS selection (RTOS/Linux), driver stack, memory layout
2511+
- [ ] API specifications - REST APIs, internal interfaces, RPC protocols, message formats
2512+
- [ ] Software Bill of Materials (SBOM) - Third-party libraries, versions, known CVEs (CycloneDX/SPDX format)
2513+
- [ ] Network/data flow diagrams - Protocol usage, data paths, encryption points, cross-device communication
2514+
- [ ] Interface specifications - UART/JTAG/SPI/I2C debug interfaces, wireless protocols (BLE, Wi-Fi, Zigbee)
2515+
2516+
**Optional (for detailed threat modeling)**:
2517+
- [ ] User stories/use cases - User interactions, authentication flows, privilege models
2518+
- [ ] Source code - For white-box threat modeling and code review correlation
2519+
- [ ] Existing security assessments - Prior pentests, static analysis reports, vulnerability scans
2520+
2521+
**Rationale**: Incomplete artifacts lead to missed threats. Without hardware datasheets, physical attack vectors (JTAG, glitch injection, side-channels) may be overlooked. Without PRDs, business impact cannot be accurately assessed for risk scoring. Without firmware architecture, supply chain and third-party risks are invisible.
2522+
2523+
---
2524+
22502525
### Threat Model Document Template
22512526

22522527
```markdown
@@ -2401,6 +2676,4 @@ Threat models should answer the following four questions:
24012676
* [MITRE ATT&CK for ICS](https://attack.mitre.org/matrices/ics/) - Industrial control systems tactics
24022677
* [MITRE ATT&CK for Mobile](https://attack.mitre.org/matrices/mobile/) - IoT and mobile threats
24032678
* [CVE Database](https://cve.mitre.org/) - Common Vulnerabilities and Exposures
2404-
* [NIST NVD](https://nvd.nist.gov/) - National Vulnerability Database
2405-
2406-
*Co-Authored-By: Claude <noreply@anthropic.com>*
2679+
* [NIST NVD](https://nvd.nist.gov/) - National Vulnerability Database

0 commit comments

Comments
 (0)