Threat Modeling
Overview
This skill defines how to systematically identify potential security threats in any system design. Threat modeling before implementation finds and fixes vulnerabilities early, when they're cheapest to fix.
When to Use
- When designing new systems, services, or APIs
- When adding authentication, authorization, or access control
- When exposing internal systems to external access
- When integrating with third-party systems
- When collecting, storing, or transmitting sensitive data
- Don't use when: System has no data, no users, no external interfaces (rare)
Core Procedures
Step 1: Model the System
Document:
- Flow: How data moves through the system (diagram if complex)
- Trust Boundaries: Where data moves between different trust levels
- Entry Points: Where data enters the system (APIs, file uploads, user input)
- Data Stores: Where data is stored (databases, files, cache, memory)
- External Dependencies: Third-party services, APIs, libraries
Step 2: Identify Threats (STRIDE Framework)
For each component, consider:
- Spoofing: Can an attacker impersonate another identity?
- Tampering: Can data be modified without authorization?
- Repudiation: Can actions be denied without proof?
- Information Disclosure: Can sensitive data be exposed?
- Denial of Service: Can the system be made unavailable?
- Elevation of Privilege: Can limited users escalate to higher privileges?
Step 3: Assess Each Threat
For each identified threat:
- Likelihood: How easy is this to exploit? (Trivial/Moderate/Difficult)
- Impact: What damage would exploitation cause? (Low/Medium/High/Critical)
- Existing Controls: What already mitigates this threat?
- Risk Level: (Likelihood × Impact) - prioritize HIGH and CRITICAL
Step 4: Define Mitigations
For each threat:
THREAT MITIGATION
=================
Threat: [STRIDE category and description]
Affected Component: [what system part is at risk]
Risk Level: [Low/Medium/High/Critical]
Mitigation: [what to do to reduce or eliminate risk]
Residual Risk: [risk level after mitigation applied]
Priority: [implement before build / implement before release / backlog]
Step 5: Validate and Update
- Review threat model with security team (Guardian, Sentinel, Watchtower)
- Update threat model when system changes
- Re-assess risks when new attack vectors are discovered
- Track mitigation implementation status
Quality Checklist
Error Handling
- Error: Cannot mitigate a threat without breaking functionality
Response: Document the accepted risk, get sign-off from security lead, implement compensating controls
- Error: Threat model reveals fundamental design flaw
Response: Redesign before implementation, don't patch around it
- Error: New threat discovered during development
Response: Assess immediately, implement mitigation before release if HIGH/CRITICAL
Cross-Team Integration
Related Skills: secrets-handling, data-privacy-check, risk-assessment, audit-trail-management
Used By: ALL agents designing systems, especially Architects, Security agents (Guardian, Sentinel, Watchtower), Backend developers
1---2name: threat-modeling3description: Use when designing new systems, features, or integrations to identify potential security threats and vulnerabilities before they are exploited. This skill provides a structured approach to threat identification, risk assessment, and mitigation planning.4---56# Threat Modeling78## Overview9This skill defines how to systematically identify potential security threats in any system design. Threat modeling before implementation finds and fixes vulnerabilities early, when they're cheapest to fix.1011## When to Use12- When designing new systems, services, or APIs13- When adding authentication, authorization, or access control14- When exposing internal systems to external access15- When integrating with third-party systems16- When collecting, storing, or transmitting sensitive data17- **Don't use when:** System has no data, no users, no external interfaces (rare)1819## Core Procedures2021### Step 1: Model the System22Document:23- **Flow:** How data moves through the system (diagram if complex)24- **Trust Boundaries:** Where data moves between different trust levels25- **Entry Points:** Where data enters the system (APIs, file uploads, user input)26- **Data Stores:** Where data is stored (databases, files, cache, memory)27- **External Dependencies:** Third-party services, APIs, libraries2829### Step 2: Identify Threats (STRIDE Framework)30For each component, consider:31- **S**poofing: Can an attacker impersonate another identity?32- **T**ampering: Can data be modified without authorization?33- **R**epudiation: Can actions be denied without proof?34- **I**nformation Disclosure: Can sensitive data be exposed?35- **D**enial of Service: Can the system be made unavailable?36- **E**levation of Privilege: Can limited users escalate to higher privileges?3738### Step 3: Assess Each Threat39For each identified threat:40- **Likelihood:** How easy is this to exploit? (Trivial/Moderate/Difficult)41- **Impact:** What damage would exploitation cause? (Low/Medium/High/Critical)42- **Existing Controls:** What already mitigates this threat?43- **Risk Level:** (Likelihood × Impact) - prioritize HIGH and CRITICAL4445### Step 4: Define Mitigations46For each threat:47```48THREAT MITIGATION49=================50Threat: [STRIDE category and description]51Affected Component: [what system part is at risk]52Risk Level: [Low/Medium/High/Critical]53Mitigation: [what to do to reduce or eliminate risk]54Residual Risk: [risk level after mitigation applied]55Priority: [implement before build / implement before release / backlog]56```5758### Step 5: Validate and Update59- Review threat model with security team (Guardian, Sentinel, Watchtower)60- Update threat model when system changes61- Re-assess risks when new attack vectors are discovered62- Track mitigation implementation status6364## Quality Checklist65- [ ] System modeled with flows, boundaries, and data stores66- [ ] STRIDE framework applied to all components67- [ ] Each threat assessed for likelihood and impact68- [ ] Mitigations defined for all HIGH/CRITICAL threats69- [ ] Security team reviewed the model70- [ ] Mitigations tracked through implementation7172## Error Handling73- **Error:** Cannot mitigate a threat without breaking functionality74 **Response:** Document the accepted risk, get sign-off from security lead, implement compensating controls75- **Error:** Threat model reveals fundamental design flaw76 **Response:** Redesign before implementation, don't patch around it77- **Error:** New threat discovered during development78 **Response:** Assess immediately, implement mitigation before release if HIGH/CRITICAL7980## Cross-Team Integration81**Related Skills:** secrets-handling, data-privacy-check, risk-assessment, audit-trail-management82**Used By:** ALL agents designing systems, especially Architects, Security agents (Guardian, Sentinel, Watchtower), Backend developers