Threat Modeling Skill
🔴 AI FIRST Quality Principle
Apply the AI FIRST principle: never accept first-pass quality. Minimum 2 iterations. Read all output, improve every section. No shortcuts.
Purpose
This skill embodies the complete Hack23 AB threat modeling methodology as defined in ISMS Threat_Modeling.md. It provides systematic threat identification, risk quantification, and security control validation for proactive security assurance across all Hack23 projects.
Key Philosophy: "Security through transparency" - All threat models are publicly documented to demonstrate security excellence to clients, regulators, and the open-source community.
Hack23 Threat Modeling Process (ISMS § 4)
Per ISMS Threat_Modeling.md, Hack23 employs a five-strategy integrated approach:
1. 🎯 Attacker-Centric (ISMS § 4.1)
MITRE ATT&CK Framework Integration
- Map attack tactics and techniques to system components
- Identify threat agents (Nation-state APTs, Cybercriminals, Hacktivists, Malicious Insiders)
- Analyze attack scenarios based on current threat intelligence (ENISA Threat Landscape 2024)
- Red team perspective: "How would I compromise this system?"
Required Outputs:
- MITRE ATT&CK technique mapping per system component
- Threat agent capability and motivation analysis
- Attack scenario documentation
2. 🏰 Asset-Centric (ISMS § 4.2)
Crown Jewel Protection
- Identify critical assets from Asset Register
- Apply Data Classification Policy (Public, Internal, Confidential, Restricted)
- Map data flows and asset dependencies
- Prioritize threats by asset criticality
Required Outputs:
- Asset inventory with CIA triad classification
- Data flow diagrams (DFDs) showing trust boundaries
- Crown jewel identification and protection strategies
3. 🏗️ Architecture-Centric (ISMS § 4.3)
STRIDE Per Element Analysis
- Apply STRIDE framework to each system component
- Identify trust boundaries and crossing points
- Analyze external entity, process, data store, data flow threats
- Validate security controls per architectural layer
Required Outputs:
- Complete DFD with trust boundaries
- STRIDE threat enumeration per DFD element
- Control gap identification
4. 📖 Scenario-Centric (ISMS § 4.4)
Use Case Abuse Modeling
- Develop misuse cases from legitimate use cases
- Model attacker goals and sub-goals
- Identify abuse scenarios specific to business logic
- Analyze social engineering attack paths
Required Outputs:
- Misuse case diagrams
- Business logic abuse scenarios
- Social engineering attack paths
5. 📊 Risk-Centric (ISMS § 4.5)
Quantitative Risk Assessment
- Calculate risk scores: Risk = Likelihood × Impact
- Use Classification Framework for impact scoring
- Apply risk matrix for prioritization
- Document risk treatment decisions (Avoid, Mitigate, Transfer, Accept)
Required Outputs:
- Quantitative risk scores per threat
- Risk matrix visualization
- Risk treatment plan with ownership
Security Foundations
CIA Triad
| Principle |
Definition |
Key Controls |
Threat Categories |
| Confidentiality |
Information accessible only to authorized entities |
Encryption, access control, authentication |
Information disclosure, credential theft |
| Integrity |
Data protection from unauthorized modification |
Checksums, digital signatures, version control |
Tampering, data corruption |
| Availability |
Reliable and timely access to systems |
Redundancy, DR, DDoS mitigation |
DoS, outages, resource exhaustion |
AAA Framework
| Component |
Definition |
Integration |
| Authentication |
Identity verification |
Access Control Policy |
| Authorization |
Permitted actions |
RBAC, ABAC implementation |
| Accounting |
Activity tracking |
Security monitoring, audit logs |
STRIDE Threat Modeling Framework
STRIDE Categories
S - Spoofing Identity
- Definition: Attacker gains access using false identity
- Controls: Multi-factor authentication, certificate pinning, identity verification
- Static Site Threats: Domain hijacking, DNS spoofing, certificate spoofing
- Mitigations: HTTPS enforced, DNSSEC, Certificate Transparency monitoring
T - Tampering with Data
- Definition: Data modification during application flow
- Controls: Digital signatures, checksums, integrity monitoring
- Static Site Threats: Repository compromise, unauthorized commits, content injection
- Mitigations: Branch protection, required PR reviews, GPG signed commits, GitHub audit logs
R - Repudiation
- Definition: Attacker denies actions without proof capability
- Controls: Audit logging, digital signatures, non-repudiation mechanisms
- Static Site Threats: Unauthorized changes without attribution
- Mitigations: Git commit history (immutable), GitHub audit logs, signed commits required
I - Information Disclosure
- Definition: Unauthorized access to private or sensitive data
- Controls: Encryption, access controls, data classification
- Static Site Threats: Accidental secret commits, source code exposure
- Mitigations: Secret scanning enabled, .gitignore for sensitive files, public repository classification
D - Denial of Service
- Definition: System availability reduction or service crash
- Controls: Rate limiting, DDoS protection, redundancy
- Static Site Threats: DDoS attacks, resource exhaustion
- Mitigations: GitHub Pages CDN, rate limiting, global distribution
E - Elevation of Privilege
- Definition: Attacker assumes privileged user identity
- Controls: Least privilege, RBAC, privilege separation
- Static Site Threats: Unauthorized admin access, workflow manipulation
- Mitigations: Minimal workflow permissions, protected branches, required reviews
MITRE ATT&CK Integration
Tactics & Techniques
| Tactic |
Description |
Common Techniques |
| Reconnaissance |
Information gathering |
Active scanning, OSINT |
| Resource Development |
Establishing resources |
Compromise accounts, infrastructure setup |
| Initial Access |
Network entry |
Phishing, drive-by compromise, supply chain |
| Execution |
Malicious code execution |
Command interpreters, malicious input |
| Persistence |
Foothold maintenance |
Account manipulation, backdoors |
| Privilege Escalation |
Higher permissions |
Exploitation, process injection |
| Defense Evasion |
Detection avoidance |
Obfuscation, bypass controls |
| Credential Access |
Credential theft |
Brute force, token stealing |
| Discovery |
Environment reconnaissance |
Cloud discovery, network mapping |
| Lateral Movement |
Environment traversal |
Remote services, credential reuse |
| Collection |
Data gathering |
Local data, cloud storage |
| Command & Control |
System communication |
Application layer protocols |
| Exfiltration |
Data theft |
C2 channel, cloud storage |
| Impact |
System destruction |
Data destruction, resource hijacking |
Threat Agent Classification
| Threat Agent |
Category |
Risk Level |
MITRE Tactics |
| Accidental Insiders |
Internal |
Medium |
Execution, Privilege Escalation |
| Malicious Insiders |
Internal |
High |
Initial Access, Impact |
| Cybercriminals |
External |
High |
Reconnaissance, Collection |
| Nation-State APTs |
External |
Critical |
Persistence, Defense Evasion |
| Hacktivists |
External |
Medium |
Impact, Privilege Escalation |
| Service Providers |
External |
Medium |
Initial Access, Defense Evasion |
| Cyber Vandals |
External |
Low |
Impact, Execution |
Current Threat Landscape (ENISA 2024)
| Priority |
Threat Category |
Business Impact |
Mitigation Priority |
| 1 |
Threats Against Availability |
Revenue protection |
Critical |
| 2 |
Ransomware |
Business continuity |
Critical |
| 3 |
Threats Against Data |
Risk reduction |
High |
| 4 |
Malware |
Operational excellence |
High |
| 5 |
Social Engineering |
Trust enhancement |
High |
| 6 |
Information Manipulation |
Competitive advantage |
Medium |
| 7 |
Supply Chain Attacks |
Partnership value |
High |
Attack Tree Analysis (ISMS § 4.6)
Attack trees are mandatory for all Hack23 threat models per ISMS policy. They provide:
Purpose
- Visual decomposition of attack paths from goal to sub-goals
- AND/OR relationship mapping between attack steps
- Success probability calculation for attack paths
- Critical path identification for mitigation prioritization
Attack Tree Structure
Root: Attack Goal (e.g., "Compromise Application")
├── OR Gate: Any child succeeds → parent succeeds
│ ├── AND Gate: All children must succeed → parent succeeds
│ │ ├── Leaf: Individual attack step (Likelihood: 40%, Impact: High)
│ │ └── Leaf: Individual attack step (Likelihood: 60%, Impact: Medium)
│ └── AND Gate: Alternative attack path
│ ├── Leaf: Attack step 1
│ └── Leaf: Attack step 2
└── OR Gate: Second major attack vector
└── Leaf: Direct attack
Example: Static Website Compromise (from Riksdagsmonitor)
Root: Compromise Riksdagsmonitor Platform
├── OR: Infrastructure Attack
│ ├── AND: DNS Hijacking
│ │ ├── Compromise Route 53 credentials (Likelihood: 10%, Impact: Critical)
│ │ └── Modify DNS records (Likelihood: 95%, Impact: Critical)
│ └── AND: S3 Bucket Compromise
│ ├── Find misconfigured bucket (Likelihood: 5%, Impact: High)
│ └── Upload malicious content (Likelihood: 90%, Impact: High)
└── OR: Supply Chain Attack
├── AND: Compromise GitHub Account
│ ├── Steal developer credentials (Likelihood: 15%, Impact: Critical)
│ └── Bypass MFA (Likelihood: 20%, Impact: Critical)
└── AND: Malicious Dependency Injection
├── Compromise npm package (Likelihood: 5%, Impact: High)
└── Inject malicious code (Likelihood: 80%, Impact: Critical)
Attack Tree Analysis Steps
- Goal Identification: Define attacker objectives
- Path Decomposition: Break down into AND/OR sub-goals
- Leaf Node Likelihood: Assign success probability (1-100%)
- Impact Assessment: Use Classification Framework
- Path Calculation: Calculate cumulative success likelihood
- Critical Path: Identify highest risk paths
- Mitigation Priority: Focus on high-likelihood, high-impact leaves
Integration with STRIDE
Each STRIDE threat should have corresponding attack tree showing exploitation paths.
Data Flow Diagrams (DFD)
DFD Elements
- External Entity: Sources/sinks of data (users, external systems)
- Process: Data transformation or computation
- Data Store: Persistent storage
- Data Flow: Movement between elements
- Trust Boundary: Security domain separation
STRIDE per DFD Element
| Element |
Applicable STRIDE Threats |
| External Entity |
Spoofing, Repudiation |
| Process |
All 6 STRIDE categories |
| Data Store |
Tampering, Information Disclosure, DoS |
| Data Flow |
Tampering, Information Disclosure, DoS |
| Trust Boundary |
Elevation of Privilege |
Quantitative Risk Assessment
Risk Calculation
Risk = Likelihood × Impact
Likelihood Scoring
- Critical (5): Near certain (>90%)
- High (4): Likely (60-90%)
- Medium (3): Possible (30-60%)
- Low (2): Unlikely (10-30%)
- Negligible (1): Rare (<10%)
Impact Scoring (per Classification Framework)
- Critical (5): >$10K daily, complete outage, criminal charges
- High (4): $5K-10K daily, major degradation, significant fines
- Medium (3): $1K-5K daily, moderate impact, compliance violations
- Low (2): $500-1K daily, minor impact, warnings
- Negligible (1): <$500 daily, minimal impact, no regulatory
Risk Matrix
| Likelihood → Impact |
Negligible (1) |
Low (2) |
Medium (3) |
High (4) |
Critical (5) |
| Critical (5) |
Medium |
High |
High |
Critical |
Critical |
| High (4) |
Medium |
Medium |
High |
High |
Critical |
| Medium (3) |
Low |
Medium |
Medium |
High |
High |
| Low (2) |
Low |
Low |
Medium |
Medium |
High |
| Negligible (1) |
Low |
Low |
Low |
Medium |
Medium |
Threat Model Document Structure
Every repository MUST maintain THREAT_MODEL.md with:
1. System Overview
- Architecture description
- Key components and dependencies
- Trust boundaries
- Data flows
2. Asset Inventory
- Critical assets from Asset Register
- Data classification (per Classification Framework)
- Crown jewel identification
3. STRIDE Analysis
- Threat per component
- Likelihood and impact ratings
- Attack vectors
- Existing controls
4. MITRE ATT&CK Mapping
- Applicable tactics and techniques
- Attack scenarios
- Detection opportunities
5. Attack Trees
- Visual attack path decomposition
- Success probabilities
- Critical attack steps
6. Risk Assessment
- Quantitative risk scores
- Risk matrix visualization
- Risk treatment decisions
7. Security Controls
- Current control implementation
- Control effectiveness
- Control gaps
8. Residual Risk
- Accepted risks with justification
- Risk owners
- Monitoring requirements
9. Recommendations
- Short-term improvements (0-3 months)
- Medium-term enhancements (3-12 months)
- Long-term roadmap (12+ months)
Threat Modeling Workflow (ISMS § 6)
Follow this structured 7-phase process for all Hack23 threat models:
Phase 1: Planning (Week 1)
Phase 2: Data Collection (Week 1-2)
Phase 3: Threat Identification (Week 2-3)
Phase 4: Risk Assessment (Week 3)
Phase 5: Mitigation Planning (Week 3-4)
Phase 6: Documentation (Week 4)
Phase 7: Review & Continuous Improvement (Ongoing)
Best Practices & Quality Standards
✅ Do's
- Start Early: Threat model during design phase, not after implementation
- Use All 5 Strategies: Attacker, Asset, Architecture, Scenario, Risk-centric
- Quantify Risk: Use likelihood × impact matrix, not just qualitative assessment
- Document Visually: Mermaid DFDs, attack trees, risk matrices
- Link Everything: Cross-reference SECURITY_ARCHITECTURE.md, Risk_Register.md
- Business Value: Quantify cost avoidance, competitive advantage
- Public Transparency: All threat models public (security through transparency)
- Continuous Updates: Threat landscape evolves, models must too
- Attack Trees Mandatory: Minimum 3-5 trees per ISMS § 4.6
- MITRE ATT&CK Required: Map tactics/techniques per ISMS § 4.6
❌ Don'ts
- Skip Attack Trees: ISMS § 4.6 requires attack tree analysis
- Generic Threats: Customize to actual system architecture
- Ignore Low Risks: Document all risks, even accepted ones
- One-Time Activity: Threat modeling is continuous, not one-and-done
- Missing Controls: Every threat needs control or risk acceptance
- No Quantification: Risk scores required, not just High/Medium/Low
- Siloed Analysis: Integrate with ISMS policies (Access Control, Crypto, Network)
- Forget Business Value: Security is business enabler, quantify benefits
- Incomplete Documentation: Follow mandatory structure § 5 completely
- No CEO Approval: All threat models require CEO sign-off
Integration with Hack23 ISMS
Required Policy Cross-References
Every THREAT_MODEL.md must reference and align with:
Information_Security_Policy.md
- Overall security governance framework
- Management commitment to security
Access_Control_Policy.md
- Authentication threats → MFA requirements
- Authorization threats → RBAC design
- Credential threats → Password policies
Data_Classification_Policy.md
- Asset classification (Public, Internal, Confidential, Restricted)
- Data handling requirements per classification
- Information disclosure threat impact assessment
Network_Security_Policy.md
- Network-based threats and controls
- Zero-trust architecture requirements
- TLS 1.3 enforcement
Cryptography_Policy.md
- Encryption requirements for data in transit/rest
- Key management threats
- Cryptographic algorithm standards
Secure_Development_Policy.md
- Application security threats → SAST/DAST requirements
- Supply chain threats → Dependency scanning (Dependabot, FOSSA)
- Code injection threats → Secure coding standards
- Security architecture documentation requirements
Vulnerability_Management.md
- Vulnerability scanning requirements (SonarCloud, Trivy, OWASP ZAP)
- Remediation SLAs per severity
- Patch management process
Incident_Response_Plan.md
- Detection requirements → SIEM/monitoring configuration
- Response procedures → Playbook development
- Recovery objectives → RTO/RPO alignment
Business_Continuity_Plan.md
- Availability threats → Redundancy design
- Disaster scenarios → DR procedures
- Service criticality → Priority ranking
CLASSIFICATION.md
- CIA triad definitions (Confidentiality, Integrity, Availability)
- RTO/RPO classifications for availability impact
- Business impact analysis for risk quantification
Risk_Register.md
- Enterprise-wide risk tracking
- Risk treatment decisions
- Risk ownership and accountability
Compliance Framework Mapping
Map all threats and controls to:
ISO 27001:2022 Annex A Controls:
- A.5.7: Threat Intelligence
- A.8.1-8.34: Technology Controls (per threat category)
- A.5.12: Classification of Information
- A.5.24: Information Security Risk Assessment
- A.5.25: Information Security Risk Treatment
NIST CSF 2.0 Functions:
- ID: Asset identification, threat intelligence
- PR: Security architecture, access control
- DE: Monitoring, anomaly detection
- RS: Incident response, communications
- RC: Recovery planning, improvements
CIS Controls v8.1:
- Control 1: Inventory and Control of Enterprise Assets
- Control 4: Secure Configuration of Enterprise Assets
- Control 5: Account Management
- Control 10: Malware Defenses
- Control 13: Network Monitoring and Defense
- Control 16: Application Software Security
AWS Well-Architected Framework (for AWS projects)
- Security Pillar: Identity, detective controls, infrastructure protection
- Reliability Pillar: Fault isolation, DR planning
- Performance Efficiency: Monitoring, selection
Mermaid Diagram Standards for Threat Models
Use ISMS color palette (per STYLE_GUIDE.md v2.3):
Classification Colors
Critical/Extreme: #D32F2F # Red
High/Very High: #FF9800 # Orange
Medium/Moderate: #FFC107 # Amber
Low/Standard: #4CAF50 # Green
Public/Minimal: #9E9E9E # Grey
Trust Boundary Colors
External (Untrusted): #D32F2F # Red
DMZ (Partially Trusted): #FF9800 # Orange
Internal (Trusted): #4CAF50 # Green
Secure (Highly Trusted): #2196F3 # Blue
Example DFD with Trust Boundaries
graph TB
User[End Users<br/>🌐 External]
CDN[CloudFront CDN<br/>🔒 Edge Security]
S3[S3 Buckets<br/>💾 Static Content]
GitHub[GitHub Actions<br/>⚙️ CI/CD]
User -->|HTTPS TLS 1.3| CDN
CDN -->|Serves| S3
GitHub -->|Deploy OIDC| S3
subgraph External["🔴 Untrusted Zone"]
User
end
subgraph Edge["🟠 Edge Security Zone"]
CDN
end
subgraph Internal["🟢 Trusted AWS Zone"]
S3
GitHub
end
style User fill:#D32F2F,color:#fff
style CDN fill:#FF9800,color:#000
style S3 fill:#4CAF50,color:#000
style GitHub fill:#4CAF50,color:#000
Remember: Hack23 Threat Modeling Philosophy
- 🔍 Proactive Not Reactive: Identify threats before they materialize
- 🏰 Defense in Depth: Multiple security layers reduce single point of failure
- 📊 Risk-Based Prioritization: Focus resources on high-impact threats first
- 🔄 Continuous Process: Threat landscape evolves, models must evolve too
- 📝 Documentation Essential: THREAT_MODEL.md is mandatory, not optional
- 🔗 Integration Critical: Align with all ISMS policies for consistency
- 🌟 Transparency Advantage: Public threat models demonstrate security expertise
- 💹 Quantitative Assessment: Numbers drive decisions, not gut feelings
- 🎯 Business Value: Security enables business, quantify the benefits
- ✅ CEO Accountability: James Pether Sörling approves all threat models
"Security through transparency" - Hack23 AB
Hack23 Threat Model Examples
Per ISMS Threat_Modeling.md § 7, all Hack23 projects maintain comprehensive threat models demonstrating security excellence through transparency.
1. 🏛️ Citizen Intelligence Agency (CIA)
Repository: Hack23/cia
Threat Model: THREAT_MODEL.md
Architecture: Full-stack web application (Java/Spring Boot + PostgreSQL + AWS)
Key Characteristics:
- System Type: Multi-tier web application with database and external integrations
- Data Classification: Public (parliamentary data) + Internal (system credentials)
- Threats: STRIDE analysis across 6 layers (Frontend, Backend, Database, AWS, CI/CD, Supply Chain)
- MITRE ATT&CK: 14 tactics mapped with 40+ techniques
- Attack Trees: 8 comprehensive trees for major attack scenarios
- Risk Level: MEDIUM (6.5/10.0) after controls, 92.3% risk reduction
- Controls: Defense-in-depth with AWS Well-Architected Framework alignment
Notable Sections:
- Comprehensive DFD with 5 trust boundaries
- Quantitative risk matrix (Likelihood × Impact)
- PostgreSQL-specific tampering and DoS threats
- Supply chain attack trees (npm, Maven dependencies)
- Detailed MITRE ATT&CK technique mapping per component
- Business value integration (€200K+ cost avoidance through proactive security)
Use CIA as reference for:
- Multi-tier application threat modeling
- Database security threat analysis
- Complex supply chain threat modeling
- Comprehensive MITRE ATT&CK integration
2. 🎮 Black Trigram (흑괘)
Repository: Hack23/blacktrigram
Threat Model: THREAT_MODEL.md
Architecture: Frontend-only gaming application (React + Vite + Phaser.js)
Key Characteristics:
- System Type: Client-side gaming application with no backend
- Data Classification: Public (game content) + Internal (GitHub credentials)
- Threats: STRIDE analysis focused on frontend, CI/CD, and CDN
- MITRE ATT&CK: 12 tactics with gaming-specific techniques
- Attack Trees: 6 trees covering game hacking, cheating, and infrastructure
- Risk Level: LOW (4.2/10.0) after controls, 95.8% risk reduction
- Controls: CSP, SRI, no sensitive data storage, immutable game state
Notable Sections:
- Game-specific threats (cheating, save game manipulation, asset theft)
- Client-side security analysis (XSS, prototype pollution, memory manipulation)
- React and Vite supply chain risks
- Browser-based attack scenarios
- Phaser.js framework-specific vulnerabilities
Use Black Trigram as reference for:
- Frontend-only application threat modeling
- Gaming application security analysis
- Client-side attack scenarios
- No-backend architecture threats
3. 🗳️ Riksdagsmonitor (Current Project)
Repository: Hack23/riksdagsmonitor
Threat Model: THREAT_MODEL.md
Architecture: Static HTML/CSS website with Chart.js/D3.js dashboards + AWS CloudFront CDN
Key Characteristics:
- System Type: Static website with interactive JavaScript dashboards
- Data Classification: Public (all content, Swedish Parliament data)
- Threats: STRIDE analysis for static hosting, CDN, and external data links
- MITRE ATT&CK: 11 tactics focusing on infrastructure and supply chain
- Attack Trees: Required expansion per this issue
- Risk Level: LOW (5.52/10.0) after controls, 99.7% risk reduction
- Controls: HTTPS-only, CSP, SRI, GitHub Pages DR, CloudFront distribution
Notable Sections:
- Static site-specific threats (domain hijacking, CDN compromise, typosquatting)
- Multi-language website security (14 languages)
- Chart.js/D3.js dashboard vulnerabilities
- CSV data integrity threats (CIA platform data)
- AWS CloudFront and S3 infrastructure threats
- Agentic workflow threats (Claude Opus 4.8 news generation)
Use Riksdagsmonitor as reference for:
- Static website threat modeling
- CDN security analysis
- Multi-language site threats
- Data visualization security
- AI agentic workflow security
4. 📊 CIA Compliance Manager
Repository: Hack23/cia-compliance-manager (referenced in ISMS policy)
Threat Model: THREAT_MODEL.md
Architecture: Static HTML/CSS compliance dashboard
Key Characteristics:
- System Type: Static compliance visualization platform
- Data Classification: Public (compliance frameworks) + Internal (API tokens)
- Threats: Similar to riksdagsmonitor but focused on compliance data integrity
- Risk Level: LOW (targeted at auditors and compliance teams)
- Controls: Read-only public data, no user authentication
Use CIA Compliance Manager as reference for:
- Compliance dashboard threat modeling
- Read-only platform security
- Framework mapping security
❌ WRONG STRUCTURE (Do NOT Use)
NEVER use numbered sections (1-10) like this:
## 1. System Boundary and Assets
## 2. STRIDE Threat Analysis
## 3. Attack Trees
## 4. MITRE ATT&CK Mapping
## 5. Risk Quantification
## 6. Threat Scenarios
## 7. Security Metrics
## 8. Assumptions and Constraints
## 9. Recommendations
## 10. Approval and Review
Why wrong: This generic structure is NOT aligned with Hack23 ISMS Threat_Modeling.md policy and does NOT demonstrate the 5-strategy integrated approach or domain expertise.
✅ CORRECT STRUCTURE: Hack23 Thematic Sections
All Hack23 threat models use thematic sections (not numbered) that demonstrate comprehensive threat modeling maturity. Structure varies by project domain but core sections are mandatory.
Mandatory Core Sections (All Projects)
1. Header Section (per STYLE_GUIDE.md v2.3)
<p align="center">
<img src="https://hack23.com/icon-192.png" alt="Hack23 Logo" width="192" height="192">
</p>
<h1 align="center">🎯 [Project Name] — Threat Model</h1>
<p align="center">
<strong>🛡️ Proactive Security Through Structured Threat Analysis</strong><br>
<em>🔍 STRIDE • MITRE ATT&CK • [Architecture Type] • [Key Security Focus]</em>
</p>
<p align="center">
<a href="#"><img src="https://img.shields.io/badge/Owner-CEO-0A66C2?style=for-the-badge" alt="Owner"/></a>
<a href="#"><img src="https://img.shields.io/badge/Version-1.0-555?style=for-the-badge" alt="Version"/></a>
<a href="#"><img src="https://img.shields.io/badge/Effective-YYYY--MM--DD-success?style=for-the-badge" alt="Effective Date"/></a>
<a href="#"><img src="https://img.shields.io/badge/Review-Quarterly-orange?style=for-the-badge" alt="Review Cycle"/></a>
</p>
**📋 Document Owner:** CEO | **📄 Version:** 1.0 | **📅 Last Updated:** YYYY-MM-DD (UTC)
**🔄 Review Cycle:** Quarterly | **⏰ Next Review:** YYYY-MM-DD
**🏢 Owner:** Hack23 AB (Org.nr 5595347807) | **🏷️ Classification:** Public
2. CEO Purpose Statement
Quote from CEO James Pether Sörling connecting threat modeling to Hack23's transparency and security excellence principles:
"At Hack23, we believe that true security comes through transparency and demonstrable practices. This threat model is publicly available to showcase our proactive security posture, allowing clients and stakeholders to verify our commitment to security excellence. By openly documenting our threat analysis, we demonstrate not just what we protect, but how we protect it."
3. Executive Summary
- High-level threat overview
- Key risk metrics (High/Medium/Low threat counts)
- Residual risk level
- Major findings and recommendations
4. System Boundary and Assets (ISMS § 5.1)
- System Components: Mermaid diagram showing architecture with trust boundaries
- Assets: Table with Asset, Type, Classification (per Classification Framework), Value
- Trust Boundaries: List all trust boundary crossings
5. STRIDE Threat Analysis (ISMS § 5.2)
For each STRIDE category (Spoofing, Tampering, Repudiation, Information Disclosure, DoS, Elevation of Privilege):
- Threat Description: What the threat is
- Attack Vector: How it's exploited
- Likelihood: Low/Medium/High/Critical (1-5 score)
- Impact: Based on Classification Framework (1-5 score)
- Risk Score: Likelihood × Impact
- Current Controls: Existing mitigations
- Residual Risk: After controls
- Recommendations: Additional mitigations needed
6. Attack Tree Analysis (ISMS § 5.3) - MANDATORY
Minimum 3-5 attack trees showing major attack scenarios:
- Root goal (e.g., "Compromise Application")
- AND/OR gate structure
- Leaf nodes with success likelihood
- Visual representation in Mermaid or text format
- Critical path identification
7. MITRE ATT&CK Mapping (ISMS § 5.4) - MANDATORY
Map applicable tactics and techniques:
- Tactic: MITRE ATT&CK tactic (e.g., Initial Access, Execution)
- Technique: Specific technique ID (e.g., T1566 - Phishing)
- Sub-Technique: If applicable
- System Component: Where it applies
- Detection: How to detect
- Mitigation: How to prevent
8. Risk Assessment Summary (ISMS § 5.5)
- Risk Matrix: Visual Likelihood × Impact matrix
- Risk Distribution: Count of Critical/High/Medium/Low risks
- Risk Treatment Decisions: Per threat (Avoid, Mitigate, Transfer, Accept)
- Residual Risk Justification: Why remaining risk is acceptable
9. Security Controls (ISMS § 5.6)
Reference SECURITY_ARCHITECTURE.md with:
- Control categories (Preventive, Detective, Corrective)
- Implementation status
- Control effectiveness rating
- Control gaps and roadmap
10. Business Value Integration (ISMS § 5.7) - REQUIRED
Quantify security business value:
- 🏆 Competitive Advantage: Market differentiation through transparent security
- 🤝 Customer Trust: Demonstrable security posture
- 💰 Cost Avoidance: Prevented incident costs (quantify)
- 🔄 Operational Excellence: Reduced security overhead
- 💡 Innovation Enablement: Secure experimentation
- 🛡️ Risk Reduction: Quantitative risk reduction percentage
11. Compliance Mapping (ISMS § 5.8)
Map threats and controls to:
- ISO 27001:2022: Relevant Annex A controls
- NIST CSF 2.0: Functions and categories
- CIS Controls v8.1: Applicable controls
- AWS Well-Architected: For AWS projects
12. Related Documents (ISMS § 5.9)
## 📚 Related Documents
- [🏛️ Architecture](./ARCHITECTURE.md) - System architecture with C4 models
- [🔐 Security Architecture](./SECURITY_ARCHITECTURE.md) - Security controls implementation
- [📊 Data Model](./DATA_MODEL.md) - Data entities and relationships
- [🔄 Workflows](./WORKFLOWS.md) - CI/CD security workflows
- [📋 ISMS Threat Modeling Policy](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Threat_Modeling.md) - Comprehensive methodology
- [🏷️ Classification Framework](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md) - Business impact analysis
- [📉 Risk Register](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Risk_Register.md) - Enterprise risk management
- [🛠️ Secure Development Policy](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Secure_Development_Policy.md) - SDLC security requirements
**Reference Implementations:**
- [🏛️ CIA Threat Model](https://github.com/Hack23/cia/blob/master/THREAT_MODEL.md) - Full-stack web application
- [🎮 Black Trigram Threat Model](https://github.com/Hack23/blacktrigram/blob/main/THREAT_MODEL.md) - Frontend gaming application
- [📊 CIA Compliance Manager](https://github.com/Hack23/cia-compliance-manager/blob/main/THREAT_MODEL.md) - Compliance dashboard
13. Document Control Footer (ISMS § 5.10)
---
**📋 Document Control:**
**✅ Approved by:** James Pether Sörling, CEO
**📤 Distribution:** Public
**🏷️ Classification:** [](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md#confidentiality-levels)
**📅 Effective Date:** YYYY-MM-DD
**⏰ Next Review:** YYYY-MM-DD
**🎯 Framework Compliance:** [](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md) [](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md) [](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md)
References
Hack23 ISMS Documentation
External Frameworks
Remember
- Proactive Not Reactive: Identify threats before they materialize
- Defense in Depth: Multiple security layers
- Risk-Based Prioritization: Focus on high-impact threats
- Continuous Process: Threat landscape evolves
- Documentation Essential: THREAT_MODEL.md is mandatory
- Integration Critical: Align with ISMS policies
- Transparency Advantage: Public threat models demonstrate expertise
- Quantitative Assessment: Numbers drive decisions
1---2name: threat-modeling3description: Comprehensive Hack23 threat modeling process using STRIDE, MITRE ATT&CK, attack trees, and quantitative risk assessment per ISMS Threat_Modeling.md policy4license: Apache-2.05---67# Threat Modeling Skill8910## 🔴 AI FIRST Quality Principle1112> **Apply the AI FIRST principle: never accept first-pass quality. Minimum 2 iterations. Read all output, improve every section. No shortcuts.**1314## Purpose1516This skill embodies the complete Hack23 AB threat modeling methodology as defined in [ISMS Threat_Modeling.md](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Threat_Modeling.md). It provides systematic threat identification, risk quantification, and security control validation for proactive security assurance across all Hack23 projects.1718**Key Philosophy**: "Security through transparency" - All threat models are publicly documented to demonstrate security excellence to clients, regulators, and the open-source community.1920## Hack23 Threat Modeling Process (ISMS § 4)2122Per [ISMS Threat_Modeling.md](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Threat_Modeling.md), Hack23 employs a **five-strategy integrated approach**:2324### 1. 🎯 Attacker-Centric (ISMS § 4.1)25**MITRE ATT&CK Framework Integration**26- Map attack tactics and techniques to system components27- Identify threat agents (Nation-state APTs, Cybercriminals, Hacktivists, Malicious Insiders)28- Analyze attack scenarios based on current threat intelligence (ENISA Threat Landscape 2024)29- Red team perspective: "How would I compromise this system?"3031**Required Outputs:**32- MITRE ATT&CK technique mapping per system component33- Threat agent capability and motivation analysis34- Attack scenario documentation3536### 2. 🏰 Asset-Centric (ISMS § 4.2)37**Crown Jewel Protection**38- Identify critical assets from Asset Register39- Apply Data Classification Policy (Public, Internal, Confidential, Restricted)40- Map data flows and asset dependencies41- Prioritize threats by asset criticality4243**Required Outputs:**44- Asset inventory with CIA triad classification45- Data flow diagrams (DFDs) showing trust boundaries46- Crown jewel identification and protection strategies4748### 3. 🏗️ Architecture-Centric (ISMS § 4.3)49**STRIDE Per Element Analysis**50- Apply STRIDE framework to each system component51- Identify trust boundaries and crossing points52- Analyze external entity, process, data store, data flow threats53- Validate security controls per architectural layer5455**Required Outputs:**56- Complete DFD with trust boundaries57- STRIDE threat enumeration per DFD element58- Control gap identification5960### 4. 📖 Scenario-Centric (ISMS § 4.4)61**Use Case Abuse Modeling**62- Develop misuse cases from legitimate use cases63- Model attacker goals and sub-goals64- Identify abuse scenarios specific to business logic65- Analyze social engineering attack paths6667**Required Outputs:**68- Misuse case diagrams69- Business logic abuse scenarios70- Social engineering attack paths7172### 5. 📊 Risk-Centric (ISMS § 4.5)73**Quantitative Risk Assessment**74- Calculate risk scores: **Risk = Likelihood × Impact**75- Use Classification Framework for impact scoring76- Apply risk matrix for prioritization77- Document risk treatment decisions (Avoid, Mitigate, Transfer, Accept)7879**Required Outputs:**80- Quantitative risk scores per threat81- Risk matrix visualization82- Risk treatment plan with ownership8384## Security Foundations8586### CIA Triad87| Principle | Definition | Key Controls | Threat Categories |88|-----------|------------|--------------|------------------|89| **Confidentiality** | Information accessible only to authorized entities | Encryption, access control, authentication | Information disclosure, credential theft |90| **Integrity** | Data protection from unauthorized modification | Checksums, digital signatures, version control | Tampering, data corruption |91| **Availability** | Reliable and timely access to systems | Redundancy, DR, DDoS mitigation | DoS, outages, resource exhaustion |9293### AAA Framework94| Component | Definition | Integration |95|-----------|------------|-------------|96| **Authentication** | Identity verification | Access Control Policy |97| **Authorization** | Permitted actions | RBAC, ABAC implementation |98| **Accounting** | Activity tracking | Security monitoring, audit logs |99100## STRIDE Threat Modeling Framework101102### STRIDE Categories103104**S - Spoofing Identity**105- **Definition**: Attacker gains access using false identity106- **Controls**: Multi-factor authentication, certificate pinning, identity verification107- **Static Site Threats**: Domain hijacking, DNS spoofing, certificate spoofing108- **Mitigations**: HTTPS enforced, DNSSEC, Certificate Transparency monitoring109110**T - Tampering with Data**111- **Definition**: Data modification during application flow112- **Controls**: Digital signatures, checksums, integrity monitoring113- **Static Site Threats**: Repository compromise, unauthorized commits, content injection114- **Mitigations**: Branch protection, required PR reviews, GPG signed commits, GitHub audit logs115116**R - Repudiation**117- **Definition**: Attacker denies actions without proof capability118- **Controls**: Audit logging, digital signatures, non-repudiation mechanisms119- **Static Site Threats**: Unauthorized changes without attribution120- **Mitigations**: Git commit history (immutable), GitHub audit logs, signed commits required121122**I - Information Disclosure**123- **Definition**: Unauthorized access to private or sensitive data124- **Controls**: Encryption, access controls, data classification125- **Static Site Threats**: Accidental secret commits, source code exposure126- **Mitigations**: Secret scanning enabled, .gitignore for sensitive files, public repository classification127128**D - Denial of Service**129- **Definition**: System availability reduction or service crash130- **Controls**: Rate limiting, DDoS protection, redundancy131- **Static Site Threats**: DDoS attacks, resource exhaustion132- **Mitigations**: GitHub Pages CDN, rate limiting, global distribution133134**E - Elevation of Privilege**135- **Definition**: Attacker assumes privileged user identity136- **Controls**: Least privilege, RBAC, privilege separation137- **Static Site Threats**: Unauthorized admin access, workflow manipulation138- **Mitigations**: Minimal workflow permissions, protected branches, required reviews139140## MITRE ATT&CK Integration141142### Tactics & Techniques143144| Tactic | Description | Common Techniques |145|--------|-------------|-------------------|146| **Reconnaissance** | Information gathering | Active scanning, OSINT |147| **Resource Development** | Establishing resources | Compromise accounts, infrastructure setup |148| **Initial Access** | Network entry | Phishing, drive-by compromise, supply chain |149| **Execution** | Malicious code execution | Command interpreters, malicious input |150| **Persistence** | Foothold maintenance | Account manipulation, backdoors |151| **Privilege Escalation** | Higher permissions | Exploitation, process injection |152| **Defense Evasion** | Detection avoidance | Obfuscation, bypass controls |153| **Credential Access** | Credential theft | Brute force, token stealing |154| **Discovery** | Environment reconnaissance | Cloud discovery, network mapping |155| **Lateral Movement** | Environment traversal | Remote services, credential reuse |156| **Collection** | Data gathering | Local data, cloud storage |157| **Command & Control** | System communication | Application layer protocols |158| **Exfiltration** | Data theft | C2 channel, cloud storage |159| **Impact** | System destruction | Data destruction, resource hijacking |160161## Threat Agent Classification162163| Threat Agent | Category | Risk Level | MITRE Tactics |164|--------------|----------|------------|---------------|165| **Accidental Insiders** | Internal | Medium | Execution, Privilege Escalation |166| **Malicious Insiders** | Internal | High | Initial Access, Impact |167| **Cybercriminals** | External | High | Reconnaissance, Collection |168| **Nation-State APTs** | External | Critical | Persistence, Defense Evasion |169| **Hacktivists** | External | Medium | Impact, Privilege Escalation |170| **Service Providers** | External | Medium | Initial Access, Defense Evasion |171| **Cyber Vandals** | External | Low | Impact, Execution |172173## Current Threat Landscape (ENISA 2024)174175| Priority | Threat Category | Business Impact | Mitigation Priority |176|----------|----------------|-----------------|-------------------|177| **1** | Threats Against Availability | Revenue protection | Critical |178| **2** | Ransomware | Business continuity | Critical |179| **3** | Threats Against Data | Risk reduction | High |180| **4** | Malware | Operational excellence | High |181| **5** | Social Engineering | Trust enhancement | High |182| **6** | Information Manipulation | Competitive advantage | Medium |183| **7** | Supply Chain Attacks | Partnership value | High |184185## Attack Tree Analysis (ISMS § 4.6)186187Attack trees are **mandatory** for all Hack23 threat models per ISMS policy. They provide:188189### Purpose190- Visual decomposition of attack paths from goal to sub-goals191- AND/OR relationship mapping between attack steps192- Success probability calculation for attack paths193- Critical path identification for mitigation prioritization194195### Attack Tree Structure196197```198Root: Attack Goal (e.g., "Compromise Application")199├── OR Gate: Any child succeeds → parent succeeds200│ ├── AND Gate: All children must succeed → parent succeeds201│ │ ├── Leaf: Individual attack step (Likelihood: 40%, Impact: High)202│ │ └── Leaf: Individual attack step (Likelihood: 60%, Impact: Medium)203│ └── AND Gate: Alternative attack path204│ ├── Leaf: Attack step 1205│ └── Leaf: Attack step 2206└── OR Gate: Second major attack vector207 └── Leaf: Direct attack208```209210### Example: Static Website Compromise (from Riksdagsmonitor)211```212Root: Compromise Riksdagsmonitor Platform213├── OR: Infrastructure Attack214│ ├── AND: DNS Hijacking215│ │ ├── Compromise Route 53 credentials (Likelihood: 10%, Impact: Critical)216│ │ └── Modify DNS records (Likelihood: 95%, Impact: Critical)217│ └── AND: S3 Bucket Compromise218│ ├── Find misconfigured bucket (Likelihood: 5%, Impact: High)219│ └── Upload malicious content (Likelihood: 90%, Impact: High)220└── OR: Supply Chain Attack221 ├── AND: Compromise GitHub Account222 │ ├── Steal developer credentials (Likelihood: 15%, Impact: Critical)223 │ └── Bypass MFA (Likelihood: 20%, Impact: Critical)224 └── AND: Malicious Dependency Injection225 ├── Compromise npm package (Likelihood: 5%, Impact: High)226 └── Inject malicious code (Likelihood: 80%, Impact: Critical)227```228229### Attack Tree Analysis Steps2301. **Goal Identification**: Define attacker objectives2312. **Path Decomposition**: Break down into AND/OR sub-goals2323. **Leaf Node Likelihood**: Assign success probability (1-100%)2334. **Impact Assessment**: Use Classification Framework2345. **Path Calculation**: Calculate cumulative success likelihood2356. **Critical Path**: Identify highest risk paths2367. **Mitigation Priority**: Focus on high-likelihood, high-impact leaves237238### Integration with STRIDE239Each STRIDE threat should have corresponding attack tree showing exploitation paths.240241## Data Flow Diagrams (DFD)242243### DFD Elements244- **External Entity**: Sources/sinks of data (users, external systems)245- **Process**: Data transformation or computation246- **Data Store**: Persistent storage247- **Data Flow**: Movement between elements248- **Trust Boundary**: Security domain separation249250### STRIDE per DFD Element251| Element | Applicable STRIDE Threats |252|---------|--------------------------|253| **External Entity** | Spoofing, Repudiation |254| **Process** | All 6 STRIDE categories |255| **Data Store** | Tampering, Information Disclosure, DoS |256| **Data Flow** | Tampering, Information Disclosure, DoS |257| **Trust Boundary** | Elevation of Privilege |258259## Quantitative Risk Assessment260261### Risk Calculation262```263Risk = Likelihood × Impact264```265266### Likelihood Scoring267- **Critical (5)**: Near certain (>90%)268- **High (4)**: Likely (60-90%)269- **Medium (3)**: Possible (30-60%)270- **Low (2)**: Unlikely (10-30%)271- **Negligible (1)**: Rare (<10%)272273### Impact Scoring (per Classification Framework)274- **Critical (5)**: >$10K daily, complete outage, criminal charges275- **High (4)**: $5K-10K daily, major degradation, significant fines276- **Medium (3)**: $1K-5K daily, moderate impact, compliance violations277- **Low (2)**: $500-1K daily, minor impact, warnings278- **Negligible (1)**: <$500 daily, minimal impact, no regulatory279280### Risk Matrix281| Likelihood → Impact | Negligible (1) | Low (2) | Medium (3) | High (4) | Critical (5) |282|--------------------|----------------|---------|------------|----------|--------------|283| **Critical (5)** | Medium | High | High | Critical | Critical |284| **High (4)** | Medium | Medium | High | High | Critical |285| **Medium (3)** | Low | Medium | Medium | High | High |286| **Low (2)** | Low | Low | Medium | Medium | High |287| **Negligible (1)** | Low | Low | Low | Medium | Medium |288289## Threat Model Document Structure290291Every repository **MUST** maintain **THREAT_MODEL.md** with:292293### 1. System Overview294- Architecture description295- Key components and dependencies296- Trust boundaries297- Data flows298299### 2. Asset Inventory300- Critical assets from Asset Register301- Data classification (per Classification Framework)302- Crown jewel identification303304### 3. STRIDE Analysis305- Threat per component306- Likelihood and impact ratings307- Attack vectors308- Existing controls309310### 4. MITRE ATT&CK Mapping311- Applicable tactics and techniques312- Attack scenarios313- Detection opportunities314315### 5. Attack Trees316- Visual attack path decomposition317- Success probabilities318- Critical attack steps319320### 6. Risk Assessment321- Quantitative risk scores322- Risk matrix visualization323- Risk treatment decisions324325### 7. Security Controls326- Current control implementation327- Control effectiveness328- Control gaps329330### 8. Residual Risk331- Accepted risks with justification332- Risk owners333- Monitoring requirements334335### 9. Recommendations336- Short-term improvements (0-3 months)337- Medium-term enhancements (3-12 months)338- Long-term roadmap (12+ months)339340## Threat Modeling Workflow (ISMS § 6)341342Follow this structured 7-phase process for all Hack23 threat models:343344### Phase 1: Planning (Week 1)345- [ ] Define scope (What systems/components are in scope?)346- [ ] Identify stakeholders (Who needs to be involved?)347- [ ] Select modeling strategies (Which of 5 strategies apply?)348- [ ] Schedule threat modeling session (2-4 hours for initial, 1-2 hours for updates)349- [ ] Gather prerequisites (Architecture diagrams, Asset Register, Classification Framework)350351### Phase 2: Data Collection (Week 1-2)352- [ ] Review architecture documentation (ARCHITECTURE.md, SECURITY_ARCHITECTURE.md)353- [ ] Create/update Data Flow Diagrams (DFDs) with trust boundaries354- [ ] Identify assets and apply classifications (per Classification Framework)355- [ ] Map data flows and external dependencies356- [ ] Document system components and interfaces357358### Phase 3: Threat Identification (Week 2-3)359- [ ] Apply STRIDE per DFD element (External Entity, Process, Data Store, Data Flow)360- [ ] Map MITRE ATT&CK tactics to system components361- [ ] Develop attack trees for major threat scenarios (minimum 3-5)362- [ ] Brainstorm attack scenarios (misuse cases, business logic abuse)363- [ ] Identify threat agents and capabilities364365### Phase 4: Risk Assessment (Week 3)366- [ ] Calculate likelihood per threat (1-5 scale per ISMS § 3.5.1)367- [ ] Calculate impact per threat (1-5 scale per Classification Framework)368- [ ] Compute risk scores (Risk = Likelihood × Impact)369- [ ] Plot risks on risk matrix370- [ ] Identify critical attack paths in attack trees371- [ ] Prioritize threats by risk score372373### Phase 5: Mitigation Planning (Week 3-4)374- [ ] Review existing controls from SECURITY_ARCHITECTURE.md375- [ ] Assess control effectiveness against identified threats376- [ ] Identify control gaps377- [ ] Recommend new controls (prioritized by risk reduction)378- [ ] Document risk treatment decisions (Avoid, Mitigate, Transfer, Accept)379- [ ] Assign risk owners380381### Phase 6: Documentation (Week 4)382- [ ] Create/update THREAT_MODEL.md per mandatory structure (§ 5)383- [ ] Update SECURITY_ARCHITECTURE.md with new controls384- [ ] Update Risk_Register.md in ISMS repository385- [ ] Cross-reference documents (Related Documents section)386- [ ] Add Mermaid diagrams with ISMS color palette387- [ ] Include business value quantification388389### Phase 7: Review & Continuous Improvement (Ongoing)390- [ ] CEO approval (James Pether Sörling)391- [ ] Quarterly threat landscape review (ENISA, MITRE ATT&CK updates)392- [ ] Post-incident threat model update (within 1 week of incidents)393- [ ] Architecture change triggers (new components, trust boundaries)394- [ ] Annual comprehensive review (full STRIDE re-analysis)395- [ ] Lessons learned integration396397## Best Practices & Quality Standards398399### ✅ Do's4001. **Start Early**: Threat model during design phase, not after implementation4012. **Use All 5 Strategies**: Attacker, Asset, Architecture, Scenario, Risk-centric4023. **Quantify Risk**: Use likelihood × impact matrix, not just qualitative assessment4034. **Document Visually**: Mermaid DFDs, attack trees, risk matrices4045. **Link Everything**: Cross-reference SECURITY_ARCHITECTURE.md, Risk_Register.md4056. **Business Value**: Quantify cost avoidance, competitive advantage4067. **Public Transparency**: All threat models public (security through transparency)4078. **Continuous Updates**: Threat landscape evolves, models must too4089. **Attack Trees Mandatory**: Minimum 3-5 trees per ISMS § 4.640910. **MITRE ATT&CK Required**: Map tactics/techniques per ISMS § 4.6410411### ❌ Don'ts4121. **Skip Attack Trees**: ISMS § 4.6 requires attack tree analysis4132. **Generic Threats**: Customize to actual system architecture4143. **Ignore Low Risks**: Document all risks, even accepted ones4154. **One-Time Activity**: Threat modeling is continuous, not one-and-done4165. **Missing Controls**: Every threat needs control or risk acceptance4176. **No Quantification**: Risk scores required, not just High/Medium/Low4187. **Siloed Analysis**: Integrate with ISMS policies (Access Control, Crypto, Network)4198. **Forget Business Value**: Security is business enabler, quantify benefits4209. **Incomplete Documentation**: Follow mandatory structure § 5 completely42110. **No CEO Approval**: All threat models require CEO sign-off422423## Integration with Hack23 ISMS424425### Required Policy Cross-References426Every THREAT_MODEL.md must reference and align with:4274281. **[Information_Security_Policy.md](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Information_Security_Policy.md)**429 - Overall security governance framework430 - Management commitment to security4314322. **[Access_Control_Policy.md](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Access_Control_Policy.md)**433 - Authentication threats → MFA requirements434 - Authorization threats → RBAC design435 - Credential threats → Password policies4364373. **[Data_Classification_Policy.md](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Data_Classification_Policy.md)**438 - Asset classification (Public, Internal, Confidential, Restricted)439 - Data handling requirements per classification440 - Information disclosure threat impact assessment4414424. **[Network_Security_Policy.md](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Network_Security_Policy.md)**443 - Network-based threats and controls444 - Zero-trust architecture requirements445 - TLS 1.3 enforcement4464475. **[Cryptography_Policy.md](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Cryptography_Policy.md)**448 - Encryption requirements for data in transit/rest449 - Key management threats450 - Cryptographic algorithm standards4514526. **[Secure_Development_Policy.md](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Secure_Development_Policy.md)**453 - Application security threats → SAST/DAST requirements454 - Supply chain threats → Dependency scanning (Dependabot, FOSSA)455 - Code injection threats → Secure coding standards456 - Security architecture documentation requirements4574587. **[Vulnerability_Management.md](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Vulnerability_Management.md)**459 - Vulnerability scanning requirements (SonarCloud, Trivy, OWASP ZAP)460 - Remediation SLAs per severity461 - Patch management process4624638. **[Incident_Response_Plan.md](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Incident_Response_Plan.md)**464 - Detection requirements → SIEM/monitoring configuration465 - Response procedures → Playbook development466 - Recovery objectives → RTO/RPO alignment4674689. **[Business_Continuity_Plan.md](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Business_Continuity_Plan.md)**469 - Availability threats → Redundancy design470 - Disaster scenarios → DR procedures471 - Service criticality → Priority ranking47247310. **[CLASSIFICATION.md](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md)**474 - CIA triad definitions (Confidentiality, Integrity, Availability)475 - RTO/RPO classifications for availability impact476 - Business impact analysis for risk quantification47747811. **[Risk_Register.md](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Risk_Register.md)**479 - Enterprise-wide risk tracking480 - Risk treatment decisions481 - Risk ownership and accountability482483### Compliance Framework Mapping484Map all threats and controls to:485486**ISO 27001:2022 Annex A Controls:**487- A.5.7: Threat Intelligence488- A.8.1-8.34: Technology Controls (per threat category)489- A.5.12: Classification of Information490- A.5.24: Information Security Risk Assessment491- A.5.25: Information Security Risk Treatment492493**NIST CSF 2.0 Functions:**494- **ID**: Asset identification, threat intelligence495- **PR**: Security architecture, access control496- **DE**: Monitoring, anomaly detection497- **RS**: Incident response, communications498- **RC**: Recovery planning, improvements499500**CIS Controls v8.1:**501- Control 1: Inventory and Control of Enterprise Assets502- Control 4: Secure Configuration of Enterprise Assets503- Control 5: Account Management504- Control 10: Malware Defenses505- Control 13: Network Monitoring and Defense506- Control 16: Application Software Security507508### AWS Well-Architected Framework (for AWS projects)509- **Security Pillar**: Identity, detective controls, infrastructure protection510- **Reliability Pillar**: Fault isolation, DR planning511- **Performance Efficiency**: Monitoring, selection512513## Mermaid Diagram Standards for Threat Models514515Use ISMS color palette (per STYLE_GUIDE.md v2.3):516517### Classification Colors518```yaml519Critical/Extreme: #D32F2F # Red520High/Very High: #FF9800 # Orange 521Medium/Moderate: #FFC107 # Amber522Low/Standard: #4CAF50 # Green523Public/Minimal: #9E9E9E # Grey524```525526### Trust Boundary Colors527```yaml528External (Untrusted): #D32F2F # Red529DMZ (Partially Trusted): #FF9800 # Orange530Internal (Trusted): #4CAF50 # Green531Secure (Highly Trusted): #2196F3 # Blue532```533534### Example DFD with Trust Boundaries535```mermaid536graph TB537 User[End Users<br/>🌐 External] 538 CDN[CloudFront CDN<br/>🔒 Edge Security]539 S3[S3 Buckets<br/>💾 Static Content]540 GitHub[GitHub Actions<br/>⚙️ CI/CD]541 542 User -->|HTTPS TLS 1.3| CDN543 CDN -->|Serves| S3544 GitHub -->|Deploy OIDC| S3545 546 subgraph External["🔴 Untrusted Zone"]547 User548 end549 550 subgraph Edge["🟠 Edge Security Zone"]551 CDN552 end553 554 subgraph Internal["🟢 Trusted AWS Zone"]555 S3556 GitHub557 end558 559 style User fill:#D32F2F,color:#fff560 style CDN fill:#FF9800,color:#000561 style S3 fill:#4CAF50,color:#000562 style GitHub fill:#4CAF50,color:#000563```564565## Remember: Hack23 Threat Modeling Philosophy5665671. **🔍 Proactive Not Reactive**: Identify threats before they materialize5682. **🏰 Defense in Depth**: Multiple security layers reduce single point of failure5693. **📊 Risk-Based Prioritization**: Focus resources on high-impact threats first5704. **🔄 Continuous Process**: Threat landscape evolves, models must evolve too5715. **📝 Documentation Essential**: THREAT_MODEL.md is mandatory, not optional5726. **🔗 Integration Critical**: Align with all ISMS policies for consistency5737. **🌟 Transparency Advantage**: Public threat models demonstrate security expertise5748. **💹 Quantitative Assessment**: Numbers drive decisions, not gut feelings5759. **🎯 Business Value**: Security enables business, quantify the benefits57610. **✅ CEO Accountability**: James Pether Sörling approves all threat models577578**"Security through transparency" - Hack23 AB**579580## Hack23 Threat Model Examples581582Per ISMS Threat_Modeling.md § 7, all Hack23 projects maintain comprehensive threat models demonstrating security excellence through transparency.583584### 1. 🏛️ Citizen Intelligence Agency (CIA)585**Repository**: [Hack23/cia](https://github.com/Hack23/cia) 586**Threat Model**: [THREAT_MODEL.md](https://github.com/Hack23/cia/blob/master/THREAT_MODEL.md) 587**Architecture**: Full-stack web application (Java/Spring Boot + PostgreSQL + AWS)588589**Key Characteristics:**590- **System Type**: Multi-tier web application with database and external integrations591- **Data Classification**: Public (parliamentary data) + Internal (system credentials)592- **Threats**: STRIDE analysis across 6 layers (Frontend, Backend, Database, AWS, CI/CD, Supply Chain)593- **MITRE ATT&CK**: 14 tactics mapped with 40+ techniques594- **Attack Trees**: 8 comprehensive trees for major attack scenarios595- **Risk Level**: MEDIUM (6.5/10.0) after controls, 92.3% risk reduction596- **Controls**: Defense-in-depth with AWS Well-Architected Framework alignment597598**Notable Sections:**599- Comprehensive DFD with 5 trust boundaries600- Quantitative risk matrix (Likelihood × Impact)601- PostgreSQL-specific tampering and DoS threats602- Supply chain attack trees (npm, Maven dependencies)603- Detailed MITRE ATT&CK technique mapping per component604- Business value integration (€200K+ cost avoidance through proactive security)605606**Use CIA as reference for:**607- Multi-tier application threat modeling608- Database security threat analysis609- Complex supply chain threat modeling610- Comprehensive MITRE ATT&CK integration611612### 2. 🎮 Black Trigram (흑괘)613**Repository**: [Hack23/blacktrigram](https://github.com/Hack23/blacktrigram) 614**Threat Model**: [THREAT_MODEL.md](https://github.com/Hack23/blacktrigram/blob/main/THREAT_MODEL.md) 615**Architecture**: Frontend-only gaming application (React + Vite + Phaser.js)616617**Key Characteristics:**618- **System Type**: Client-side gaming application with no backend619- **Data Classification**: Public (game content) + Internal (GitHub credentials)620- **Threats**: STRIDE analysis focused on frontend, CI/CD, and CDN621- **MITRE ATT&CK**: 12 tactics with gaming-specific techniques622- **Attack Trees**: 6 trees covering game hacking, cheating, and infrastructure623- **Risk Level**: LOW (4.2/10.0) after controls, 95.8% risk reduction624- **Controls**: CSP, SRI, no sensitive data storage, immutable game state625626**Notable Sections:**627- Game-specific threats (cheating, save game manipulation, asset theft)628- Client-side security analysis (XSS, prototype pollution, memory manipulation)629- React and Vite supply chain risks630- Browser-based attack scenarios631- Phaser.js framework-specific vulnerabilities632633**Use Black Trigram as reference for:**634- Frontend-only application threat modeling635- Gaming application security analysis636- Client-side attack scenarios637- No-backend architecture threats638639### 3. 🗳️ Riksdagsmonitor (Current Project)640**Repository**: [Hack23/riksdagsmonitor](https://github.com/Hack23/riksdagsmonitor) 641**Threat Model**: [THREAT_MODEL.md](https://github.com/Hack23/riksdagsmonitor/blob/main/THREAT_MODEL.md) 642**Architecture**: Static HTML/CSS website with Chart.js/D3.js dashboards + AWS CloudFront CDN643644**Key Characteristics:**645- **System Type**: Static website with interactive JavaScript dashboards646- **Data Classification**: Public (all content, Swedish Parliament data)647- **Threats**: STRIDE analysis for static hosting, CDN, and external data links648- **MITRE ATT&CK**: 11 tactics focusing on infrastructure and supply chain649- **Attack Trees**: Required expansion per this issue650- **Risk Level**: LOW (5.52/10.0) after controls, 99.7% risk reduction651- **Controls**: HTTPS-only, CSP, SRI, GitHub Pages DR, CloudFront distribution652653**Notable Sections:**654- Static site-specific threats (domain hijacking, CDN compromise, typosquatting)655- Multi-language website security (14 languages)656- Chart.js/D3.js dashboard vulnerabilities657- CSV data integrity threats (CIA platform data)658- AWS CloudFront and S3 infrastructure threats659- Agentic workflow threats (Claude Opus 4.8 news generation)660661**Use Riksdagsmonitor as reference for:**662- Static website threat modeling663- CDN security analysis664- Multi-language site threats665- Data visualization security666- AI agentic workflow security667668### 4. 📊 CIA Compliance Manager669**Repository**: [Hack23/cia-compliance-manager](https://github.com/Hack23/cia-compliance-manager) (referenced in ISMS policy) 670**Threat Model**: [THREAT_MODEL.md](https://github.com/Hack23/cia-compliance-manager/blob/main/THREAT_MODEL.md) 671**Architecture**: Static HTML/CSS compliance dashboard672673**Key Characteristics:**674- **System Type**: Static compliance visualization platform675- **Data Classification**: Public (compliance frameworks) + Internal (API tokens)676- **Threats**: Similar to riksdagsmonitor but focused on compliance data integrity677- **Risk Level**: LOW (targeted at auditors and compliance teams)678- **Controls**: Read-only public data, no user authentication679680**Use CIA Compliance Manager as reference for:**681- Compliance dashboard threat modeling682- Read-only platform security683- Framework mapping security684685## ❌ WRONG STRUCTURE (Do NOT Use)686687**NEVER use numbered sections (1-10) like this:**688```markdown689## 1. System Boundary and Assets690## 2. STRIDE Threat Analysis691## 3. Attack Trees692## 4. MITRE ATT&CK Mapping693## 5. Risk Quantification694## 6. Threat Scenarios695## 7. Security Metrics696## 8. Assumptions and Constraints697## 9. Recommendations698## 10. Approval and Review699```700701**Why wrong**: This generic structure is NOT aligned with Hack23 ISMS Threat_Modeling.md policy and does NOT demonstrate the 5-strategy integrated approach or domain expertise.702703---704705## ✅ CORRECT STRUCTURE: Hack23 Thematic Sections706707All Hack23 threat models use **thematic sections** (not numbered) that demonstrate comprehensive threat modeling maturity. Structure varies by project domain but core sections are mandatory.708709## Mandatory Core Sections (All Projects)710711### 1. Header Section (per STYLE_GUIDE.md v2.3)712```markdown713<p align="center">714 <img src="https://hack23.com/icon-192.png" alt="Hack23 Logo" width="192" height="192">715</p>716717<h1 align="center">🎯 [Project Name] — Threat Model</h1>718719<p align="center">720 <strong>🛡️ Proactive Security Through Structured Threat Analysis</strong><br>721 <em>🔍 STRIDE • MITRE ATT&CK • [Architecture Type] • [Key Security Focus]</em>722</p>723724<p align="center">725 <a href="#"><img src="https://img.shields.io/badge/Owner-CEO-0A66C2?style=for-the-badge" alt="Owner"/></a>726 <a href="#"><img src="https://img.shields.io/badge/Version-1.0-555?style=for-the-badge" alt="Version"/></a>727 <a href="#"><img src="https://img.shields.io/badge/Effective-YYYY--MM--DD-success?style=for-the-badge" alt="Effective Date"/></a>728 <a href="#"><img src="https://img.shields.io/badge/Review-Quarterly-orange?style=for-the-badge" alt="Review Cycle"/></a>729</p>730731**📋 Document Owner:** CEO | **📄 Version:** 1.0 | **📅 Last Updated:** YYYY-MM-DD (UTC) 732**🔄 Review Cycle:** Quarterly | **⏰ Next Review:** YYYY-MM-DD 733**🏢 Owner:** Hack23 AB (Org.nr 5595347807) | **🏷️ Classification:** Public734```735736### 2. CEO Purpose Statement737Quote from CEO James Pether Sörling connecting threat modeling to Hack23's transparency and security excellence principles:738739> *"At Hack23, we believe that true security comes through transparency and demonstrable practices. This threat model is publicly available to showcase our proactive security posture, allowing clients and stakeholders to verify our commitment to security excellence. By openly documenting our threat analysis, we demonstrate not just what we protect, but how we protect it."*740741### 3. Executive Summary742- High-level threat overview743- Key risk metrics (High/Medium/Low threat counts)744- Residual risk level745- Major findings and recommendations746747### 4. System Boundary and Assets (ISMS § 5.1)748- **System Components**: Mermaid diagram showing architecture with trust boundaries749- **Assets**: Table with Asset, Type, Classification (per Classification Framework), Value750- **Trust Boundaries**: List all trust boundary crossings751752### 5. STRIDE Threat Analysis (ISMS § 5.2)753For each STRIDE category (Spoofing, Tampering, Repudiation, Information Disclosure, DoS, Elevation of Privilege):754- **Threat Description**: What the threat is755- **Attack Vector**: How it's exploited756- **Likelihood**: Low/Medium/High/Critical (1-5 score)757- **Impact**: Based on Classification Framework (1-5 score)758- **Risk Score**: Likelihood × Impact759- **Current Controls**: Existing mitigations760- **Residual Risk**: After controls761- **Recommendations**: Additional mitigations needed762763### 6. Attack Tree Analysis (ISMS § 5.3) - **MANDATORY**764Minimum 3-5 attack trees showing major attack scenarios:765- Root goal (e.g., "Compromise Application")766- AND/OR gate structure767- Leaf nodes with success likelihood768- Visual representation in Mermaid or text format769- Critical path identification770771### 7. MITRE ATT&CK Mapping (ISMS § 5.4) - **MANDATORY**772Map applicable tactics and techniques:773- **Tactic**: MITRE ATT&CK tactic (e.g., Initial Access, Execution)774- **Technique**: Specific technique ID (e.g., T1566 - Phishing)775- **Sub-Technique**: If applicable776- **System Component**: Where it applies777- **Detection**: How to detect778- **Mitigation**: How to prevent779780### 8. Risk Assessment Summary (ISMS § 5.5)781- **Risk Matrix**: Visual Likelihood × Impact matrix782- **Risk Distribution**: Count of Critical/High/Medium/Low risks783- **Risk Treatment Decisions**: Per threat (Avoid, Mitigate, Transfer, Accept)784- **Residual Risk Justification**: Why remaining risk is acceptable785786### 9. Security Controls (ISMS § 5.6)787Reference **SECURITY_ARCHITECTURE.md** with:788- Control categories (Preventive, Detective, Corrective)789- Implementation status790- Control effectiveness rating791- Control gaps and roadmap792793### 10. Business Value Integration (ISMS § 5.7) - **REQUIRED**794Quantify security business value:795- 🏆 **Competitive Advantage**: Market differentiation through transparent security796- 🤝 **Customer Trust**: Demonstrable security posture797- 💰 **Cost Avoidance**: Prevented incident costs (quantify)798- 🔄 **Operational Excellence**: Reduced security overhead799- 💡 **Innovation Enablement**: Secure experimentation800- 🛡️ **Risk Reduction**: Quantitative risk reduction percentage801802### 11. Compliance Mapping (ISMS § 5.8)803Map threats and controls to:804- **ISO 27001:2022**: Relevant Annex A controls805- **NIST CSF 2.0**: Functions and categories806- **CIS Controls v8.1**: Applicable controls807- **AWS Well-Architected**: For AWS projects808809### 12. Related Documents (ISMS § 5.9)810```markdown811## 📚 Related Documents812813- [🏛️ Architecture](./ARCHITECTURE.md) - System architecture with C4 models814- [🔐 Security Architecture](./SECURITY_ARCHITECTURE.md) - Security controls implementation815- [📊 Data Model](./DATA_MODEL.md) - Data entities and relationships816- [🔄 Workflows](./WORKFLOWS.md) - CI/CD security workflows817- [📋 ISMS Threat Modeling Policy](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Threat_Modeling.md) - Comprehensive methodology818- [🏷️ Classification Framework](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md) - Business impact analysis819- [📉 Risk Register](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Risk_Register.md) - Enterprise risk management820- [🛠️ Secure Development Policy](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Secure_Development_Policy.md) - SDLC security requirements821822**Reference Implementations:**823- [🏛️ CIA Threat Model](https://github.com/Hack23/cia/blob/master/THREAT_MODEL.md) - Full-stack web application824- [🎮 Black Trigram Threat Model](https://github.com/Hack23/blacktrigram/blob/main/THREAT_MODEL.md) - Frontend gaming application825- [📊 CIA Compliance Manager](https://github.com/Hack23/cia-compliance-manager/blob/main/THREAT_MODEL.md) - Compliance dashboard826```827828### 13. Document Control Footer (ISMS § 5.10)829```markdown830---831832**📋 Document Control:** 833**✅ Approved by:** James Pether Sörling, CEO 834**📤 Distribution:** Public 835**🏷️ Classification:** [](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md#confidentiality-levels) 836**📅 Effective Date:** YYYY-MM-DD 837**⏰ Next Review:** YYYY-MM-DD 838**🎯 Framework Compliance:** [](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md) [](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md) [](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md)839```840841## References842843### Hack23 ISMS Documentation844- [Threat Modeling Policy](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Threat_Modeling.md) - Comprehensive methodology845- [Classification Framework](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md) - Business impact analysis846- [Risk Register](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Risk_Register.md) - Enterprise risk management847- [Secure Development Policy](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Secure_Development_Policy.md) - SDLC integration848849### External Frameworks850- [STRIDE (Wikipedia)](https://en.wikipedia.org/wiki/STRIDE_(security)) - Threat categorization851- [MITRE ATT&CK](https://attack.mitre.org/) - Adversary tactics and techniques852- [ENISA Threat Landscape 2024](https://www.enisa.europa.eu/publications/enisa-threat-landscape-2024) - Current threats853- [OWASP Threat Modeling](https://owasp.org/www-community/Threat_Modeling) - Best practices854855## Remember856857- **Proactive Not Reactive**: Identify threats before they materialize858- **Defense in Depth**: Multiple security layers859- **Risk-Based Prioritization**: Focus on high-impact threats860- **Continuous Process**: Threat landscape evolves861- **Documentation Essential**: THREAT_MODEL.md is mandatory862- **Integration Critical**: Align with ISMS policies863- **Transparency Advantage**: Public threat models demonstrate expertise864- **Quantitative Assessment**: Numbers drive decisions