Threat Modeling
Purpose
Find the threats worth defending against before they're built in: map assets, trust boundaries, and attackers, enumerate what could go wrong, and turn that into prioritized mitigations that route to the specialist security skills. It frames the whole security effort; it doesn't scan code.
When to Use
- At design time for a new system/feature, and when architecture changes trust boundaries.
- Not as a code scan (specialist skills) or a post-hoc audit alone (
../../security-review) — though it guides both.
Inputs
- Architecture + data flow (
../../architecture-design), data-sensitivity map (../../backend/backend-security).
- Applications, integrations, and who the users/attackers are.
Discovery Questions
- What are the assets worth protecting (user data, money, credentials, availability, reputation)?
- Where are the trust boundaries (client↔server, service↔service, tenant↔tenant, third-party edges)?
- Who are the attackers (external anonymous, authenticated user abusing scope, malicious insider, compromised dependency)?
- What's the impact if each asset is compromised?
Responsibilities
- Map assets, entry points, trust boundaries, and data flows across the system (each boundary is where threats concentrate).
- Enumerate threats systematically (STRIDE as a checklist: Spoofing, Tampering, Repudiation, Information disclosure, Denial of service, Elevation of privilege) per boundary/asset.
- Prioritize by likelihood × impact — model the plausible, not every theoretical attack.
- Turn each significant threat into a mitigation routed to a specialist skill:
- identity/session threats →
authentication-security;
- access/scope/IDOR →
authorization-security;
- injection/API abuse →
api-security, web-security;
- data exposure →
database-security, privacy-review;
- secret exposure →
secrets-audit; dependency compromise → dependency-security;
- automated abuse/DoS →
abuse-prevention; platform-specific → mobile-security/web-security.
- Make mitigations testable — each should become a security regression test (
security-regression-testing).
Required Workflow
- Inventory assets, entry points, trust boundaries, data flows.
- Enumerate threats per boundary (STRIDE checklist).
- Prioritize by likelihood × impact.
- Assign each significant threat a mitigation + owning specialist skill.
- Record the model; feed mitigations to the specialists and to
security-regression-testing.
Decision Rules
- Model the plausible attacker and realistic impact — infinite theoretical threats aren't a plan; prioritize.
- Trust boundaries are where to look hardest — data crossing one is untrusted until validated/authorized.
- Every mitigation names an owner (a specialist skill) and is testable — otherwise it's a wish.
- Revisit the model when architecture changes boundaries; it's living, not one-time.
Rules
- Threats prioritized, not exhaustively listed without triage.
- Mitigations routed to specialist skills and made testable.
- The model is recorded and revisited on boundary changes.
Anti-Patterns
- Skipping threat modeling and discovering the attack surface in production.
- An unprioritized wall of every conceivable threat, actioned on none.
- Mitigations with no owner or no test.
- Modeling once and never updating as the system changes.
- Treating a vulnerability scanner's output as a threat model.
Validation Checklist
Definition of Done
A recorded, prioritized threat model — assets, boundaries, attackers, and STRIDE threats — with each significant threat mapped to a testable mitigation owned by a specialist security skill, revisited when boundaries change.
Related Skills
authentication-security, authorization-security, api-security, web-security, mobile-security, database-security, secrets-audit, dependency-security, abuse-prevention, privacy-review, security-regression-testing, ../../security-review, ../../architecture-design.
Related Knowledge
../../../knowledge/ (assets, attackers, impact tolerances).
Related References
../../../references/security/ (threat-model templates, when populated).
Context Loading Guidance
- Requires: architecture + data flow, data-sensitivity map, user/attacker context.
- Does not require: code-level detail (specialists handle it), full source.
- May load: the specialist skills a threat routes to.
- Stop when: the prioritized model + routed mitigations are recorded.
Token Efficiency Guidance
The threat table (boundary/asset → STRIDE threat → priority → mitigation → owning skill) is the whole artifact.
1---2name: threat-modeling3description: Use to identify what could go wrong before building — assets, trust boundaries, attackers, and threats (STRIDE-style) across the system — producing prioritized, testable mitigations that drive the specialist security skills. Structured thinking, not a scan.4---56# Threat Modeling78## Purpose910Find the threats worth defending against **before** they're built in: map assets, trust boundaries, and attackers, enumerate what could go wrong, and turn that into prioritized mitigations that route to the specialist security skills. It frames the whole security effort; it doesn't scan code.1112## When to Use1314- At design time for a new system/feature, and when architecture changes trust boundaries.15- **Not** as a code scan (specialist skills) or a post-hoc audit alone (`../../security-review`) — though it guides both.1617## Inputs1819- Architecture + data flow (`../../architecture-design`), data-sensitivity map (`../../backend/backend-security`).20- Applications, integrations, and who the users/attackers are.2122## Discovery Questions2324- What are the **assets** worth protecting (user data, money, credentials, availability, reputation)?25- Where are the **trust boundaries** (client↔server, service↔service, tenant↔tenant, third-party edges)?26- Who are the **attackers** (external anonymous, authenticated user abusing scope, malicious insider, compromised dependency)?27- What's the **impact** if each asset is compromised?2829## Responsibilities3031- Map **assets, entry points, trust boundaries, and data flows** across the system (each boundary is where threats concentrate).32- Enumerate threats systematically (STRIDE as a checklist: **S**poofing, **T**ampering, **R**epudiation, **I**nformation disclosure, **D**enial of service, **E**levation of privilege) per boundary/asset.33- **Prioritize by likelihood × impact** — model the plausible, not every theoretical attack.34- Turn each significant threat into a **mitigation routed to a specialist skill**:35 - identity/session threats → `authentication-security`;36 - access/scope/IDOR → `authorization-security`;37 - injection/API abuse → `api-security`, `web-security`;38 - data exposure → `database-security`, `privacy-review`;39 - secret exposure → `secrets-audit`; dependency compromise → `dependency-security`;40 - automated abuse/DoS → `abuse-prevention`; platform-specific → `mobile-security`/`web-security`.41- Make mitigations **testable** — each should become a security regression test (`security-regression-testing`).4243## Required Workflow44451. Inventory assets, entry points, trust boundaries, data flows.462. Enumerate threats per boundary (STRIDE checklist).473. Prioritize by likelihood × impact.484. Assign each significant threat a mitigation + owning specialist skill.495. Record the model; feed mitigations to the specialists and to `security-regression-testing`.5051## Decision Rules5253- Model the plausible attacker and realistic impact — infinite theoretical threats aren't a plan; prioritize.54- Trust boundaries are where to look hardest — data crossing one is untrusted until validated/authorized.55- Every mitigation names an owner (a specialist skill) and is testable — otherwise it's a wish.56- Revisit the model when architecture changes boundaries; it's living, not one-time.5758## Rules5960- Threats prioritized, not exhaustively listed without triage.61- Mitigations routed to specialist skills and made testable.62- The model is recorded and revisited on boundary changes.6364## Anti-Patterns6566- Skipping threat modeling and discovering the attack surface in production.67- An unprioritized wall of every conceivable threat, actioned on none.68- Mitigations with no owner or no test.69- Modeling once and never updating as the system changes.70- Treating a vulnerability scanner's output as a threat model.7172## Validation Checklist7374- [ ] Assets, entry points, trust boundaries, data flows mapped.75- [ ] Threats enumerated per boundary (STRIDE).76- [ ] Prioritized by likelihood × impact.77- [ ] Each significant threat → mitigation + owning specialist skill.78- [ ] Mitigations testable; fed to `security-regression-testing`.7980## Definition of Done8182A recorded, prioritized threat model — assets, boundaries, attackers, and STRIDE threats — with each significant threat mapped to a testable mitigation owned by a specialist security skill, revisited when boundaries change.8384## Related Skills8586`authentication-security`, `authorization-security`, `api-security`, `web-security`, `mobile-security`, `database-security`, `secrets-audit`, `dependency-security`, `abuse-prevention`, `privacy-review`, `security-regression-testing`, `../../security-review`, `../../architecture-design`.8788## Related Knowledge8990`../../../knowledge/` (assets, attackers, impact tolerances).9192## Related References9394`../../../references/security/` (threat-model templates, when populated).9596## Context Loading Guidance9798- **Requires:** architecture + data flow, data-sensitivity map, user/attacker context.99- **Does not require:** code-level detail (specialists handle it), full source.100- **May load:** the specialist skills a threat routes to.101- **Stop when:** the prioritized model + routed mitigations are recorded.102103## Token Efficiency Guidance104105The threat table (boundary/asset → STRIDE threat → priority → mitigation → owning skill) is the whole artifact.