Skip to content
ImagineWorld

Threat Modeling Methodologies

node_idnode-book_threat-modeling-best-practices_chapter-01-threat-modeling-methodologies
node_typechapter-node
schema_profileworld.chapter_node.v1
statusactive
entropyhigh
manifoldworld
domainimagineworld.net
authorityinforms
layercorpus
chapter_num1
chapter_titleThreat Modeling Methodologies
governed_byCORPUS
constitutional_citationCONSTITUTION
local graph

Chapter 1 — Threat Modeling Methodologies

Section titled “Chapter 1 — Threat Modeling Methodologies”

Threat modeling is a critical practice for organizations looking to get ahead of potential risks in their applications and systems. It’s not just about identifying vulnerabilities, but about doing so early and making it part of the process, before those weaknesses become real problems. In this chapter, we’ll discuss the fundamentals of threat modeling and explore how it fits into the product development life cycle, and why it’s such an important piece of the larger security puzzle for any organization.

We’ll start by walking through the core concepts that are essential to threat modeling: how to identify and classify assets, threats, vulnerabilities, and risks. These are the building blocks for constructing a solid threat model. You’ll also learn how to define the scope of a model, document critical assumptions, and ensure that nothing slips through the cracks. Along the way, we’ll discuss best practices such as engaging cross-functional teams, using Data Flow Diagrams (DFDs) to map out your system’s architecture, and regularly updating models to keep pace with evolving threats and changes in your system.

The goal of this chapter is to arm you with practical knowledge based on best practices in the industry. By the time you’re done, you’ll know how to identify and mitigate risks early in the development process, document your threat models effectively, and use proven methodologies that make a real difference. We’ll also cover how to avoid the most common mistakes that can derail threat modeling efforts and how to make it an ongoing, iterative part of your security practices. To wrap things up, we’ll look at an example to show how these concepts work in action, giving you a roadmap for integrating threat modeling into your organization’s overall security strategy.

In this chapter, we’re going to cover the following main topics:

  • Understanding threat modeling
  • Essential elements of threat modeling
  • Scope and assumptions in threat modeling
  • Best practices in performing threat modeling
  • Avoiding mistakes while threat modeling
  • Example: Threat modeling financial system workflow

I’ve worked in many organizations over the years and have been involved with the delivery of some threat modeling process or program at most of these organizations. And I’m here to tell you that many of them failed. Not because there was no willingness or need for them, but simply because driving a threat modeling process in an organization can be daunting. It can be no less challenging than rolling out a new security tool, with all the integrations, arm-twisting, and repeated meetings to justify its needs. Threat modeling is a foundation, some may even say a table stake, to delivering secure architecture in an organization. Whether it’s a new product for clients, a new third-party system integration, or a new, recently established technology, threat modeling is crucial to the identification of potential threats to an organization.

So, why do so many organizations find it either challenging or impossible to integrate threat modeling? Well, we haven’t exactly made it easy, and it is very difficult to scale. Conventional wisdom tells you, and I will too, that a proper threat model takes time, effort, a lot of understanding of the system, and time. Did I mention time? We’ve become accustomed to drift detection and automation, infrastructure as code, DevOps, and code pipelines that deliver code in minutes. When the security wizard comes down from the ivory tower and says that they need several weeks, a mountain of documentation, and the time of the best technological people in the team, they’re going to get pushed away.

But security has evolved along with technology, at least in many areas. We can identify threats in newer, faster ways, and even integrate identification into existing processes. This book will hopefully provide some good guidance on how to achieve threat identification using the best practices that balance speed and thoroughness.

If you had to provide an elevator pitch of what threat modeling is, it may go something like this:

Imagine building a shed outside your house. You’ve assembled all the workers and the materials, and you’ve plotted out the timeline for how long it will take. You’ve determined how the electricity will run to the shed. The lights, windows, doors, and all the materials have been delivered. You have all the parts you need. You and the workers begin to assemble the shed. You make some cuts in the materials, you place them together, you drive in the screws, and you nail the shingles on the roof. You and your workers stand back and look at the shed with pride. It works, and it’s standing tall! You begin to move in your yard equipment and tools. It’s now a working, usable shed.

Great, so what’s wrong with that? Aside from it being too close to dead trees, built on top of unstable ground, and using hazardous material, nothing. If only you had the ability to know these things before you placed the first order for materials and drove in the first screw. The best part? You could have.

At its core, threat modeling is a systematic and structured approach aimed at identifying, assessing, and mitigating security threats and vulnerabilities within systems and processes. This methodology serves as a comprehensive process that enables organizations to understand the security landscape surrounding their assets, thereby facilitating the development of informed security strategies. In essence, threat modeling involves an examination of a system’s design and architecture to identify potential threats, evaluate their impact, and determine the appropriate countermeasures.

Put plainly, threat modeling is a way of identifying threats, identifying countermeasures, and determining whether the countermeasures work in an architecture.

When threat modeling, we typically ask these four basic questions:

  • What are we building?
  • What can go wrong?
  • What are we going to do about it?
  • Did we do a good job?

These questions, first introduced more than a decade ago by Adam Shostack, an industry expert on threat modeling, are designed to be simple yet powerful, enabling teams to apply threat modeling across any phase of a system’s life cycle. And to be clear, we do this daily in our lives. Whether we are choosing our commute to work, deciding where to go for an outing, or building a shed, our minds ask these questions regularly and usually subliminally.

But deciding where to go for dinner can be far less complex than building technical architecture that consumes and maintains sensitive data from users while also transmitting it to third parties while hosting the data in an adversarial nation state, or a system that observes critical telemetry from instrumentation in a cyberphysical system.

Threat modeling is more than just a checkbox exercise. Many organizations threat model because there is a contractual or regulatory requirement to do so. Thus, it is a check-the-box activity where the threat model is created and never sees the light of day unless requested by an auditor or client. However, at its best, a threat model is a living, breathing part of the system development ecosystem and processes. For the engineering teams, it provides some level of confidence that their design is secure and provides a map of the security implications integrated into our design choices. Additionally, it becomes an essential part of the system-level technical documentation that evolves with the application rather than an addendum that gathers dust.

Threat models benefit teams that depend on shared components too.

Shared components, such as logging libraries or data collection sensors, are often built by third parties and implemented across a sprawling system.

If you think that your system doesn’t use shared components, you’re wrong. I don’t even know your system, but I know that’s wrong. You can write your own RTOS running inside your own designed system, and you still will need to rely on silicon and hardware that is not yours. Our technical world today is a tapestry of interconnected parts, some or many of which are black boxes to us.

The benefit of threat models that identify threats in shared components is that teams can leverage the findings in the threat model to address issues across a sprawling system, essentially utilizing someone else’s map to gauge their own exposure. Penetration testers will have a head start in their efforts. While penetration testers utilize automated tools, scripts, and intuition, a threat model can provide a quick view of the potential “hot spots” in the design, allowing them to focus their efforts where vulnerabilities are most likely prevalent.

Clients may ask for a high-level report of your threat modeling process and, likely, a few example threat models. This helps build trust between the organization and their clients and is more than just compliance. Exchanging this type of knowledge between an organization and their clients inspires the clients with the confidence that their data and their business are in secure hands. It’s a sign of responsible stewardship of the risks, which is particularly meaningful when dealing with regulated industries or high-value partnerships.

Not to overstate the significance and power of threat modeling, but it has the ability to bring people together: engineers, architects, operations personnel, security folks, and product owners. It isn’t just a security person’s exercise; it’s a collective effort, requiring diverse expertise. When you’re evaluating potential threats, the developer might know what could go wrong in the code, the architect might understand system-level implications, while the product owner keeps everyone aware of what matters most to the business. Everyone gets a seat at the table where all these different viewpoints collide and coalesce into a comprehensive understanding of risk.

Of course, there’s a balance to strike here. Too many voices can lead to chaos; too few, and you miss nuance. When performing a manual type of threat model (more on this later), having an appropriate team size hits the sweet spot, providing enough insight into the essential angles, but not so large that the effort spirals into never-ending discussions. Ultimately, it’s about having the right people involved to see the full picture, without turning it into an exercise in herding cats.

Threat modeling is a practice that can, at its best, guide design decisions, influence how teams approach their work, and instill a proactive culture. It’s not the magic bullet that fixes all security woes, but it gives everyone in the organization the lens to see, maybe even predict, the storm before it arrives. When you can see the storm coming, you can be ready for it, and that makes all the difference.

All of this sounds fantastic, and an excellent way of capturing threats early in the process of designing. So why doesn’t everyone threat model? For one, it is very difficult to scale a threat modeling process across an organization, especially large and complex ones with silos and varying cultures. I come from a background of hardware, software, and IT. Every one of those environments and industries has different approaches to their methods of design and development. Building an Industrial Control System (ICS) in a town’s water treatment system is vastly different from a payment card processing application that sits between a bank and an e-commerce site.

What this means is that there is no one-size-fits-all when it comes to threat modeling, and perhaps more importantly, there are different timelines and deliverables. In a slower design and development process, threat modeling can work more efficiently. Consider a large ICS project that is used in a new power plant. The timeline could be months or years until there is a functioning solution. This provides ample time for the engineering team to consider all the various threats to that system, such as supply chain, insider, and physical security threats. However, many software application features go from ideation to production within days. Documentation can be scattered or non-existent, and the threats can be opaque.

This doesn’t mean that the threats are any less or more prevalent in one scenario over the other. It just means that the available time and effort to threat model has its own unique challenges in each scenario. The good news is that we’ll be covering best practices for mature threat modeling in an organization throughout this book!

Threat modeling operates on a deceptively simple foundation built from four interconnected concepts. We’ll start by understanding the relationships between assets, threats, vulnerabilities, and risk, and how they determine whether your threat modeling exercises produce actionable security controls or documentation that collects dust. These elements form the basic framework that transforms security concerns into defensive strategies, but only when each component is well understood and applied in a threat modeling practice.

Assets are at the heart of everything we do in threat modeling. These aren’t just physical items such as servers and sensors but also include the data, the people, and the organization as a whole. Assets are the intellectual property that keeps your company ahead of competitors, sensitive user data entrusted to you by clients, or even the software itself that runs the business. Intangible assets such as user trust and market share are also a part of this. A breach of data security isn’t just a technical failure; it’s a betrayal of the trust that the users place in your systems and a potential opening for a competitor. Whether it’s customer credit card numbers, trade secrets, or the stability of a critical web service, assets are the pieces we can’t afford to lose.

Assets serve multiple functions, and understanding why an asset is valuable can significantly shape how we approach protecting it. In general, there are three primary functions of assets: holding value, producing value, and providing access to value. Each of these functions requires a different lens when considering how to secure them and the consequences of their compromise.

First, assets can be valuable because they hold value. Sensitive data, such as customer information, intellectual property, or even the private keys used in encryption, is the type of asset that inherently possesses value. A database of customer credit card numbers is inherently valuable, and losing control over this asset directly impacts trust and could result in regulatory penalties or financial losses depending on the industry that the organization is part of.

Assets are also valuable because they produce value. These are the systems and components that, while not necessarily valuable on their own, enable the organization to generate value. Think of a production line in a factory or the backend system of an e-commerce site. The value comes from what they enable: continuous operation, revenue generation, and customer engagement. For example, an e-commerce platform is the engine that produces sales and keeps the business running for an organization. If that asset is compromised or made unavailable for a period of time, production stops, and so does the revenue.

Finally, assets can be valuable because they provide access to value. This is where things get a bit more nuanced. An asset such as an API key or an admin account may not hold direct value, but it can provide access to other valuable systems. Consider an administrator’s credentials for a critical server. If those credentials are compromised, an attacker could access sensitive data, alter the organization’s systems, or further move within a system.

In 2021, a security company called Verkada was breached after hackers gained access to customer data, including over 150,000 security cameras inside sensitive locations. They exploited an admin password that had been leaked online through a misconfigured customer support server. Verkada agreed to pay $2.95 million in a settlement with the FTC. Additionally, the company was required to develop and implement a comprehensive security program, including regular assessments by both its IT team and independent third parties, as well as employee training on data security post-breach. Verkada is also prohibited from misrepresenting its privacy and security practices. For the next 20 years, they must report any cybersecurity incidents to the FTC within 10 days of notifying another U.S. government entity.

Each type of asset requires its own strategy for protection, and understanding these functions helps us decide how to prioritize security efforts. Furthermore, each organization will prioritize their efforts based on what is most important to them. In some cases, protecting assets that produce value may outweigh the protection of assets that hold value, such as in the case of an assembly line, where downtime can have huge impacts on the bottom line of the organization.

When we look to build defenses and controls to protect our assets, we need to consider the threats that are relevant to them. Threats are potential events or actions that can reduce the value of an asset. Threats could be a malicious attacker, but they could just as easily be a natural disaster such as a flood, or even something mundane such as human error.

An important aspect to consider with threats is that we often know what they can be, but rarely do we know when we might face one, or the full extent of the impact if the threat materializes.

Threats can come in all shapes and sizes, and each organization has their own unique set of threats that they attempt to mitigate. An Information Technology and Operational Technology (IT/OT) system on an offshore oil platform with communication systems that rely on radio and satellite systems, automation and control systems that monitor and adjust the flow of the pumps and compressors, and the local (to the platform) network infrastructure needs to be rugged, redundant, and able to operate in extreme environments. A powerful storm or explosion on the platform can render communications useless and put the lives of the workers at risk. This is a unique threat to the oil platform and one not likely to be faced by a data center in the Midwest U.S. However, oil platforms also share common threats with other technology environments, such as hardware and software failures. While external threats abound in most systems, there is an ever-present threat from insiders within any organization.

Most organizations have at least several individuals with high-level or complete privileges to the single points of failure or critical assets in the organization. While larger technology organizations have reduced this threat through privilege access controls, organizations where technology is not their core competency lack the tools, processes, and oversight needed to block excessive access, especially in cases where a former employee retains access after departing the organization. According to the Cost of Insider Risks Global Report published in 2023 by the Ponemon Institute, the average cost of insider threat incidents has grown from 8.3millionin2018to8.3 million in 2018 to 16.2 million in 2023.

In 2021, Cash App, a popular mobile payment system, determined that a former employee was able to download data on some 8.2 million users in the U.S. Though the former employee left the organisation in late 2022, the user retained their access after the firing and was able to download the information.

The last type of threat that is worth mentioning here is the one related to mistakes or misconfigurations. We don’t often think about these as threats, but to be clear, these are the ones you are more likely to face over something such as a tornado hitting your data center. These threats can be (but are not limited to) the following:

  • Configuration errors: Misconfiguring a system is like leaving your house unlocked while you’re away. Configuration errors are not (usually) about malice; they’re about oversight.
  • Software bugs: Software is a complex set of instructions that gets more complex as the application grows. This means that defects happen, and every defect is a potential door into your system.
  • Human errors: People make mistakes. Someone may enter an incorrect value or make a change to the wrong system, and you will have a problem on your hands.
  • Lack of updates: Skipping security patches is an accumulation of technical debt, and all debt comes due at some point, usually at the worst time.
  • Weak passwords: Shared or weak passwords can lead to compromise, especially when those passwords are used to protect a privileged account such as an administrator.
  • Insufficient backup: Whether it’s a ransomware attack or a system crash, failing to back up your data means you’re caught without a means to recover from an event.

The World Economic Forum has found that while numbers vary from 70–95% (depending on sources and how they classify “human error”), the mistakes and errors are a major threat to IT systems. The key to effective threat modeling is understanding not just what threats exist but how those threats could impact the assets we’re protecting.

Finally, there is risk. Risk in an organization refers to the potential for loss or damage that an organization might face due to a threat taking advantage of vulnerabilities within its systems, applications, or processes. The bottom line is that risk is the likelihood of a security incident occurring and the impact that such an event would have on the organization. Organizational risk can encompass the potential for disruptions to business operations, financial losses, legal penalties, reputational damage, and the loss of sensitive data.

Organizational risk is not limited to technical vulnerabilities but also includes broader business considerations. For instance, the financial sector faces regulatory risks if a security breach results in non-compliance with data protection laws such as the General Data Protection Regulation (GDPR) or Payment Card Industry Data Security Standard (PCI-DSS). Similarly, operational risks arise if a threat disrupts mission-critical services or systems. Reputational risks can be severe if a publicized breach causes customers to lose trust in the organization’s ability to protect their data. Each of these risks has a different potential impact on the organization, which is why threat modeling must take a holistic approach to risk assessment.

Vulnerabilities are weaknesses in an organization’s systems, applications, or processes that can be exploited by threat actors to compromise assets. These weaknesses can exist due to design flaws, coding errors, misconfigurations, or insufficient security controls. While not inherently harmful on their own, vulnerabilities serve as entry points that attackers can leverage to bypass security measures, gain unauthorized access, and potentially disrupt operations or exfiltrate sensitive data. And these attackers know how to leverage tools to automatically discover vulnerabilities or simply wait for a CVE to be released and reverse-engineer the findings. The presence of a vulnerability poses a significant risk to organizations, as attackers continuously evolve their tactics to identify and exploit them.

How do vulnerabilities relate to threat modeling?

Section titled “How do vulnerabilities relate to threat modeling?”

Assets are what we protect. Threats are potential events or actions, such as data breaches or service disruptions, that could exploit vulnerabilities and raise the organization’s risk level. Threat actors, whether internal or external, are the individuals or groups that attempt to carry out those threats by exploiting vulnerabilities to compromise or reduce the value of an asset. A key aspect of this process is understanding the system’s attack surface, which includes all the points where an attacker could interact with the system. This could range from external interfaces such as APIs to internal processes, physical hardware, or even people. While many of the points of entry in the attack surface could be well protected, a single weakness in that attack surface can lead to a compromise. A simple way of thinking of this is locking all the doors of a building but leaving a window open. A burglar is not likely to try to use brute force to enter through a locked door if they can crawl through a window.

Criticality doesn’t always matter when it comes to vulnerability. Often, if not most of the time, attackers will chain several vulnerabilities together to complete a compromise. This is largely why threat modeling does not focus on specific vulnerabilities, but rather higher-level threats and weaknesses in the system. In other words, the lack of a robust patching process and asset management would be considered a threat rather than a single CVE in a third-party library that your application runs.

The impact of vulnerabilities on organizations can be far-reaching. A breach from unmitigated vulnerabilities can lead to regulatory fines, loss of customer trust, and long-term reputational damage. Furthermore, vulnerabilities that are publicly disclosed without timely remediation can be quickly weaponized, as seen with high-profile vulnerabilities such as Log4j (https://logging.apache.org/log4j/2.x/index.html) or Heartbleed (https://heartbleed.com/).

Threat modeling is not intended to identify specific vulnerabilities in architecture; it’s there to help identify the attack surface and the potential impact a threat may have should an attacker take advantage of one. To address this, organizations need to have a robust vulnerability management program and be able to prioritize vulnerabilities with the help of their threat model. A well-documented and validated threat model will help the organization understand where their critical assets are and what controls (or lack of controls) exist in that system. This provides a map for prioritizing vulnerabilities based on their potential impact and the likelihood of exploitation.

These four elements—assets, threats, vulnerabilities, and risk—are the pillars of threat modeling. Understanding them thoroughly sets the stage for everything else that follows. They help us frame our conversations, prioritize our actions, and, ultimately, ensure we’re protecting what matters most. With these foundations in place, we can now move on to building the scaffolding of a threat model.

Creating a threat model means that you need to know what it is that you’re modeling. This includes what’s in your purview, what you have control over, and what your environment looks like. More importantly, you need to consider what security controls already exist in your environment that mitigate possible threats that tie into the overall scope of the model and the assumptions you make.

In threat modeling, assumptions are the beliefs or expectations about the system, environment, users, or adversaries that shape how threats are identified, prioritized, and mitigated. When we do threat modeling, we assume that certain things are in place: a firewall, Multi-Factor Authentication (MFA), and security-versed users of the system. The reality is that those should never be taken for granted as being there and properly configured.

Nonetheless, the process of threat modeling requires defining the scope and clarifying the assumptions related to that particular architecture and model. These key activities set the foundation for the accuracy and effectiveness of the threat model, ensuring that the analysis is both comprehensive and grounded in realistic expectations. Without a clearly defined scope and well-vetted assumptions, threat modeling can become a far more difficult exercise.

The scope establishes the boundaries for what will be evaluated during the threat modeling process. This helps to streamline the threat modeling effort, ensuring that it targets the most critical components of a system, rather than attempting to tackle every conceivable risk to the system.

My simple rule of thumb is that the scope of a threat model should include the items that you can actually change. This doesn’t mean that the things you can’t change should be excluded; they still need to be identified, but an SQL injection in a third-party system that you have no control over is not your problem. However, the threat of an attack that originates from a third party is your problem. This means that it’s still important to highlight the interactions and the input/output with the third party.

Setting scope correctly requires identifying the key assets, systems, and processes that need protection and aligning this with the organization’s risk appetite. When defining the scope of a threat model, it’s essential to consider the following:

  • Assets to be protected: Identify the critical data, systems, or services that require protection.
  • System boundaries: Define where the system starts and ends, from both a technical and operational perspective. This includes the applications, infrastructure, and networks that are within scope.
  • Threat actors: Who are the potential adversaries? These can range from external cybercriminals to insider threats. Understanding their capabilities and motivations is key to realistic threat modeling.
  • Third-party dependencies: Systems today are no longer monolithic. They rely on interaction with other products and applications inside and outside of the organization. Third-party vendors and external systems highlight the split duties and shared responsibility between the organization and other dependencies.
  • Data flows: Map how information moves within and across system boundaries. This includes the transmission of data between components, users, external systems, and third-party services. Understanding data flows helps identify where sensitive information is exposed, transformed, or stored as well as where it may be intercepted, altered, or misused.

One of the biggest challenges with scoping is the concerns around whether you are actually capturing all the relevant information, or whether your scope is so large that the threat model becomes unwieldy and difficult to understand. The good news is that threat models are living documents. They are intended to be updated and modified as you progress through the exercise. Much like the architecture of a product changes over time, so will your threat model.

Assumptions in threat modeling represent something that is thought to be true but needs to be validated. Often, not all facts or details about the system are immediately available or even locked down in the architecture when the threat model is being created.

You will likely assume that you have a network firewall that all TCP/IP traffic goes through. However, in the early stages of the architecture and subsequent threat model, you may not know the exact configuration of that firewall. You may not even know the vendor or type of firewall if this is a new application or deployment. This means you likely will not know the DDoS protection offering, or whether there is an allow list/deny list for certain IPs. You can (and should) point this out in your threat model, but you will need to assume basic security controls and validate them in the future.

Assumptions help the threat model continue while you have placeholders for what may not be completely known. To be clear, you are likely to make assumptions about almost everything in the threat model as you create it. You are going based off of what is being provided by the engineering and architecture team. Until we have a world where threat models are generated from a live environment, you are going to have to make assumptions.

As a general rule, there are a few common assumptions that should be avoided in any threat modeling exercise:

  • Security of the environment: Don’t assume that the system is inherently secure because security tools or policies are in place. Many breaches occur due to overlooked configurations or outdated security controls.
  • Reliability of resources: Assumptions that systems, storage, or network resources will always be available or perform optimally can be misleading. Hardware can fail, and network outages can occur. These factors should be considered, especially when modeling potential system disruptions or downtime.
  • Correct configuration: Misconfigurations are a leading cause of security incidents. It’s a mistake to assume that all systems are properly configured. This applies both to security controls and the operational environment.

You may also make assumptions that certain risks or attack vectors are improbable, such as scenarios where attackers would need to have special access or certain conditions would need to occur for a threat to materialize. While these factors may reduce the likelihood of an attack, it’s essential to document and analyze these risks instead of dismissing them outright.

Avoiding distractions: Don’t dismiss low-probability risks

One of the common pitfalls in threat modeling is dismissing certain risks too quickly due to their perceived low probability. Phrases such as “The attacker would need to bypass the firewall and gain internal network access” or “This threat is only possible under very specific conditions” can lead to the assumption that the risk isn’t worth considering. However, this mindset can create blind spots in the threat model.

As experience shows, even low-probability events can have significant impacts, and attackers often find creative ways to exploit seemingly low-risk scenarios. But not only that, any good architecture will show what was and was not decided, so that you do not have to revisit a question that was simply not documented. Documenting assumptions is a critical component of an effective threat model, allowing it to become a living document that adapts as new information becomes available, ultimately enhancing its accuracy and reliability.

Establishing the right scope and properly documenting assumptions provides the threat modeler and the team with a dynamic process that adapts as you gather more information, leading to actionable insights and a more resilient security posture for the organization.

Best practices in performing threat modeling

Section titled “Best practices in performing threat modeling”

We’ve covered some of the basics of threat modeling, but there are some high-level best practices to keep in mind as well. These will serve you well as you embark on creating threat models in your organization.

Have you ever walked down a street at night, alone, in the dark, and thought to yourself that you should maybe quicken your pace or “keep your head on a swivel” (in other words, pay attention)? Would you have that same reaction walking that same street in the daylight? With a crowd of people? Likely not. The purpose of raising this scenario is to illustrate how we, whether we think about it or not, threat model on a daily basis. It’s in our nature to ensure our survival by occasionally thinking the worst and then formulating a plan to deal with it. Sometimes, at least in the physical world, we rely on our instincts. In the digital world, we need to build those instincts and get some support by writing out our threat model.

As a reminder, threat modeling, at its core, is asking four basic questions:

  • What are we building?
  • What can go wrong?
  • What can we do about it?
  • Did we do a good job?

These four questions are referred as the Shostack Four Question Framework and is considered a “threat modelling mindset”. While our minds handle this for us quickly when we feel like we might be entering a physically dangerous situation, we need to take a few more steps when it comes to a system threat model.

The threat modeling mindset can be applied while a designer or engineer is sitting in their design/development environment creating something new or iterating on an existing idea.

“What am I building?” should be asked broadly about what the end product will look like, who will use it, and what its purpose is. Are you building an application that will be accessed by thousands of anonymous users every day, or are you building a hardware sensor that will be deployed to a remote field?

“What can go wrong?” will require some thinking with a bit of imagination and without considering the controls and mitigations that are in place (that comes later). So, think about the users, the threat actors, and the environments that your product will operate in. What type of access will users and actors have to your product? Is your product being deployed in an area prone to natural disasters or power disruptions?

“What can we do about it?” is the part where you get to apply some mental power and research on options to stop the bad things from happening. Likely, it’s going to require as much creativity as the identification of the threats. In some cases, it won’t be as easy as just putting a “blinky box” inline that solves all your problems. What if your product is a sensor that is deployed along a pipeline that runs through rural land? You may have to contend with individuals gaining unmonitored physical access, or even wildlife getting too curious.

“Did we do a good job?” is related to analyzing the effort of identifying not just the threats and mitigations but also the design itself. Is everything captured? Are the assets identified and classified? Did we identify the threats well enough? Did we identify the mitigations and controls? And more importantly, can we (or did we) validate the model?

This last part is important. Validating the model means confirming that your assumptions were correct, that the scope is accurate, and that the controls you defined as in place are actually there. Here are a few methods of validating the model:

  • Review and test: Continuously test and verify the implemented mitigations to ensure they are effective. This can involve penetration testing, code reviews, and security assessments.
  • Stakeholder feedback: Gather feedback from stakeholders, including developers, security teams, and users, to identify any gaps or areas for improvement.
  • Scenario analysis: Conduct scenario analysis to explore different threat scenarios and determine where compromises are most likely.
  • Benchmarking: Compare the threat model against industry standards and best practices to ensure it meets the required security benchmarks.
  • Documentation: Maintain thorough documentation of the threat model, including identified threats, mitigations, and validation results, to facilitate ongoing review and updates.

Once this mindset is established, threat modeling becomes less of an exercise and more ingrained in the daily activity during the life cycle of a product.

When you are sitting down to watch your favorite sport, and you want to invite a few people over to help cheer on your team, you’re likely to invite people who are going to root for the same team. While this is fun and exciting, it’s not providing you with the diversity of thought that is needed when you need to be challenged with your ideas. Your team can do no wrong, and the whole world is against them. At least that is what everyone is likely to think while watching the game.

So, who are the stakeholders? While there is no one-size-fits-all for gathering stakeholders, the exercise should ensure that there is representation from the following groups. Again, mileage may vary depending on your organization’s make-up:

  • Business stakeholders: Provide insights into the business impact and requirements of the application or system
  • System architects: Offer an overview of the system architecture and how different components interact
  • Software developers: Contribute code-specific details, such as frameworks used and coding guidelines
  • Security experts: Identify potential threats and recommend mitigations and current security controls
  • Development and Operations (DevOps) team: Provide details on the application, servers, and network configurations
  • Project managers: Help with resource management and ensuring the threat modeling process aligns with project timelines

Having this group together to help create a robust threat model provides you with outcomes and benefits that are likely to mature the relationship between security and its counterparts in the organization. These may include the following.

  • Diverse perspectives lead to comprehensive coverage: Different stakeholders bring unique knowledge and insights to the table. For example, developers understand how the system is built, while security professionals know how attackers might exploit it. Business stakeholders are familiar with the organization’s objectives and the critical assets that need protection. Together, they provide a more complete view of the potential risks across all aspects of the system.
  • Alignment with business goals: Business stakeholders play a key role in aligning the threats and mitigations with the organization’s objectives and business risk. They understand which assets are most valuable and which risks would have the greatest impact on business operations. Involving them ensures that the security controls and mitigations proposed are in line with business priorities and risk tolerance.

Who owns risk?

You may be surprised to learn that it’s not security that owns the risk. In most organizations, the security is there to highlight the risk, provide remediation or mitigations, and put in place technical controls to reduce the risk. However, “the business” is the risk owner in most organizations. This means an executive leader, a department head, or a product or program owner.

  • Informed decision-making and trade-offs: Security is often a balance between risk management and business requirements. Developers may need to make trade-offs between security and performance, and business leaders need to weigh security risks against cost and time to market (which in and of themselves are risks to the business). By involving all stakeholders, teams can make informed decisions on where to apply security resources without unnecessarily hindering business goals or system performance.
  • Ownership and accountability: When the right stakeholders are involved, accountability for security becomes shared across the organization. Security is no longer seen as the sole responsibility of the security team, but a collective effort. Developers, business leaders, and operations teams all take ownership of their role in securing the system, leading to a more integrated and sustainable security approach. Additionally, this provides insight into each other’s challenges and priorities.
  • Realistic threat scenarios: Stakeholders from different departments help ensure that the threat model is grounded in reality. For example, operations teams can provide details about how systems are deployed and maintained, while business stakeholders can clarify how certain attacks would affect daily operations (remember the assumptions we talked about previously). This makes the threat model more practical and actionable, rather than being based solely on assumptions.
  • Improved buy-in for security initiatives: When stakeholders are part of the threat modeling process, they are more likely to support and implement the resulting security recommendations. Early involvement helps reduce resistance to security measures, as teams better understand the rationale behind them. This leads to smoother execution of security initiatives and a stronger overall security culture.

Threat modeling is not a one-time exercise. It’s a continuous process that should evolve alongside your product and your understanding of its risks.

Best practice

You’ll know that your threat modeling processes have reached a mature level when you are able to trigger a reassess of the threat model every time there is a design change. This can be done through an existing change control process, or simply through an automated process that hooks into certain design artifact changes (design and architecture documents, or other system artifacts).

For threat modeling to be truly effective, it must be integrated into the design and development life cycle from the very beginning. This means embedding security considerations at the core of your product’s development, not treating them as an afterthought. You may have heard the often overused, and now eyeroll-inducing, term “shift left.” At its core, shift left’s purpose is to identify potential threats and vulnerabilities early, before they become expensive and time-consuming problems when they are wreaking havoc in a production environment.

When threat modeling is integrated into the development life cycle, it becomes part of the team’s DNA. This integration allows security to grow alongside the product, adapting to changes in architecture, features, and infrastructure. At every phase of development, from design through deployment, the teams should not only be asking the “what can go wrong” set of questions but also be ensuring that a formal threat model is being produced for the given change.

Integration alone isn’t enough. Threat modeling needs to be iterative, evolving alongside the systems it represents. As new technologies are adopted, new features are added, or external threats evolve, your understanding of the system will change. What you know today may not be the reality tomorrow, and that’s okay. The key is to build threat modeling as a flexible process that evolves with your product. Every iteration of your product should prompt a revisit of and iteration over the threat model.

Iteration also allows you to refine your threat model as you gain deeper insights into how the system operates and where its weak points are. What you initially thought was a low-risk area might later become a critical point of failure or vice versa. Without a threat model in hand that maps your system, its assets, and the potential weak points, you are likely not to have the context of what the risk truly is as it becomes known.

Finally, even with constant iteration, it’s essential to reassess your threat model on a periodic basis, whether quarterly, annually, or in response to major changes in the environment. Threats come and go, external factors change regularly, and technology changes. All of this can introduce new risks to the organization and change the threat model. A periodic reassessment ensures that your threat model accounts for these evolving risks and provides an opportunity to address any new gaps that may have emerged.

Even with the best intentions, there are several common mistakes and pitfalls that can undermine the effectiveness of a threat modeling process. By being aware of these potential issues, teams can avoid falling into these traps and ensure that their threat models are thorough, actionable, and continuously improving.

One of the most critical mistakes is starting the threat modeling process too late in the development life cycle. Threat modeling should be integrated when the design is first developed so that potential threats are identified and mitigations can be devised before coding begins. When threat modeling is left until the end of development, it often uncovers issues that are deeply embedded in the project and more time-consuming and costly to fix.

Another pitfall is approaching threat modeling without the necessary expertise. This goes beyond having the right stakeholders and focuses more on ensuring that the team has the right insight and expertise to tackle the threat model. Threat modeling requires a solid understanding of both the system architecture and the types of threats that could target it. If the team lacks experience in this area, the model may miss critical vulnerabilities or fail to capture the full range of potential attack vectors.

It’s easy to fall into the trap of assuming that certain risks are too unlikely to consider, or that the system is “secure enough” as it is (see the section on assumptions previously). But overlooking potential threats can leave your system exposed to attacks you didn’t anticipate or had ignored. Attackers are creative and will look for the edge cases or chain several weaknesses together to exploit an organization. The more threats you can anticipate and address, the better your security posture will be.

A threat model is only as good as the ability to communicate and act on it. Inadequate or poor documentation can hinder the effectiveness of the entire process. If the threat model isn’t well documented, it becomes difficult to communicate risks to stakeholders, track follow-up actions, or revisit the model for future iterations. This also extends to the input documentation. Quality architecture documentation is often difficult to come by and can vary from team to team. Clear, detailed documentation ensures that everyone involved has a shared understanding of the risks, the mitigations, and what still needs to be done.

Feedback from stakeholders such as security teams, developers, or business leaders plays a vital role in building a comprehensive threat model. Ignoring or failing to incorporate feedback can lead to blind spots in the model, resulting in missing critical insights that could reveal previously unidentified risks. Effective threat modeling is a collaborative process, and input from all relevant parties helps to ensure that the model covers the full range of potential threats.

As I mentioned, threat models should not be static documents. They are living artifacts that require frequent revisits and updates. Failing to update the threat model regularly to reflect changes in the system, new technologies, or emerging threats can render it obsolete quickly.

Lastly, resource constraints can significantly impact the thoroughness and effectiveness of threat modeling. Often, when an organization is resource-constrained, there is less drive to perform thorough threat models (if at all). Teams often face pressure to deliver results quickly or within tight budgets, which can lead to cutting corners or rushing through the process—and perhaps worst of all, a check-the-box exercise. While these constraints are often a reality, it’s important to recognize that threat modeling is an investment in long-term security.

Understanding these common obstacles to creating meaningful threat models helps organizations get ahead of the threats and prepare to develop threat models that provide real value.

Example: Threat modeling financial system workflow

Section titled “Example: Threat modeling financial system workflow”

This example follows a fictitious company named Centurion Bank & Trust, a financial institution implementing a new online banking system. This demonstrates how systematic security analysis can help the bank identify critical assets, as well as how they can define relevant threat agents, including external cybercriminals and insider threats. This example will show how a structured approach to threat modeling helps organizations achieve improvements in their security posture through application threat modeling.

The fictional bank Centurion Bank & Trust, a leading financial institution, decided to implement a new online banking system to enhance customer experience and streamline operations. The system allows customers to perform transactions, check account balances, and apply for loans through a web interface.

Identify potential security threats and vulnerabilities in the new online banking system and develop mitigation strategies to protect sensitive customer data and ensure system integrity.

First, let’s identify the critical assets that need protection:

  • Customer personal information: Names, addresses, Social Security numbers
  • Account details: Account numbers, balances, transaction history
  • Transaction records: Details of deposits, withdrawals, and transfers
  • Authentication credentials: Usernames, passwords, MFA tokens
  • Hardware assets: Transaction servers, network devices, endpoints, mainframes, ATMs, branch workstations
  • Software assets: Financial modeling, business intelligence, CRM, transaction processing, and deposit and account management

Next, we’ll trace how critical data moves through the system to identify potential attack pathways and vulnerability points:

  • Customer data pathways: Personal information enters through web portal registration, flows through validation services, is stored in customer databases, and connects to transaction systems during banking activities
  • Authentication flow: Login credentials are captured in the web interface, are verified against identity management systems, generate session tokens that accompany all subsequent requests, and integrate with MFA services
  • Transaction processing: Transfer details are collected through the web application, validated by application servers, processed by transaction engines, logged by audit systems, and distributed through notification services to customers
  • Third-party integrations: Data flows to credit verification services during loan applications, fraud detection systems during transactions, compliance reporting for regulatory submissions, and backup systems for disaster recovery

Next, we will identify who might want to compromise the system:

  • External attackers: Individuals or groups attempting unauthorized access for financial gain. For financial systems, the most likely attacker is a cybercriminal.
  • Insiders: Employees or contractors with ill intentions or who make unintentional mistakes.
  • Third-party service providers: External vendors with access to sensitive data or who receive sensitive data.

Now, we will outline potential threats:

  • SQL injection attacks: Malicious code is inserted into SQL queries via web forms to access or manipulate data
  • Cross-Site Scripting (XSS): Attackers inject malicious scripts into web pages viewed by other users
  • Phishing attacks: Deceptive emails or messages tricking internal users into revealing sensitive information
  • Insider threats: Employees accessing or leaking confidential data

Then, we’ll move on to identify weaknesses in the system:

  • Improper input validation: Failing to validate user inputs can lead to SQL injection.
  • Inadequate session management: Poor session handling can allow attackers to hijack sessions.
  • Weak password policies: Allowing weak passwords makes brute-force attacks easier.
  • Lack of encryption: Transmitting data without encryption can lead to interception. Unencrypted data in a database can lead to exposure should the database be compromised.

The next step is to evaluate the potential impact of each threat:

  • Data loss: Compromised data can result in financial loss and legal consequences
  • Financial loss: Fraudulent transactions lead to direct loss of money, impacting the bank’s overall profitability
  • Reputational damage: Breaches can erode customer trust and harm the bank’s reputation
  • Regulatory impact: Compliance and regulatory impacts, such as GDPR, the Bank Secrecy Act (BSA), and PCI-DSS, can lead to fines

Create strategies to address identified threats:

  • Implementing input validation: Use parameterized queries to prevent SQL injection
  • Secure coding practices: Regularly update and audit code to fix vulnerabilities
  • MFA: Require additional authentication factors for user access
  • Regular security audits: Conduct routine security assessments to identify and fix vulnerabilities

Now, put the mitigation strategies into action:

  • Deploy Web Application Firewalls (WAFs): Protect web applications from common attacks
  • Enforce strong password policies: Require complex passwords and regular password changes
  • Encrypt data: Use SSL/TLS to encrypt data in transit and strong encryption algorithms for data at rest

Establish continuous monitoring and periodic review processes:

  • Security Information and Event Management (SIEM): Monitor for suspicious activity in systems through log centralization.
  • Incident response plans: Have a plan in place to respond to security incidents quickly. During an incident is not the time to develop a plan.
  • Regular updates: Keep software and security measures up to date to protect against new threats.

Through this basic threat modeling example, you helped Centurion Bank & Trust identify and address threats and risks to their organization. Implementing the recommended mitigation strategies will significantly reduce the risk of security breaches and enhance the system’s overall security posture. As a bonus, they identified their key assets and their system architecture in the process!

Threat modeling is a critical practice for identifying potential risks in applications and systems early in the development process, allowing organizations to stay ahead of vulnerabilities before they become serious issues. In this chapter, we’ve explored how threat modeling fits into the larger product development life cycle, highlighting its importance as a foundational piece of a strong security strategy.

We’ve covered the essential concepts of threat modeling, including how to identify assets, classify threats, and document assumptions. This chapter emphasized the importance of integrating threat modeling into the design and development process, making it part of a continuous feedback loop as the product evolves. By adopting an iterative approach, organizations can refine their threat models as new information and risks emerge, ensuring they stay aligned with the latest security challenges. Regular reassessment of the threat model is also critical, as it ensures that the organization’s security posture remains strong, even as external threats and internal changes arise.

This chapter equipped you with the knowledge to effectively integrate threat modeling into your workflows, iterate as systems change, and regularly reassess to maintain security resilience. By following best practices and learning to avoid common mistakes, organizations can leverage threat modeling to build secure, scalable systems that evolve alongside their business needs. In the next chapter, we will dive deeper into evaluating risks and threats in a system.

Get This Book’s PDF Version and Exclusive Extras