Skip to content

Threat modeling: STRIDE in a development team

B2Bnetwork team · · 6 min

Security

In brief

Threat modeling is a structured review of a system's design that asks what can go wrong before the code reaches production. STRIDE, the model described by Microsoft, sorts threats into six categories: spoofing, tampering, repudiation, information disclosure, denial of service and elevation of privilege. The team draws a data flow diagram, asks questions from all six categories at every process and trust boundary, and records the results in the backlog as tasks with an owner.

What threat modeling is

The Threat Modeling Manifesto boils the method down to four questions: what are we working on, what can go wrong, what are we going to do about it, and did we do a good enough job. OWASP describes threat modeling in a similar way: as work done at the design stage and repeated with every significant architecture change.

Threat modeling does not replace a penetration test or a scan. A test checks a finished system and finds defects that are already in the code. A threat model works on the design and finds defects in the assumptions: no authentication between services, personal data in a queue without encryption, an admin panel exposed to the internet. Fixing such a defect at design time means changing a diagram. After release it often means reworking several services. How a test differs from a scan is covered in the article on penetration testing vs. vulnerability scanning.

STRIDE: six threat categories

Each letter of STRIDE stands for a threat that violates one security property.

CategoryWhat it violatesExample in a systemTypical control
Spoofingauthenticationa service accepts calls from anyone who knows its addressmTLS between services, OAuth 2.0 token validation
Tamperingintegritythe amount in a queued message is changedmessage signing, validation on the receiving side
Repudiationnon-repudiationan operator changes a customer limit and leaves no tracean append-only event log, the person's ID in every entry
Information disclosureconfidentialitynational ID numbers in application logsmasking in logs, encryption, access control on logs
Denial of serviceavailabilityone reporting query locks the databaserate limits, queues, a separate replica for reports
Elevation of privilegeauthorizationa regular user calls an admin endpointserver-side permission checks on every call

Microsoft describes STRIDE in the documentation of the Microsoft Threat Modeling Tool, part of its Security Development Lifecycle. The categories overlap: a leaked session token is information disclosure that leads to spoofing. What matters is that the threat makes it onto the list at all, not which category it lands in.

Data flow diagram and trust boundaries

STRIDE works on a data flow diagram (DFD). Five elements are enough:

  • external entity: a user, a partner system, a payment provider;
  • process: a service, a function, a batch job;
  • data store: a database, a queue, a bucket, a file;
  • data flow: an API call, a message, a file export;
  • trust boundary: a line where the level of trust changes, for example between the internet and the DMZ, or between a cluster and a cloud service.

Most threats sit on flows that cross a trust boundary, so the workshop starts there. For an application with a customer portal, an API and a database, the diagram usually fits on one page. When it does not, split the system into several models by domain rather than drawing everything at once.

The diagram should show the system as it is or will be, not as you wish it were. A forgotten integration with a reporting system or a manual export to a spreadsheet is a typical place where data slips out of control.

How to run the workshop

  1. Scope. Pick one feature or change, for example a new API for partners. Modeling the whole system at once ends in generalities.
  2. People. The tech lead, two people who write the code for this feature, a tester and someone who knows the data and the business process. The security person facilitates but does not need to know every answer.
  3. Diagram. The team draws the DFD on a whiteboard or in a tool such as OWASP Threat Dragon or the Microsoft Threat Modeling Tool.
  4. STRIDE questions. For every process and every flow across a trust boundary, the team walks through all six categories. Questions are concrete: “does the payment service check who is calling it?”, not “is there spoofing here?”.
  5. Decision. Each threat gets one decision: mitigate (add a control), eliminate (change the design, for example stop storing the data at all), transfer (to a vendor or insurance) or accept with the risk owner's sign-off.
  6. Record. Threats to mitigate go into the backlog as tasks with an acceptance criterion, for example “a call without a token returns 401, tested in CI”.

Keep a workshop for one feature to one or two hours. Long sessions lose momentum, so two short ones beat a full day.

The threat model in the development lifecycle

A model is not a document for the drawer. It lives with the architecture:

  • update it with every change that adds a trust boundary, a new store of personal data or a new integration;
  • turn threats into test cases: the tester and pentester get the “what can go wrong” list and check that the controls work;
  • link it to the OWASP Top 10: elevation of privilege usually maps to access control, as covered in the article on the OWASP Top 10 for development teams;
  • automated tests in CI check some of the controls with every change, see the article on SAST, DAST and SCA.

STRIDE is not the only method. The OWASP cheat sheet also lists LINDDUN for privacy threats, PASTA, which connects business objectives with application threats, and OCTAVE for organization-wide risk. For applications built on language models, add the threats from the OWASP list described in the article on LLM application security next to STRIDE. How a threat model shapes test scope is shown in the case of penetration testing a SaaS platform.

Questions and answers

When should you do threat modeling?

Ideally at the design stage of a new feature or integration, before the team writes code. The second good moment is an architecture change: a new trust boundary, moving a service to the cloud, a new partner with API access. In an existing system with no model, start with the most exposed part, such as login and payments, and add the rest with later changes.

Who should run threat modeling in a team?

A security engineer or a trained tech lead can facilitate, but knowledge of the system has to come from the team. Developers know the flows and the shortcuts in the code, the tester knows the edge cases and the business person knows which data and operations matter most. A model prepared by one person without the team usually misses integrations and manual processes.

Does threat modeling replace a penetration test?

No. A threat model finds flaws in the design, while a penetration test checks whether the finished system can be attacked. They work best together: the threat list helps set the test scope, and the test results show which assumptions in the model were wrong. After the test, update the model with what the pentester found.

Which threat modeling tools are worth knowing?

A whiteboard and a photo of the diagram are enough to start. Popular free tools include the Microsoft Threat Modeling Tool, which suggests STRIDE threats for diagram elements, and OWASP Threat Dragon, an open source project that runs in the browser and on the desktop. More important than the tool is that the output lands in the backlog as tasks.

What it looks like in a project

Want to check your application's security? Talk to an engineer.

Let's talk

Read more: Security