Threat Modelling in the SDLC, 50 min read

3.1 Threat modelling across the SDLC

In this lesson you will:

  1. Place threat modelling activities in each phase of the software development lifecycle (SDLC).
  2. Turn threats into security requirements, abuse cases and tests, with traceability between them.
  3. Describe how the NIST Secure Software Development Framework, OWASP SAMM and the Microsoft SDL treat threat modelling.
  4. Contrast traditional, document-centric threat modelling with continuous threat modelling, and say what each is good for.
  5. List the changes that should trigger an update to an existing threat model.

Opening case: the threat model on the shelf

Two years ago, before Kestrel launched, a consultancy produced a 140-page threat model of the platform. It was thorough, well-written and approved by the board. It now sits in a document library.

Since then, Kestrel has added instant refunds, a merchant mobile app, a partner API for accounting software, a second sponsor bank and an AI support assistant. None of these appears in the document. When an auditor asks for "the current threat model of the payments platform", the security lead realises the honest answer is that there isn't one.

By the end of this section you will be able to explain why this happens to traditional threat models, and how to build threat modelling into the lifecycle so the model stays alive.

Threat modelling in each SDLC phase

Threat modelling is often described as a "design phase" activity, and design is where it delivers most value. But it connects to every phase of the lifecycle.

Threat modelling activities at each SDLC phase, with a loop back from operations to design
Figure 3.1 Threat modelling activities across the SDLC

Requirements. Before there is a design, you can still ask what the system must protect and from whom. Write abuse cases (also called misuse cases): user stories from the attacker's point of view. "As a fraudster, I want to change another merchant's payout account so that I receive their settlement." Each abuse case produces a security requirement: "The system shall allow a payout account to be changed only by an authenticated user of that merchant with the owner role, after step-up authentication." Regulatory and contractual obligations (PCI DSS, RBI guidelines, the DPDP Act) become requirements here too.

Design. The full threat model: diagram, STRIDE (and other methods as needed), risk rating, decisions. This is where design changes are cheap. The output is a set of design decisions and mitigations that the build phase must implement.

Build. Mitigations become work items: stories, tasks or acceptance criteria that developers implement. Secure coding guidance and code review check that they were built as designed. Developers should be able to see which threat each security task addresses.

Test. Each mitigation should have at least one test that proves it works, ideally automated: "attempt to change another merchant's payout account; expect HTTP 403 and an audit entry." The threat model also gives penetration testers a map of where to focus, and testers' findings feed back into the model.

Release. Before go-live, review the open threats. Anything not mitigated must be explicitly accepted by the named risk owner, with a reason and an expiry date. Release is not the moment to discover high-risk threats for the first time.

Operate. Monitoring and detection are mitigations too: many threats are addressed by detecting and responding rather than preventing. Incidents, near misses, bug-bounty reports and threat intelligence should all be checked against the model: did we anticipate this? Why not? Then the loop goes back to design.

Worked example: from threat to test

Here is one Kestrel threat traced through the lifecycle.

Artefact Content
Abuse case As a fraudster with a merchant login, I want to change the payout account of a merchant I don't belong to so that their settlement comes to me.
Threat (T2) A logged-in merchant user can change another merchant's payout account by changing the merchant ID in the request, because the server does not check ownership.
Security requirement SR-14: Every merchant-scoped API operation shall verify, on the server, that the authenticated user is a member of the merchant identified in the request with a role permitted for that operation.
Design decision Implement a shared authorisation middleware that derives the merchant from the session, not the request body; reject mismatches.
Backlog item PAY-1182: Authorisation middleware for merchant-scoped endpoints (links T2, SR-14).
Test test_payout_account_other_merchant_forbidden: user of merchant A sends a request for merchant B; expect 403, no change, audit event authz_denied. Runs in CI on every build.
Monitoring Alert if authz_denied events from one user exceed 5 in 10 minutes (possible probing).

This chain is called traceability. It lets anyone answer, for any threat: what did we decide, where was it built, how do we know it works, and how would we know if it were attacked?

Practitioner tip. Put the threat ID in the ticket and the test name. It costs nothing and makes audits, regression analysis and future threat model updates far easier.

What the secure development frameworks say

Threat modelling appears in every major secure development framework. Knowing where helps when you need to justify it or show compliance.

NIST SSDF (SP 800-218). The Secure Software Development Framework groups practices into Prepare the Organisation (PO), Protect the Software (PS), Produce Well-Secured Software (PW) and Respond to Vulnerabilities (RV). Task PW.1.1 asks organisations to use forms of risk modelling, such as threat modelling, attack modelling or attack surface mapping, to assess the security risk of the software [1]. The SSDF matters beyond the US because many enterprise and government buyers, and secure-software attestation requirements, reference it. NIST has also published a community profile (SP 800-218A) that adds practices for generative AI and foundation-model development.

OWASP SAMM. The Software Assurance Maturity Model has a Threat Assessment practice in its Design function, with two streams: application risk profile (deciding which applications need how much attention) and threat modelling itself. It describes three maturity levels, from ad hoc, best-effort threat modelling to standardised, mandatory and continuously improved threat modelling [2].

Microsoft SDL. The Security Development Lifecycle has included threat modelling as a core practice since the mid-2000s, and Microsoft publishes the free Threat Modeling Tool, which generates STRIDE threats from DFDs [3].

Others. BSIMM (an observational model of what real organisations do) records threat modelling activities in its Architecture Analysis practice. Standards such as IEC 62443-4-1 (industrial automation), ISO/SAE 21434 (automotive, through threat analysis and risk assessment, TARA) and PCI's Secure Software Standard require threat analysis for their domains. Regulation is moving the same way: secure-by-design expectations in government guidance and product-security laws such as the EU Cyber Resilience Act expect manufacturers to assess cybersecurity risk during design.

Traditional versus continuous threat modelling

The 140-page document in the opening case is an example of traditional threat modelling: a large, expert-led exercise, done once (usually at design time or before launch), producing a detailed document. It grew up in an era of waterfall projects with long design phases and infrequent releases.

Continuous threat modelling treats the threat model as a living artefact that changes with the system, owned by the team that builds it, updated in small increments as features are designed.

Aspect Traditional Continuous
When Once, at design or pre-launch At design, then on every significant change
Who Security experts or consultants The delivery team, supported by security champions and experts
Output Long document Diagram and threat list in the repository or a tool, linked to the backlog
Depth Deep and broad at one moment Deep where the change is; light elsewhere
Strength Thorough baseline; good for audits, high-assurance or regulated launches Stays current; scales with frequent releases; builds team skill
Weakness Goes stale; slow; teams don't own it Can be shallow; needs discipline and a baseline to hang increments on

The two are not opposites. The healthiest pattern is a baseline model of the system (often produced with expert help, at Level 1), kept alive by incremental updates for each change. The baseline gives context; the increments keep it true.

Triggers for updating the model

A living model needs clear rules for when to update it. Figure 3.2 shows the common triggers.

Eight changes that should trigger an update to the threat model
Figure 3.2 Changes that should trigger a threat model update
  • A new external interface: an API, partner integration, webhook or file exchange.
  • A new trust boundary: a new tenant model, network segment, cloud account or organisation.
  • New sensitive data: personal data, card data, health data, credentials or keys.
  • A change to authentication or authorisation: new roles, SSO, new token types.
  • A new AI component: a model, a retrieval pipeline, an agent or a new tool for an agent.
  • An incident, near miss or pen-test finding that the model did not anticipate.
  • A major dependency change: a new framework, cloud service or third party.
  • A regulatory change affecting what must be protected or how.

A simple rule many teams adopt: if the change would change the Level-1 diagram, update the threat model. If it adds a box, an arrow across a boundary, or a boundary, it needs at least a short session.

Who does what

Role Responsibility
Product owner Sets business priorities and impact; accepts residual risk within their authority
Architect or tech lead Owns the system model; leads design decisions on mitigations
Developers Contribute to sessions; implement and test mitigations
Testers Turn threats into tests; report gaps
Security champion Facilitates routine sessions; keeps the model current; escalates
Security team Sets method and standards; coaches; reviews high-risk models; joins critical sessions
Risk owner / leadership Accepts risks above team authority; funds major mitigations

The opening case, resolved

The 140-page model failed for reasons typical of traditional threat modelling: it was produced by outsiders, stored outside the team's tools, had no triggers for update and no link to the backlog. Kestrel did not throw it away. The team extracted its Level-1 DFD and threat list as a baseline, put them in the platform repository, and ran short sessions for each change made since launch, starting with the AI support assistant and the partner API (both new external interfaces with sensitive data). They added "does this change the Level-1 diagram?" to the definition of ready for every epic. Six weeks later, the auditor got a current model, and the team had found three serious threats in features built after the original document.

Check your understanding

1. Turn this threat into a security requirement and a test: "An attacker can replay a captured refund request to the bank and receive the refund twice."

Answer: Requirement: "Every refund request to the bank shall carry a unique idempotency key and signed timestamp; the refund service shall reject any key it has already processed." Test: send the same refund request twice; expect the second to be rejected with no second ledger entry or bank call.

2. A team changes the colour scheme of the merchant dashboard. A week later it adds a "share report by link" feature that creates public URLs. Which change triggers a threat model update and why?

Answer: The share-by-link feature: it creates a new external interface (public URLs) and exposes data across a trust boundary. The colour change does not change the diagram.

3. Which NIST SSDF task addresses threat modelling?

Answer: PW.1.1, under Produce Well-Secured Software: use risk modelling (such as threat modelling or attack surface mapping) to assess the software's security risk.

Key takeaways

  • Threat modelling connects to every SDLC phase: abuse cases and requirements, design decisions, build tasks, tests, release sign-off and operational feedback.
  • Traceability (threat → requirement → ticket → test → monitoring) proves mitigations exist and work.
  • NIST SSDF PW.1.1, OWASP SAMM Threat Assessment and the Microsoft SDL all require threat modelling; sector standards and regulation increasingly expect it.
  • Traditional threat models are thorough but go stale; continuous threat modelling keeps a baseline alive with incremental updates owned by the team.
  • Update the model when the Level-1 diagram would change: new interfaces, boundaries, sensitive data, auth changes, AI components, incidents, dependencies or regulations.