Threat modeling
Threat modeling is the practice of examining a design to find security problems while they’re still cheap to fix: on a whiteboard rather than in production. It isn’t a tool or a document template. It’s a conversation, guided by a simple structure, between the people who know how the system works.
The Threat Modeling Manifesto (opens in a new tab) sums the method up in four questions:
- What are we working on?
- What can go wrong?
- What are we going to do about it?
- Did we do a good enough job?
Diagram
Section titled “Diagram”- Requests from the internet cross a trust boundary; check spoofing, tampering and denial of service here.
- Partner webhooks cross it too; can someone forge one, or replay an old one?
- Inside the boundary, ask what happens if this service is compromised; what can it read, change or delete?
How it works
Section titled “How it works”- Draw the system. A data flow diagram is enough: external entities, processes, data stores, the flows between them, and trust boundaries wherever the level of trust changes (internet to your network, your service to a third party, user to admin).
- Find threats, element by element. STRIDE is the classic checklist:
| Letter | Threat | Property violated | Typical question |
|---|---|---|---|
| S | Spoofing | Authentication | Can someone pretend to be another user or system? |
| T | Tampering | Integrity | Can data be changed in transit or at rest? |
| R | Repudiation | Non-repudiation | Can someone deny an action because we can’t prove it? |
| I | Information disclosure | Confidentiality | Can data leak to someone who shouldn’t see it? |
| D | Denial of service | Availability | Can someone make it unavailable? |
| E | Elevation of privilege | Authorization | Can someone do more than they’re allowed? |
- Decide what to do about each threat: mitigate it, eliminate the feature, transfer the risk (for example, to a payment provider), or accept it explicitly, with an owner.
- Track and check. Mitigations become backlog items with tests. Revisit the model when the design changes.
Other methods exist. PASTA is risk-centric and business-driven. LINDDUN focuses on privacy threats. Attack trees explore how one goal could be reached. STRIDE is the easiest place to start.
- Finds design flaws that scanners and penetration tests can’t, because they’re in the architecture, not the code.
- Cheap: an hour with the right people can prevent months of rework.
- Shared understanding of the system, which helps far beyond security.
- Depends on the people in the room; missing the person who knows the integration means missing its threats.
- Can become a box-ticking exercise if done once for a compliance gate and never revisited.
- Doesn’t find implementation bugs; you still need code review, testing and scanning.
When to use it
Section titled “When to use it”- At the design stage of any new system, feature or integration that touches sensitive data, money or identity.
- When the architecture changes significantly: a new trust boundary, a new third party, a move to the cloud.
- As part of an architecture decision record for security-relevant choices.
When to avoid it
Section titled “When to avoid it”Don’t run a full formal session for trivial changes inside an existing trust boundary. A short “what’s new that could go wrong?” question in design review is enough.
Common pitfalls
Section titled “Common pitfalls”- Boiling the ocean: modeling everything at once. Start with one feature or one flow.
- Producing a document nobody reads instead of backlog items with owners.
- Only the security team in the room. Developers and operators know where the real risks are.
- Ignoring the supply chain: third-party libraries, build pipelines and SaaS integrations.
Related patterns
Section titled “Related patterns”- See it applied: Example Lending, a complete STRIDE model with fourteen threats
- Zero trust architecture
- Identity and access management
- Quality attributes and NFRs
- Scenario: audit readiness
Further reading
Section titled “Further reading”- Threat Modeling Manifesto (opens in a new tab)
- OWASP, Threat Modeling Cheat Sheet (opens in a new tab)
- Microsoft, Threat modeling in the Security Development Lifecycle (opens in a new tab)
- Adam Shostack, Threat Modeling: Designing for Security (Wiley, 2014)
Written and edited by Abhinav Taduka, enterprise software architect.
New pages are added regularly. Follow Abhinav on LinkedIn to see them first.