Skip to content
cloudgrip

$ man threat-modeling

//Application security

What is threat modeling?

Threat modeling is a structured way to work out how a system could be attacked, and what to do about it, ideally before the code is written.

  • Application security
  • 4 min read
  • updated Nov 11, 2026

The short version

Threat modeling is a structured discussion about what could go wrong with a system and how to prevent it. A team looks at a design, asks how someone could abuse it and decides which protections to build. It works best early, because a design flaw found on a whiteboard costs almost nothing to fix compared with one found in production.

What threat modeling is

Threat modeling is thinking like an attacker about your own design, in an organized way. It targets a class of problem that code scanners cannot find: decisions that are wrong before any code exists. Examples include a service that trusts every request from inside the network, an API that takes the customer ID from the request body and not from the session, or an admin function reachable from the public internet.

A widely used starting point is a set of four questions, popularized by Adam Shostack and the Threat Modeling Manifesto:

  1. What are we working on?
  2. What can go wrong?
  3. What are we going to do about it?
  4. Did we do a good job?

How it works

A session usually runs in four steps that mirror the questions.

Draw the system. Sketch the components, the data that moves between them and where sensitive data is stored. Mark the trust boundaries, which are the lines where data passes between parts with different levels of trust, such as from a browser to your API or from your service to a third party.

Find the threats. Walk through each data flow and boundary with a prompt list. The best known is STRIDE, created at Microsoft. Each letter is a category of threat.

Category What it means Example
Spoofing Pretending to be someone else Logging in with a forged token
Tampering Changing data without permission Editing the price in a checkout request
Repudiation Denying an action, with no proof either way No audit log of who approved a refund
Information disclosure Seeing data you should not see Reading another tenant's invoice by changing an ID
Denial of service Making the system unavailable An unauthenticated endpoint that runs an expensive query
Elevation of privilege Gaining rights you should not have A normal user calling an admin-only function

Other methods include attack trees, PASTA and, for privacy threats, LINDDUN.

Decide what to do. For each threat, choose to fix it, reduce it, hand the risk to someone else or accept it. Write the decision down, with an owner.

Check the work. Confirm that the mitigations were built and that they hold.

Do this whenever a design changes in a way that matters, such as a new integration or a change to authentication. A short session for one feature beats a large annual review of everything. It is one of the earliest forms of shift left security.

Where it falls short

Threat models fail in predictable ways.

  • They go stale. The diagram shows the architecture from last year. The system has moved on and the model was never updated.
  • Quality depends on who is in the room. A session needs both security knowledge and the engineers who built the system.
  • Mitigations are assumed, not tested. A threat is marked as handled because a control was planned. Nobody checks that the control was built correctly.
  • It is only a prediction. A model lists what the team thought of. Real attackers are not limited to that list.

The answer to untested assumptions is testing. A threat model says where the risk should be. A penetration test shows whether the defenses hold there.

How Cloudgrip helps

Cloudgrip does not produce threat models. It tests the assumptions a model leaves behind.

Hydra agents attack your web apps, APIs and cloud with your test logins, and with read access to a repository they also look at the code. If your model says tenants are isolated or that only administrators can issue refunds, the agents try to break exactly that, and report only what reproduces from a clean session. Tests can run on every release.

FAQ

When should threat modeling happen?

During design, before code is written, and again whenever the design changes in a meaningful way.

Who should take part?

The engineers building the feature, someone with security knowledge and someone who understands the business use. A small group works better than a large one.

How is threat modeling different from penetration testing?

Threat modeling predicts what could go wrong from the design. Penetration testing attacks the built system to find what actually does go wrong. Each informs the other.

See what an attacker would find.

Give us a URL and two test logins. If there’s something to find, your first exploited findings land within 24 hours.

You talk to the people who build Hydra and Cerberus. No sales script.

or write to founders@cloudgrip.ai