Goal. By the end you have followed one complete model, from diagram to threats, ratings, mitigations, detection requirements and residual risk, and you can apply the same process to a system of your own.
Why it matters#
Methods make sense once you have seen them used start to finish. This page applies stages 1 to 7 to an invented system. Treat it as a template, argue with its choices, then build your own. Everything here is made up, including the product, its people and its numbers.
What you will learn#
The system#
ClubKeeper is a small web application for community clubs such as choirs and running groups. Members sign in
with email and a password, book events and upload a profile photo. Club admins manage members, export a member
list and issue refunds. Card payments happen on a payment provider's hosted page, so ClubKeeper never handles
card numbers; the provider sends a signed webhook when a payment succeeds. Code lives in a hosted Git repository.
A pipeline builds a container image, pushes it to a registry and deploys it to a managed container service. The
database and upload storage are managed services, and secrets sit in a secrets manager. It runs at
clubkeeper.example.com.
Scope. In: the web app and API, database, upload storage, secrets manager, registry and pipeline. Out: the payment provider's internals, the cloud provider's data centres and members' devices. Assumptions: TLS on every flow; the database has no public address; one production account; admins use the same sign-in page as members.
Question 1: what are we working on?#
Diagram source (Mermaid)
flowchart LR
member["Member"]
admin["Club admin"]
dev["Developer"]
pay["Payment provider"]
mail["Email provider"]
subgraph ci["Trust boundary: CI/CD service"]
repo[("Git repository")]
runner(["Pipeline runner"])
end
subgraph prod["Trust boundary: production cloud account"]
app(["Web app and API"])
db[("Database")]
files[("Upload storage")]
vault[("Secrets manager")]
registry[("Container registry")]
end
member -->|"F1 browse, book, upload"| app
admin -->|"F2 manage, export, refund"| app
app -->|"F3 SQL"| db
app -->|"F4 photos"| files
app -->|"F5 read secrets"| vault
member -->|"F6 pay on hosted page"| pay
pay -->|"F7 signed webhook"| app
app -->|"F8 notifications"| mail
dev -->|"F9 push and review"| repo
repo -->|"F10 trigger"| runner
runner -->|"F11 push image"| registry
runner -->|"F12 deploy"| app
registry -->|"F13 pull image"| appCard data is eliminated by design: the hosted payment page keeps it out of our systems entirely.
Questions 2 and 3: what can go wrong, and what will we do?#
STRIDE per element over the flows, abuse cases for refunds and exports, LINDDUN for personal data, and the CI/CD list for the pipeline give ten threats. Ratings use the stage 4 table (L, M, H).
| ID | Where | STRIDE | Threat | Likelihood | Impact | Rating | Response |
|---|---|---|---|---|---|---|---|
| T1 | F2 | S | Admin account taken over with a reused or phished password | M | H | High | Mitigate |
| T2 | F1 | E, I | A member changes an ID in a request and reads another member's or club's records | H | H | Critical | Mitigate |
| T3 | F2 | R | Admin exports or edits data and the logs cannot show who | M | M | Medium | Mitigate |
| T4 | F2 | I | Exports carry data clubs do not need, kept indefinitely | M | M | Medium | Eliminate |
| T5 | F4 | T, I | Hostile upload, or storage readable by the public | M | M | Medium | Mitigate |
| T6 | F7 | S, T | Forged webhook marks a membership paid | M | M | Medium | Mitigate |
| T7 | F3 | I | SQL injection, or an over-privileged database user, exposes every club's data | L | H | Medium | Mitigate |
| T8 | F12 | E | A stolen long-lived deploy credential ships a backdoored image | M | H | High | Mitigate |
| T9 | F9–F11 | T | A malicious pull request or dependency changes the pipeline and steals secrets | M | H | High | Mitigate |
| T10 | F1 | D | Booking-day flood takes the site down | M | M | Medium | Mitigate, then accept the rest |
T4 is eliminated by dropping the date-of-birth field nobody needs. Fraud liability on card payments is transferred to the provider's terms, but T6 still needs our own checks.
Each mitigation becomes a requirement with a test and a detection requirement, shown here for the six threats that matter most:
| ID | Requirement | Test | Detection requirement |
|---|---|---|---|
| T1 | MFA for admins; sign-in rate limits; breached-password check | An admin session cannot start without the second factor | Many failures then a success; admin sign-in from a new country |
| T2 | Every read and write is authorised against the caller's club and role | Abuse-case test: member A requests member B's IDs and is refused | One account refused for many distinct IDs in a short time |
| T5 | Private storage; short-lived signed links; type and size limits | An unauthenticated request for an upload fails | Any change that makes the storage public; unusual download volume |
| T6 | Verify the webhook signature; re-check payment status with the provider | A forged webhook is rejected and logged | A spike in failed signature checks |
| T8 | Short-lived pipeline credentials via OpenID Connect, deploy-only; production approval; signed images | An old key no longer works; an unsigned image will not deploy | Deploy role used outside the pipeline, or a deployment with no pipeline run |
| T9 | Protected branches and review; no secrets for untrusted builds; pinned actions and dependencies | A fork's pull request cannot read secrets; CI fails on an unpinned action | Pipeline definition changed without review; new outbound destinations from runners |
Backlogs (stage 7). Hunt: search 90 days of audit logs for deployments with no pipeline run (T8) and admin exports outside club hours (T3, T4). Emulation: in a lab copy, replay T2 with two test accounts and T8 with a test role, and record which alerts fire.
Question 4: did we do a good enough job?#
- The diagram was checked against the infrastructure code, not memory.
- Every High and Critical threat has an owner and a ticket; every requirement has a test.
- The assumption "admins use the same sign-in page" was challenged, which is why T1 asks for MFA.
- The model lives in the repository, with triggers for a new feature, a new third party or an incident.
Residual risk
| ID | Left over | Decided by | Review |
|---|---|---|---|
| T2 | Low: tests and review lower authorisation bugs but cannot remove them | Product owner | Each release |
| T8 | Medium: the CI/CD service itself could be compromised, which is partly the provider's risk | Product owner | In six months |
| T9 | Medium: new dependency attacks arrive faster than controls | Product owner | In six months |
| T10 | Medium: a flood beyond what rate limits and a CDN absorb is accepted | Product owner | After the first event season |
Do this#
- Redraw it (60 minutes) in Threat Dragon or pytm. What does the tool add, and what noise does it make?
- Add a feature (60 minutes): members can invite a guest by email. Update the diagram, find four new threats and re-rate.
- Challenge two ratings (30 minutes). Defend a different rating for each, in writing.
- Write a detection requirement (30 minutes) for T3 in the stage 7 format, naming the log fields you would need.
- Model your own system (3–4 hours). Apply the four questions to a system you know, with one page per question. This is portfolio project 1 in the overview.
Resources#
Free first
- GitHub Docs: Creating diagrams - how the Mermaid diagram above renders.
- How to approach threat modeling - the AWS Security Blog's walk-through of a process, including who plays which role in the room.
- OWASP API Security Top 10 (2023) - the source for T2-style authorisation questions.
- OWASP Top 10 CI/CD Security Risks - the source for T8 and T9.
- OpenID Connect in GitHub Actions - how pipelines get short-lived cloud credentials.
- OWASP ASVS - borrow requirements and tests from here.
Paid or needs an account
- None needed for this stage.
Checkpoint#
You are ready to finish the roadmap when you can:
Go deeper (optional)#
- Pick a roadmap from the overview and use your detection requirements, hunt hypotheses and emulation tests as that roadmap's first exercises.
- Add a support chatbot to ClubKeeper and model it with stage 6.
- Carry one detection requirement into Detection Engineering stage 5, and one emulation test into Threat Emulation stage 4.