Filters
How to search
  • Plain words find names, texts and examples.
  • "two words" finds the exact phrase.
  • --name or -x finds an option.
  • #word looks only inside commands.
  • @grep finds lessons and labs that use grep.
  • Filters: cat:network · in:labs · in:notes · level:rhcsa · ch:8 · root:yes. Put ! before a word to leave it out. OR between words means one of them.
  • ↑ ↓ to move · Enter to open · Esc to close · / to search

Security engineeringMixed 21 series

Threat modelling in one hour

A one-hour threat model is not a smaller version of a two-week one. It is a different output: five actions with names on them, and a written list of what you decided not to fix.

Quick reference

A workshop that ends with owners, dates and a list of accepted risks.

  1. Scope one service — One service, its data, its entry points, and the people who can say yes.
  2. Draw the boundary — A one-page flow diagram where every crossing is named and questioned.
  3. Ask STRIDE — Element by element, the letters that apply, written as actor, action, asset.
  4. Act with a name — A decision, an owner and a date per threat; accepted risks carry a name.

In one line: One hour, one page, five actions. The model is the actions it produced, not the diagram.

Start this week:

  • Book the hour with the service owner, not a delegate.
  • Draw the flow before the meeting and correct it live.
  • Re-run it when the data flow changes, not once a year.

Explained

Scope one service. Not the platform, not the estate: the service that handles money or identity, its data, its entry points, and the people who can approve a change.

Draw the flow. Four symbols are enough - external entity, process, data store, flow - plus the trust boundaries where the network or the owner changes. Every crossing is where input stops being trusted.

Ask STRIDE element by element. Spoofing, tampering, repudiation, information disclosure, denial of service, elevation of privilege. Write each threat as actor, action, asset, and name the missing control rather than a CVE.

Rank with two numbers, likelihood and impact, then sort. Close with a decision per row: mitigate, transfer, avoid or accept, with a person and a date.

Checklist

Run it at the start and again at the end. A line that cannot be answered in the room is the next hour's work.

Scope

  • One service, its data and its entry points are named.
  • Out of scope is written down, not implied by silence.
  • People who can approve a change are in the room.

Model

  • The data flow diagram fits on one page.
  • Every trust boundary is drawn and labelled.
  • Each element was asked the STRIDE letters that apply.

Act

  • Every threat has a decision, an owner and a date.
  • Every accepted risk names the person who accepted it.
  • Tickets exist, and the review is in the calendar.

Repeat

  • Re-run when a data store or an entry point is added.
  • Re-run after an architecture change, not on a calendar.
  • Keep the last model next to the code, not in a wiki.

The field guide

The full guide of the PDF (P973), page by page.

Scope: one service, one hour (before you start)

A model that covers the whole estate is a wish. Pick one service that handles money or identity, and put people in the room who can approve a change without asking anyone.

  • Name the service and the data it holds.
  • List the entry points: users, partners, admins, jobs.
  • Write down what is out of scope, in the same document.
  • Invite the engineer who owns the code, not a delegate.
InputExample
Servicecheckout-api and its database
Datacard token, order id, user id
Entry pointspublic API, admin API, queue
Out of scopethe payment provider's internals

The four questions, on the wall

1  What are we building?
2  What can go wrong?
3  What are we going to do about it?
4  Did we do a good job?

One page or nothing If the diagram does not fit on one page, you modelled too much. A second service gets a second hour, not a bigger diagram.

One service, one hour, one page: anything larger is a programme, not a workshop.

Draw the flow, then mark the boundaries (the model)

The data flow diagram is the model. Four symbols are enough: external entity, process, data store and flow. Trust boundaries are the lines that decide where the questions get asked.

  1. Draw the actor, outside your control.
  2. Draw each process that touches the data.
  3. Draw every data store, including caches and buckets.
  4. Label each arrow with the data it carries.
  5. Draw a boundary wherever the network or the owner changes.
BoundaryWhat changes there
Browser to edgeInput is untrusted, you control nothing
Edge to serviceTLS ends and identity is asserted
Service to databaseCredentials and network policy
CI to productionWho deploys, with which token

Pytm: the diagram as code

from pytm import TM, Actor, Server, Dataflow
 
tm = TM("checkout")
user = Actor("Customer")
api = Server("checkout-api")
Dataflow(user, api, "POST /pay")
tm.process()
 
# python3 tm.py --dfd | dot -Tpng -o dfd.png

Every flow that crosses a boundary is a place where input stops being trusted. If you cannot say what checks it, that is finding one.

STRIDE, one element at a time (the questions)

Walk the diagram element by element and ask the letters that fit. The table is the shortcut: not every letter applies to every kind of element.

ElementLetters that apply
External entitySpoofing, Repudiation
ProcessAll six
Data storeTampering, Repudiation, Disclosure, DoS
Data flowTampering, Disclosure, DoS

The six letters are Spoofing, Tampering, Repudiation, Information disclosure, Denial of service and Elevation of privilege. Say each threat as a sentence: who acts, on which element, and what they get.

  • Write the threat as actor, action, asset.
  • Name the missing control, not a CVE number.
  • One threat per row; do not merge two.
  • Skip a letter only when you can say why.

Repudiation is the one people skip It asks whether the action can be denied later. If the audit log is writable by the actor who took the action, the answer is yes.

Six letters, one element at a time, and the diagram turns into a list you can rank.

Rank with two numbers, not adjectives (ranking)

An unranked list of threats produces no actions. Two numbers, agreed out loud in the room, are enough to sort it and to defend the order afterwards.

ScoreWhat it means
1 lowInsider only; a nuisance, logged and caught
2 mediumA known technique; a day of work and a disclosure
3 highScripted and already seen; data loss or a notice

Multiply the two and sort descending. Break ties on whether the control is missing or merely misconfigured: a missing control is a project, a misconfigured one is a ticket for this sprint.

One row per threat

threat:   card data read by a support role
stride:   information disclosure
likely:   3    impact: 3
control:  row-level access, not a UI filter
decision: mitigate   owner: payments   due: 2026-11-14

Accept is a decision, not a gap If you accept the risk, record who accepted it and when it is reviewed. An accepted risk with no name is an unowned one.

Two numbers and a sort order turn a brainstorm into a queue with a top.

Close with actions, not a document (the output)

The hour produces a table where every row has a decision, an owner and a date. Anything else is a document that nobody opens twice.

  1. Read the sorted list out loud, top to bottom.
  2. For each threat choose mitigate, transfer, avoid or accept.
  3. Name one owner per action: a person, not a team.
  4. Set a date inside the next sprint or the next quarter.
  5. Book the review before anyone leaves the room.
OutputThe test it passes
ActionsEvery row has an owner and a date
Accepted risksEvery one has a named accepter
TicketsIn the tracker, not in the document
Review dateIn the calendar, with the same people

Two weeks later Someone can point at a ticket and say the threat model caused it. If nobody can, the hour produced a workshop about a diagram.

One service, one page, five actions with names on them: that is a threat model.

The honest caveat: an hour finds the threats the room already knows. The ones nobody thought of need the same hour again, with a different room.

The lesson: the model is the actions it produced, not the diagram.

Your turn: What would your last threat model have said if you had only had an hour?

More notes: Security engineering

Open in the notes app: search, filters, copy This note on GitHub