How it works
The explanation, with examples you can run.
The four questions
The Threat Modeling Manifesto boils the practice down to:
- What are we working on? A picture of the system.
- What can go wrong? Threats, found systematically.
- What are we going to do about it? Decisions, with owners.
- Did we do a good enough job? A quick review, and a reminder to revisit.
A 30-minute session
Minutes 0–10: draw it. A simple data-flow diagram: external actors (users, partner systems), your processes (API, worker), data stores (database, bucket, cache), and arrows for the data moving between them. Then draw trust boundaries: dashed lines where data passes between parties that trust each other differently. The internet to your API is one; your service to a payment provider is another; a browser extension to your page is a third.
Minutes 10–25: walk the arrows with STRIDE. For each arrow that crosses a boundary, ask:
- Spoofing: can someone pretend to be another user or service? (authentication)
- Tampering: can data be changed in transit or at rest? (integrity, signing, TLS)
- Repudiation: could someone deny doing something, and could we prove otherwise? (audit logs)
- Information disclosure: can data leak to someone who shouldn't see it? (authorisation, encryption, error messages)
- Denial of service: can someone exhaust a resource? (rate limits, quotas, timeouts)
- Elevation of privilege: can someone gain rights they shouldn't have? (access control, input handling)
Write each threat as a sentence: "An attacker who guesses an invoice ID can download another customer's invoice."
Minutes 25–30: decide. For each threat, choose to mitigate (add a check), accept (low impact, written down and signed off), transfer (a provider or insurance carries it) or avoid (drop the feature or the data). Turn mitigations into tickets with owners.
Keep it light and repeated
A threat model is useful only while it matches the system. Attach the diagram to the design document, revisit it when a new boundary appears (a new third party, a new public endpoint, a new kind of personal data), and make "did anything here cross a trust boundary?" a normal design-review question.
Common findings in a first session: missing ownership checks on IDs in URLs, secrets shared between environments, webhooks accepted without verifying their signature, admin endpoints reachable from the internet, and logs that contain tokens or personal data. Each of these has its own topic later in this path.
Check yourself
3 questions. Get them all right to finish this topic.
0 of 3 right so far. Get all three to finish this topic.