Skip to content

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:

  1. What are we working on?
  2. What can go wrong?
  3. What are we going to do about it?
  4. Did we do a good enough job?
A data flow diagram with trust boundaries1. Requests from the internet cross a trust boundary; check spoofing, tampering and denial of service here. 2. Partner webhooks cross it too; can someone forge one, or replay an old one? 3. Inside the boundary, ask what happens if this service is compromised; what can it read, change or delete?InternetOur system Customer browseruntrusted inputAPI gatewayauth, rate limits Orders servicebusiness logic Partner systemsends webhooks Webhook receiververifies signatures Databasecustomer data123
A data flow diagram with trust boundaries Threats cluster where data crosses a boundary. Each arrow that crosses one deserves a closer look.
  1. Requests from the internet cross a trust boundary; check spoofing, tampering and denial of service here.
  2. Partner webhooks cross it too; can someone forge one, or replay an old one?
  3. Inside the boundary, ask what happens if this service is compromised; what can it read, change or delete?
  1. 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).
  2. 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?
  1. 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.
  2. 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.
  • 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.

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.

  • 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.

Written and edited by Abhinav Taduka, enterprise software architect.