Four Questions Behind Every Threat Model
Learn the four questions every threat model answers, what assets and entry points are, how to pick a method such as STRIDE, LINDDUN or attack trees for the question in front of you, and which design changes should send a team back to its model.
Contentsand lesson path
On this page
- Why it matters
- The four questions
- Assets, entry points and detail
- Choosing a method for question 2
- Keeping the model current
- Check your understanding
- Apply it
- Review prompt
Lessons of Threat Modeling
- Four Questions Behind Every Threat Model Concept · 15 min
- Diagramming Data Flows and Trust Boundaries Worked example · 25 min
- STRIDE per Element on a Sample Service Lab · 30 min
- Attack Trees for the Threats That Matter Worked example · 20 min
- From Threats to Owned, Verifiable Mitigations Worked example · 20 min
- Threat Modeling Check Knowledge check · 8 questions
What you will learn
- Draw a data-flow diagram that marks assets, entry points and trust boundaries at a level of detail suited to the decision being made.
- Keep a threat model current by revisiting it on design changes and embedding it in the team's delivery workflow.
01. Why it matters
A threat model is a structured description of a system that shows what could go wrong with its security or privacy, and what the team will do about it. It is a thinking tool, not a document for an auditor. The value comes from finding design problems while they are still cheap to change: moving a trust decision from the browser to the server costs an hour in a design meeting and weeks after launch.
Many teams skip threat modelling because they picture a heavy workshop with special software and a 40-page report. In practice, most useful threat models are small. A team adding cover-photo uploads to a book-lending site can model that one feature in half an hour on a whiteboard, as long as it asks the right questions in the right order.
This skill follows one running example, BookSwap: a small web application where neighbours lend books to each other. Members sign in through a browser, a web API stores members and loans in Postgres, and a background worker sends emails through a third-party email provider. In later lessons you will draw its data flows, find threats with STRIDE, expand the worst ones into attack trees and turn them into owned, tested work.
02. The four questions
The Threat Modeling Manifesto, written by a group of practitioners, reduces the work to four questions. Adam Shostack, who popularised them, calls this the Four Question Framework. Most modern methods fit inside it.
- What are we working on? You describe the system or the change. Usually this is a data-flow diagram (lesson 2), but a list of components and the data they exchange can be enough for a small change. For BookSwap's upload feature, the answer is: the browser sends an image to the API, which stores it in a bucket and shows it on the book page.
- What can go wrong? You look for threats: ways an attacker, a careless user or a failure could break a security property. A method such as STRIDE gives you prompts so that you do not depend on whoever happens to be in the room. For uploads: a member could replace someone else's cover, or a photo could reveal where a member lives through its GPS metadata.
- What are we going to do about it? For each threat you choose a response: reduce it with a control, accept it with a named person signing off, or remove the risky feature. "Strip metadata when re-encoding the image" is an answer; "be careful with images" is not.
- Did we do a good enough job? You check the model and the result. Did the diagram match the code that was built? Does each mitigation have a test, an alert or a review that proves it works? Were the right people involved?
The order matters. Teams that jump straight to question 2 argue about threats to a system they have not agreed on. Teams that never ask question 4 end up with a list of mitigations nobody verified.
03. Assets, entry points and detail
Two terms make question 1 concrete. An asset is something worth protecting: data such as password hashes, loan history and email addresses, but also capabilities such as the email provider API key, or the ability to approve new members. An entry point is a place where input from outside reaches your code: an HTTP route, a message queue consumer, a file the application reads, an admin console. Together, the entry points form the attack surface.
Listing assets tells you what an attacker wants. Listing entry points tells you where they can push. A threat usually connects the two: input arrives at an entry point and reaches an asset it should not reach.
You also choose a level of detail. A model is good enough when it can answer the decision you are making. If the question is "should the upload feature store files in a bucket or on the API server's disk?", you need the upload path in some detail and the rest of BookSwap as one box. A diagram of every microservice in the company would hide the question; a class diagram would show code structure but not where data crosses between trust levels.
04. Choosing a method for question 2
"What can go wrong?" is the hardest question to answer evenly, so several methods exist to structure it. They are prompts, not competing religions, and you can combine them.
- STRIDE (Spoofing, Tampering, Repudiation, Information disclosure, Denial of service, Elevation of privilege) gives six categories of security threat. Applied per element of a data-flow diagram, it is the most common starting point and the subject of lesson 3.
- LINDDUN does the same for privacy harms: Linking, Identifying, Non-repudiation, Detecting, Data disclosure, Unawareness and unintervenability, and Non-compliance. Use it when the main worry is what the system lets people learn about each other, not only whether an attacker can break in.
- Attack trees start from one attacker goal and break it down into the steps needed to reach it. They are good for the few threats that matter most, because they show which single control removes a whole path (lesson 4).
- Abuse cases describe how a legitimate feature is misused: a member uploading 10,000 covers to run up the storage bill uses the feature exactly as designed.
- PASTA (Process for Attack Simulation and Threat Analysis) is a seven-stage, risk-centred process that links business objectives to technical threats. It suits larger programmes with dedicated security staff more than a single feature team.
A practical rule: start with STRIDE per element for any new data flow, add LINDDUN when personal data is involved, and draw attack trees only for the two or three threats you rank highest.
05. Keeping the model current
A threat model describes a design at one moment. When the design changes, the model can become wrong without anyone noticing. The fix is not to schedule a big yearly review but to know which changes should reopen it. Four kinds of change matter most: a new entry point, a new party you must trust (an identity provider, a payment processor, a new vendor), a new place where data rests, and a new kind of data to protect. A redesign of a page layout or a patch upgrade of a library usually changes none of these. Checking every change against these triggers, as part of normal design and code review, is what people call continuous threat modelling.
The script below shows the idea. It compares a short design summary of two BookSwap releases and reports what is new. Save it as revisit.py and run it with Python 3.10 or later; it needs no packages.
"""Compare two design summaries and say whether the threat model must be revisited."""
TRIGGERS = {
"entry_points": "new way in for callers",
"external_parties": "new party to trust",
"stores": "new place where data rests",
"data_types": "new kind of data to protect",
}
RELEASE_13 = {
"entry_points": {"POST /login", "GET /loans"},
"external_parties": {"email provider"},
"stores": {"postgres"},
"data_types": {"email address", "loan history"},
}
RELEASE_14 = { # adds council single sign-on and cover photos
"entry_points": {"POST /login", "GET /loans", "GET /sso/callback", "POST /covers"},
"external_parties": {"email provider", "council SSO"},
"stores": {"postgres", "cover bucket"},
"data_types": {"email address", "loan history", "photos"},
}
RELEASE_15 = RELEASE_14 # a grid layout and a patch upgrade: same design summary
def revisit(before, after):
found = []
for key, reason in TRIGGERS.items():
for item in sorted(after[key] - before[key]):
found.append(f"{reason}: {item}")
return found
RELEASES = [("14", RELEASE_13, RELEASE_14), ("15", RELEASE_14, RELEASE_15)]
for name, before, after in RELEASES:
found = revisit(before, after)
print(f"Release {name}: {'REVISIT' if found else 'no model change'}")
for line in found:
print(f" - {line}")python3 revisit.pyRelease 14: REVISIT
- new way in for callers: GET /sso/callback
- new way in for callers: POST /covers
- new party to trust: council SSO
- new place where data rests: cover bucket
- new kind of data to protect: photos
Release 15: no model changeRelease 14 adds single sign-on through the city council and cover photos, so the model must be revisited: there are two new routes, a new party to trust, a new store and a new kind of data. Release 15 changes the look of the site but not its design summary, so the existing model still holds. The script only looks for additions: removing a component rarely adds threats, although you should still delete it from the model so the diagram stays true.
Real teams do not maintain these summaries by hand in a script. They put a short prompt in the ticket or pull-request template ("Does this change add an entry point, a third party, a data store or a new type of personal data?") and, when the answer is yes, update the model in the same pull request as the code. Lesson 5 shows a CI check that compares the routes the application exposes with the entry points recorded in the model. Keeping the model in the repository as text or as code (for example with OWASP pytm or OWASP Threat Dragon JSON files) means model changes get the same review as code changes.
06. Check your understanding
07. Apply it
The skill project asks you to threat-model a small three-tier web application with a third-party payment integration. Start it now with question 1 only:
- Write one paragraph that answers "what are we working on?" for the checkout flow.
- List at least five assets (data and capabilities) and every entry point you can find, including webhooks from the payment provider.
- Write down which of the four revisit triggers the payment integration introduced, so you can explain later why it needed a model at all.
08. Review prompt
Without looking back, write down the four questions in order and one concrete output for each. Then name the method you would add when a feature handles personal data, and the four kinds of change that should reopen a threat model. Check your answers against the lesson.
References
Your progress
Reading state
Sign in to save that you finished reading this lesson.
Prove this skill
8 questions · about 6 minutes · scored automatically. Marking a lesson as read never demonstrates a skill.