Reliability and security · L3Threat modelling and zero trust

Threat modelling and zero trust

Find what an attacker would target in your design before you build it, and stop trusting a call just because it comes from inside.

L3 Staff+Reliability and security20 min read
Fact-checked by AI against cited sources · Human review pendingLast reviewed 10 Nov 2026 · How we check content
Section 1 of 8

What broke

On 16 June 2023, the US State Department told Microsoft about strange access to its email. A custom alert on mailbox access logs had fired. 1

Microsoft found that an attacker it calls Storm-0558 was reading mail with forged login tokens. The tokens were signed with a Microsoft consumer account key from 2016. That key was only meant to sign tokens for consumer email, not enterprise mailboxes. It was also meant to be retired in March 2021. 1

The key should never have opened enterprise mail. But Microsoft had built one shared endpoint that listed active signing keys for both consumer and enterprise systems. The libraries that check tokens were not properly updated to tell the two kinds of key apart. So mail accepted a token signed by either kind of key. 1

The attacker reached the mailboxes of 22 organizations and 503 personal accounts. It downloaded about 60,000 emails from the State Department alone. 1 Microsoft still did not know how the key was stolen when the Cyber Safety Review Board finished its review. The Board called the intrusion "preventable". 1

The Board listed several errors. For example, the old key was never removed, and Microsoft did not detect the forged tokens itself. But it found that without the validation flaw, no enterprise customer would have been hit. 1

In our reading, the missing check sat on a trust boundary between consumer and enterprise systems. A threat model asks at each such line: what if a token from the other side shows up here? The Board asked cloud providers to design identity systems "informed by a rigorous threat model". 1

Section 2 of 8

The idea in simple words

A threat model is a structured look at a design to find what could go wrong with its security and privacy. 2 You do it before you build, and you keep doing it as the design changes. 3

It comes down to four questions: 2

  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 enough job?

Zero trust is a related idea. No user, device or service is trusted just because of where it sits on the network. Every request proves who it comes from and gets checked. 5

The key idea. Draw where data crosses from one level of trust to another. Ask what could go wrong at each crossing. Then check identity and permission at every crossing, including the ones inside your own network.

Section 3 of 8

How it works

Draw the system and its trust boundaries

Start with a data flow diagram. OWASP says a useful model shows trust boundaries, data flows, data stores, processes and external entities. These often mark the places attackers aim at. 3

A trust boundary is where data or a call moves between parts you trust differently. Examples: the internet to your API, one tenant to another, a partner's webhook to your code, or a consumer system to an enterprise one.

Step through a small design: an expense app where users upload receipts.

A small threat model: draw the flow, mark trust boundaries, walk STRIDEBrowser API Bucket DB Worker uploadstorereadsave TB1TB2 TB1 · S: fake user, or edited userId I: public bucket · E: evil file in parser ✓ every call proves who it isAPI and worker: own workload identityNo call is trusted for coming from inside SeniorPath
  1. What are we working on? A user uploads a receipt to the API. The API stores the file in a bucket. A worker reads it and saves the totals in the database.
  2. Mark the trust boundaries. TB1: requests arrive from the internet. TB2: the file's content was written by the user, so the worker must treat it as hostile input.
  3. Walk STRIDE where data crosses TB1. Spoofing: a caller pretends to be another user, or the request body names someone else's userId. Take the user from the verified session instead.
  4. Now the bucket and TB2. Information disclosure: the bucket is public, or its links never expire. Elevation of privilege: a crafted file attacks the parser in a worker that holds database admin rights.
  5. Zero trust adds one rule. The API and the worker each prove their own identity, and every call is checked. Being inside the network grants nothing.
Step 1 of 5

Ask what can go wrong: STRIDE

STRIDE is a list of six prompts. Each letter is a kind of threat, and each one breaks a security property. 3

LetterThreatBreaksReceipt app example
SSpoofing: using someone else's identity 4AuthenticationThe body sends another user's userId, or a stolen session uploads.
TTampering: changing data you should not 4IntegrityA user edits an expense total after it was approved.
RRepudiation: denying an action with no proof 4AccountingA user says "I never uploaded that".
IInformation disclosure 4ConfidentialityThe bucket is public, or links never expire.
DDenial of service 4AvailabilityA 2 GB upload fills the worker's disk.
EElevation of privilege 4AuthorizationA crafted PDF exploits the parser, and the worker has database admin rights.

Walk the list at each trust boundary. Spend most time where outside data enters. You will find ideas that are not on the list. That is fine.

Choose what to do

Rank each threat by how likely it is and how bad it would be. OWASP admits both are hard to measure, and that this ranking ignores the work to fix each one. 3 So weigh the cost of the fix too. A simple high, medium or low for each is enough to start.

Then pick one of four responses: 3

  • Mitigate: lower the chance it happens. Lock an expense once it is approved.
  • Eliminate: remove the feature. Maybe you do not need public receipt links at all.
  • Transfer: give the cost to someone else, such as an insurer. This does not make the event less likely or less harmful. 3
  • Accept: write down why, and who agreed.

For the receipt app, a good list is short. Take the user from the verified session, not the body. Keep the bucket private and use links that expire in minutes. Log every upload with the user ID. Limit the file size. Run the parser with no database rights; it hands results to a small writer with insert-only access.

Each fix should be testable. OWASP asks reviewers to check that agreed mitigations can be tested. 3

Keep it lightweight

The manifesto values "people and collaboration" over processes, methodologies and tools. It also values "continuous refinement" over a single delivery. 2 Threat modelling should fit how your team already works, in small steps scoped to the part that changed. 2

In practice: add a "Threats" section to each design doc. Spend 30 minutes with the people who know the design. Turn each decision into a ticket or a test. The fourth question checks the model itself. Does the diagram match the system? Does every threat have a response, and can each fix be tested? 3 Ask it again after launch or after an incident.

Zero trust: what it means

The old model is a castle. Anything inside the wall is trusted. Google's BeyondCorp paper says that once the wall is breached, the attacker has easy access to the internal network. 6

NIST's definition: zero trust "assumes there is no implicit trust granted to assets or user accounts based solely on their physical or network location". 5 Two of its tenets matter most for daily work:

  • Every connection is protected, wherever it comes from. A request from inside must meet the same rules as one from outside. 5
  • Access is granted per session, with least privilege. Access to one resource does not grant access to another. 5

At Google, every internal app sits behind an internet-facing access proxy. It checks the user, their groups, the device certificate and the device's state on every request. 6 In a Google office, a laptop without a valid certificate lands on a network with very limited access. 6

Zero trust for a service team

You probably do not run the access proxy. You run services. For you, zero trust means three habits.

Every caller has an identity. Each workload gets its own identity, proved with a short-lived certificate or token. SPIFFE names workloads with IDs like spiffe://acme.com/billing/payments, and rotates their keys often and automatically. 7 A service mesh can do this for you. See Service mesh and sidecars.

Every request is checked. Verify the caller's credential, then check what it may do. Never trust a header because the call came from inside.

# Wrong: any pod that can reach us can claim to be any user
user_id = request.headers["X-User-Id"]
# Right: verify a signed token for this service, then read the user from it
claims = verify_token(request.headers["Authorization"], audience="receipts-api")
user_id = claims["sub"]

Credentials are short-lived and narrow. Each service gets only the permissions it needs. 5 How to issue and rotate them is in Secrets and key management.

What zero trust does not mean

  • It is not a product. NIST calls it a set of guiding principles. Moving to it is "a journey", not a swap of technology. 5
  • It does not remove the firewall overnight. NIST expects most companies to run a hybrid of zero trust and perimeter controls for an indefinite period. 5
  • It does not stop a valid account. An attacker with real credentials can still reach what that account may reach. Zero trust should stop it from moving further. 5
  • It adds a critical part. If the policy service fails or is attacked, people may not reach anything. Run it in several places. 5
Section 4 of 8

Trade-offs

OptionWhat it catchesCostMain riskUse it when
No threat model, code review onlyBugs in single lines.None up front.No Design flaws, like a missing boundary check, ship.Small changes with no new data flow.
30-minute four-question sessionMany design flaws at trust boundaries.Low. One meeting per design.Shallow if the right people are not there.Every new feature, endpoint or integration.
Full STRIDE per element, with a toolMore threats, written down for audits.High. Days of work.It goes stale if nobody updates it. 3Identity, payments and other high-risk systems.
Network perimeter as the main controlOutsiders who never got in.Low. It already exists.No Once inside, an attacker moves freely. 5Only as one layer among others.
Zero trust: per-request identity and policyStolen access to one part reaching other parts. 5Medium to high. Identity for every workload and device.The policy service becomes critical. 5New systems, and step by step for old ones. 5

Simple rule: threat model every design that adds a trust boundary. Make every service check its caller, whatever network the call comes from.

Section 5 of 8

At work: how a senior uses this

  • In design review, ask: "Where are the trust boundaries, and what checks the data at each one?"
  • Draw the data flow on the whiteboard first. Most missed threats hide in arrows nobody drew.
  • Ask: "What if a valid token from the wrong tenant, environment or system shows up here?" That was the Storm-0558 question.
  • Never accept "it is internal" as a reason to skip authentication. Ask who else can reach that network.
  • Turn each threat into a ticket, a test or a written acceptance with an owner. A list in a doc is not a fix.
  • Revisit the model when the design changes, not on a calendar.
  • Prefer shared libraries for token checks. The Board found that many different token libraries made correct, uniform checks harder. 1
Section 6 of 8

With AI

What to ask the agent

"Here is our design doc. Draw a data flow diagram as a Mermaid chart. Mark every trust boundary and list the data that crosses each one."

"For each trust boundary in this diagram, list STRIDE threats. For each, give likelihood, impact and one concrete mitigation. Mark the ones you are unsure of."

"Search this service for code that reads user or tenant IDs from headers or request bodies without verifying a token. List file and line."

What to check yourself

  • The agent's diagram matches the real system. Check it against your deploy config, not only the doc.
  • Generic threats like "use strong passwords" add noise. Keep only threats tied to a flow in your design.
  • Mitigations name a real place in your code or config. "Add validation" is not a mitigation.
  • Each internal endpoint the agent writes checks the caller's identity, not just its IP address.
  • The agent cannot judge business impact. You decide the ranking with your team.
Section 7 of 8

Check yourself

1. Your team will add a feature where partners send files to a new endpoint. When is the best time for a threat model?

Show answer

In the design review, before the code is written, and again when the design changes. OWASP says threat modelling is ideally done early, in the design phase, and the model is kept up to date as the system changes.

2. In STRIDE, a user edits the total on an expense after a manager approved it. Which category is this?

Show answer

Tampering Tampering is the malicious change of data, here a stored record. The fix is to block edits after approval and log every change.

3. Service A calls service B inside your private network. What does zero trust ask of service B?

Show answer

Check A's identity and authorize the request, the same as for a call from the internet. NIST says network location alone does not imply trust. Inside calls must meet the same security rules as outside calls.

4. You found 12 threats in a design review. Which response does NOT make the event less likely or less harmful?

Show answer

Transfer, for example to an insurer OWASP notes that transferring risk does not itself reduce the likelihood or harmful consequences of an event. It moves the cost to another party.

5. Your company rolled out a zero trust access proxy. An attacker phishes a support engineer's password and second factor. What still holds?

Show answer

The attacker can still use what that account may access, but should not reach resources outside its normal access. NIST says an attacker with valid credentials may still reach resources the account is allowed, but a good zero trust design limits movement beyond them.

Your progress is saved only in this browser. Export it to keep it safe.

Was this clear?
Report a mistake (opens GitHub in a new tab)
Section 8 of 8

Go deeper

Show 7 sources and related lessons
  1. Cyber Safety Review Board, Review of the Summer 2023 Microsoft Exchange Online Intrusion (20 March 2024) (opens in a new tab)
    The official review. Pages 1 to 7 tell how a consumer signing key opened enterprise mailboxes; pages 20 and 21 list the fixes the Board asks of all cloud providers.
  2. Braiterman, Shostack, Marcil et al., Threat Modeling Manifesto (opens in a new tab)
    The four questions, plus short values and principles for doing threat modelling as a team habit.
  3. OWASP Cheat Sheet Series, Threat Modeling Cheat Sheet (opens in a new tab)
    Data flow diagrams, STRIDE, how to rank threats, the four ways to respond, and how to review the result.
  4. Microsoft Learn, Threats - Microsoft Threat Modeling Tool (opens in a new tab)
    A table with a plain definition and an example for each STRIDE category.
  5. Rose, Borchert, Mitchell and Connelly, NIST SP 800-207: Zero Trust Architecture (NIST, August 2020) (opens in a new tab)
    The definition of zero trust, its seven tenets in section 2.1, and the threats to a zero trust design in section 5.
  6. Ward and Beyer, BeyondCorp: A New Approach to Enterprise Security, ;login: vol. 39 no. 6 (USENIX, December 2014) (opens in a new tab)
    How Google moved its internal apps behind an access proxy that checks user and device on every request.
  7. SPIFFE, SPIFFE Concepts (opens in a new tab)
    The SPIFFE ID format, short-lived identity documents for workloads, and the Workload API.

Real incident: Microsoft, 16 Jun 2023: Storm-0558: a consumer signing key opened enterprise mailboxes

Related: Authentication and authorization · OWASP Top 10 and secure coding · Authorization models: RBAC, ABAC and ReBAC · Secrets and key management · Dependency and supply-chain security · Service mesh and sidecars · Design docs and RFCs

Term

See full entry

Jump to a section

  1. 1What broke
  2. 2The idea in simple words
  3. 3How it works
  4. 4Trade-offs
  5. 5At work
  6. 6With AI
  7. 7Check yourself
  8. 8Go deeper