What Is Threat Modeling? A Practical Introduction to Secure Software
Most security vulnerabilities that make it to production are not sophisticated zero-days. They often come from assumptions nobody stopped to question: that an API would only ever be called by the mobile app, that an admin panel would never be exposed to the internet, or that session tokens would expire when they were supposed to. These gaps are cheap to fix during design, much more expensive to fix after launch, and potentially catastrophic after a breach.
Threat modeling is the discipline of asking those questions early, systematically, and on paper. This article breaks down what threat modeling actually involves, compares the three methodologies worth knowing, and shows how to build it into your development lifecycle without grinding delivery to a halt.
Why security by design starts with threat modeling
Threat modeling is the practice of systematically identifying threats to a system, evaluating their risk, and defining countermeasures, done early enough in the lifecycle that the countermeasures are design decisions rather than patches. It makes proactive security a repeatable process rather than something that depends on having the right person in the room.
Security teams in most enterprises are outnumbered, with perhaps one security engineer for every ten to twenty developers, or sometimes worse. That team cannot review every pull request, sit in every architecture meeting, or audit every microservice. So the default approach becomes reactive. This means penetration tests happen before launch, vulnerability scans occur on a schedule, and incident response kicks in when something breaks.
The problem is that reactive security consistently misses design-level flaws. A pen test might catch a missing authorization check on an endpoint, but it will not catch that the entire authorization model is wrong because nobody mapped out which roles should access which data flows in the first place.
Threat modeling flips this. It is a structured exercise, conducted during design, where teams decompose a system, identify what could go wrong, and decide what to do about it before writing code. The output is a set of security requirements that feed directly into development.
The concept of “secure by design” gets used loosely, but threat modeling is what gives it teeth. Without a concrete process for surfacing risks during architecture and design, “secure by design” is a policy statement with no mechanism behind it.
The business case for threat modeling
The cost argument for threat modeling is that fixing a security flaw in design costs a fraction of fixing it in production. IBM and NIST have published variations of this finding for decades, and the multiplier ranges from 6x to 100x depending on the study and the severity. It is always cheaper to find problems earlier.
But cost avoidance is only part of the story. Here is what we see when threat modeling is integrated into the software development lifecycle:
1
Fewer late-stage surprises
When threats are identified during design, security reviews before release become confirmations rather than discovery sessions. Teams stop finding architectural flaws at the worst possible moment.
2
Faster compliance cycles
Regulatory frameworks like PCI DSS, HIPAA, and SOC 2 require evidence that security risks have been identified and addressed. A threat model is exactly that evidence. Teams that maintain threat models spend less time scrambling to produce documentation for auditors.
3
Better developer awareness
Engineers who participate in threat modeling sessions start thinking about security in their daily work. They write more defensive code and ask better questions in code reviews. This scales security knowledge in a way that hiring more security staff cannot.
4
Reduced rework
In rapid development cycles, security findings that arrive late force teams to rearchitect components they thought were done. Threat modeling moves those findings to a point where changes are still inexpensive. You integrate security into rapid development without slowing it down by building security thinking into the design phase that is already happening.
The risk management argument is simple. Every digital product has an attack surface. You can map it intentionally, or you can let attackers map it for you, but only one option comes with a plan.
A four-step approach to the threat modeling process
There are different ways to structure threat modeling, but most approaches come down to four core activities. Here is how we approach them.
1
Decompose the system
Start by diagramming what you are building. Data flow diagrams are useful here because they show how information moves through the system: where it enters, where it is stored, where it goes, and where it crosses trust boundaries.
A trust boundary might be the line between your mobile app and API, for example, or between your application and a third-party payment provider.
Identify the assets worth protecting, from user credentials and financial data to health records, session tokens, and API keys. Then map the entry points, like login forms, API endpoints, file upload mechanisms, and webhook receivers.
The goal is to build a shared understanding of the system that is detailed enough to reason about potential threats. If your team cannot agree on how data flows through the system, that disagreement is a finding in itself.
2
Identify threats
With the system mapped, walk through each component and ask what could go wrong in every one. This is where frameworks like STRIDE provide structure. Without a framework, brainstorming sessions tend to fixate on familiar risks and miss entire categories.
For each data flow, trust boundary, and data store, ask who might attack them, how, and what they would gain. The output is a list of specific threat scenarios rather than abstract risks.
3
Rate and prioritize
Not every threat deserves the same response. A threat that requires physical access to a server and yields low-value data is different from one that can be exploited remotely and exposes financial records.
Rate each threat based on factors such as likelihood and impact. Some teams use formal scoring systems, such as DREAD, while others use a simple high/medium/low matrix. The method matters less than the outcome: a prioritized list that tells your team where to focus.
This is where threat modeling connects to risk management. You are making explicit decisions about which risks to mitigate, which to accept, and which to transfer. Those decisions should be documented and reviewed rather than left to assumption.
4
Define countermeasures
For each prioritized threat, specify what you will do about it. Countermeasures are concrete, like enforcing TLS 1.3 on all API communication, implementing rate limiting on the login endpoint, adding input validation on the file upload service, and requiring multi-factor authentication for admin roles.
These countermeasures become security requirements in your backlog. They are estimated, prioritized, and tracked like any other work item. This is the bridge between threat modeling as an exercise and threat modeling as something that actually makes the software more secure.
Comparing methodologies: STRIDE, PASTA, and DREAD
Three frameworks come up often in threat modeling: STRIDE, PASTA, and DREAD. Each serves a different purpose, and choosing between them depends on your context.
1
STRIDE
Developed at Microsoft, STRIDE is a threat classification model that organizes threats into six categories:
- Spoofing (pretending to be someone else)
- Tampering (modifying data or code)
- Repudiation (denying an action occurred)
- Information Disclosure (exposing data to unauthorized parties)
- Denial of Service (making a system unavailable)
- Elevation of Privilege (gaining unauthorized access levels)
Strengths: STRIDE is intuitive for developers. It maps neatly to data flow diagrams, and each category suggests specific types of controls. It is the most widely taught methodology and has extensive documentation, including from OWASP.
Weaknesses: STRIDE identifies threats but does not prioritize them. It tells you what could go wrong, not how likely it is or how much you should care. Teams that stop at STRIDE end up with long lists of threats and no clear way to allocate resources.
Best for: Teams new to threat modeling who need a structured way to identify threats during design reviews.
2
PASTA
The Process for Attack Simulation and Threat Analysis is a seven-stage, risk-centric methodology. It starts with business objectives and works through:
- Technical scope
- Application decomposition
- Threat analysis
- Vulnerability analysis
- Attack modeling
- Risk and impact analysis
Strengths: PASTA connects threats directly to business impact, which makes its outputs more actionable for leadership. It considers the attacker perspective through attack simulation, producing findings that reflect real-world risk rather than theoretical possibilities.
Weaknesses: The seven-stage process requires more time, expertise, and organizational buy-in than STRIDE. For smaller applications or fast-moving teams, the overhead can outweigh the benefit.
Best for: Enterprises building high-value systems (financial platforms, healthcare applications) where the cost of a breach justifies a thorough, business-aligned analysis.
3
DREAD
DREAD is a risk-rating model, not a threat-identification framework. It scores threats on five dimensions:
- Damage potential
- Reproducibility
- Exploitability
- Affected users
- Discoverability
Each dimension gets a score, producing an overall risk rating.
Strengths: It provides a quantitative (or semi-quantitative) way to prioritize threats, which is exactly what STRIDE lacks. Teams can use DREAD scores to justify resource allocation decisions.
Weaknesses: The scoring is subjective. Two people rating the same threat often arrive at different numbers. Microsoft itself moved away from DREAD internally because of this inconsistency. It also does not help you identify threats in the first place.
Best for: Using as a complement to STRIDE or another identification framework. Pair STRIDE for identification with DREAD for prioritization, and you cover both gaps.
In practice, most mature teams combine approaches. Use STRIDE to systematically identify threats, apply DREAD or a similar rating system to prioritize, and adopt elements of PASTA’s business alignment when the stakes warrant it.
What to expect from a threat modeling engagement
Consider the scenario that your team is building a patient portal that integrates with three different EHR systems. Six weeks before launch, a security review reveals that the integration layer passes unencrypted patient identifiers across trust boundaries. Fixing it requires rearchitecting the integration service. The launch slips by two months.
A threat modeling engagement at the start of design would have caught this in a whiteboard session.
So what does that engagement actually look like?
Inputs you will need to provide
- Architecture diagrams (even rough ones)
- User stories or functional requirements
- Information about the data being processed
- Access to the engineers and architects who understand the system
The more context available up front, the more productive the sessions.
What the sessions involve
A typical threat modeling exercise takes two to four working sessions. We sit with your architects and developers, walk through data flow diagrams, and systematically apply a threat identification framework. These sessions are collaborative, not adversarial. The people who designed the system know its quirks and assumptions better than anyone. Our job is to bring a security perspective to that knowledge and challenge assumptions before they become vulnerabilities.
What you get out of it
The result is a documented threat model that includes system diagrams with trust boundaries marked, a catalog of identified threats mapped to specific components, risk ratings for each threat, and recommended countermeasures detailed enough to turn into development tasks. This becomes a living artifact that gets updated as the system changes.
How it fits into your development program
For teams running agile or DevOps workflows, threat modeling does not require a separate waterfall-style phase. At Infinum, we conduct initial threat models during the architecture and design sprint. As new features are added, we run lightweight threat assessments scoped to the change, not the entire system. Automation helps here, as these tools can flag when data flows change or new components are added, triggering a review. But the core activity remains human judgment applied to system design.
Making threat modeling a pillar of your security strategy
Threat modeling connects security strategy to engineering execution. It turns abstract security policies into specific, testable requirements that developers can implement and QA can verify.
The organizations that do this well treat the threat model as a living document. They revisit it when features are added, infrastructure changes, or new integrations are introduced. It is not a one-time exercise that produces a PDF nobody reads.
For teams just starting, the path is to pick a system first, then diagram it, walk through STRIDE, prioritize the findings, and turn countermeasures into development work. The first time will feel slow. But by the third or fourth iteration, it becomes part of how your team thinks about design.
At Infinum, we build threat modeling into our development process because we have seen what happens when it is skipped. We have inherited codebases where security debt consumed more engineering time than feature development, and we’ve seen launches delayed by findings that a two-hour whiteboard session would have caught months earlier.
We hold NCSC CHECK, CREST, and STAR accreditations. We are also a Cyber Essentials and Cyber Essentials Plus certification body and a PCI Qualified Security Assessor company, and are one of the few organizations certified across all levels of the UK MoD’s Defence Cyber Certification scheme. We are also one of only four organizations in the UK authorized by the National Cyber Security Centre to deliver independent cyber resilience testing of connected products and services.
Our team holds recognized certifications including CISSP, CHECK CTL, CHECK CTM, CREST, OSCP, CSTL, and CSTM, and has delivered CSAS-approved red-team engagements.
If you are building digital products that handle sensitive data, whether in finance, healthcare, or another regulated industry, threat modeling can make security part of the design rather than something you have to retrofit later.
If you want to identify security risks before they become expensive problems in production, explore Infinum’s cybersecurity services.
Get in touch
The information above will be stored only for business purposes. Check our Privacy Policy for more info.