Module 4 β€” The Threat Modeling Process

🎯 Learning Objectives

  • Execute the five-step threat modeling process end to end
  • Create a basic Data Flow Diagram (DFD) with correct elements and trust boundaries
  • Systematically enumerate threats using STRIDE per element
  • Score and prioritize threats using likelihood Γ— impact
  • Produce actionable mitigation decisions for each threat

1The 5-Step Process Overview

Threat Modeling Process β€” End to End
πŸ” 1. Scope & Assets πŸ—ΊοΈ 2. Model DFD / Arch ⚑ 3. Identify STRIDE πŸ“Š 4. Score Risk / Priority πŸ›‘οΈ 5. Mitigate & Validate
A linear process, but in practice you often cycle back β€” especially between steps 2 and 3 as new threats reveal gaps in your model

2Step 1 β€” Define Scope & Identify Assets

Before drawing a single box, answer: What are we modeling? Scope creep kills threat models. Be explicit about what's in and out of scope.

⚠️
Common Scoping Mistake
Trying to threat model "the whole company" in one session. Instead, pick a specific feature, service, or integration β€” something bounded. "The password reset flow" is a perfect scope. "The entire e-commerce platform" is not.

Scoping Questions to Answer

  • βœ“
    What feature or system are we modeling?
  • βœ“
    What data does it handle? (PII, financial, health, secrets?)
  • βœ“
    Who are the legitimate users? (employees, customers, admins?)
  • βœ“
    What are the external dependencies? (3rd-party APIs, cloud services?)
  • βœ“
    What are the crown jewels? (most valuable assets to protect)
  • βœ“
    What is explicitly OUT of scope?

3Step 2 β€” Draw the Architecture (DFD)

A Data Flow Diagram (DFD) is the visual backbone of your threat model. It shows how data moves through your system β€” who sends it, what processes it, where it's stored, and where trust boundaries exist.

DFD Elements

DFD Notation Reference
πŸ‘€ User External Entity Square / Rect βš™οΈ API Process Process Circle πŸ—„οΈ DB Data Store Data Store Open Rectangle Data Flow Arrow Trust Boundary = Dashed red line separating zones of different trust levels
The four standard DFD notation elements β€” learn these and you can draw any system's threat model diagram

DFD Drawing Rules

  • Data must flow somewhere β€” every flow arrow has a source and destination
  • Label every flow β€” what data moves? (credentials, user records, API responses)
  • Every trust boundary must be visible β€” draw dashed lines where trust levels change
  • Processes have numbers β€” makes them easy to reference in threat tables
  • Keep it honest β€” draw how the system actually works, not how you wish it worked
Example DFD β€” Password Reset Flow
🌐 Untrusted β€” Internet πŸ‘€ User (browser) βœ… App Server Zone 1. Reset Request Handler 2. Token Generator 3. Password Updater πŸ—„οΈ Data Zone Users DB email, passhash Token Store reset tokens πŸ“§ Email Provider (ext.) β‘  email addr β‘‘ lookup user β‘’ generate β‘£ save token β‘€ reset link β‘₯ email ⑦ new pw + token β‘§ validate token ⑨ update password
Password reset flow DFD β€” numbered processes, labeled flows, and explicit trust boundaries. This is the foundation for threat identification.

4Step 3 β€” Identify Threats (STRIDE per Element)

With the DFD drawn, go through each element systematically and apply STRIDE. The output is a threat table β€” the core deliverable of a threat model.

# Component STRIDE Threat Description Priority
T-01 Process 1: Reset Handler Spoofing Attacker submits another user's email and receives a reset link High
T-02 Flow β‘₯: Email delivery Info Disc. Reset link sent to compromised/wrong email exposes token Medium
T-03 Data Store: Token Store Tampering Attacker guesses or brute-forces the reset token (if too short) High
T-04 Process 1: Reset Handler Denial of Svc Flood of reset requests for a single account locks out the user Medium
T-05 Flow ⑦: Token + New PW Tampering MITM intercepts the reset form submission and changes the new password Low
T-06 Process 3: Password Updater Elevation Token replay: used token is not invalidated, can reset password again High
πŸ’‘
Threat ID Convention
Give every threat a unique ID (T-01, T-02…). This lets you reference threats in code comments, Jira tickets, and design docs without ambiguity. Over time, your threat log becomes a powerful security knowledge base.

5Step 4 β€” Score and Prioritize Risks

Not all threats are equal. You can't fix everything at once, so you need a way to decide what to fix first. The simplest approach: score each threat on Likelihood and Impact.

Scoring Criteria

πŸ“ˆ Likelihood Factors
  • How easy is it to exploit? (skill required)
  • Is there existing tooling (exploit kits)?
  • How exposed is the attack surface?
  • Has this been exploited in similar systems before?
πŸ’₯ Impact Factors
  • How much data would be exposed or corrupted?
  • What's the financial/legal consequence?
  • How many users are affected?
  • Is the damage reversible?
Threat IDLikelihoodImpactRisk ScorePriority Action
T-01HighHighCriticalFix before launch
T-03HighHighCriticalFix before launch
T-06HighHighCriticalFix before launch
T-02MediumHighHighNext sprint
T-04MediumMediumMediumNext sprint
T-05LowLowLowDocument & monitor

6Step 5 β€” Mitigate & Validate

For each threat (starting with Critical), decide on a mitigation strategy. There are four valid responses β€” you don't always have to fix:

πŸ”§
Mitigate
Implement a control that reduces likelihood or impact. Most threats should be mitigated.
πŸ”„
Transfer
Move the risk to another party (insurance, contract, or a specialized vendor). E.g. use a PCI-certified payment processor.
🚫
Eliminate
Remove the risky feature entirely if it's not worth the security cost. The safest code is code you don't ship.
πŸ“‹
Accept
Consciously choose to accept a low-risk threat. Document the decision and the reasoning β€” never accept implicitly.

Mitigation Table β€” Password Reset Example

Threat IDMitigation StrategySpecific ControlOwner
T-01MitigateRate-limit reset requests per email; send reset only if email exists (don't confirm which emails are registered)Backend team
T-03MitigateGenerate 256-bit cryptographically random tokens. Expire after 15 minutes. Single use only.Backend team
T-06MitigateInvalidate token immediately after use. Delete all outstanding reset tokens on password change.Backend team
T-02AcceptIf email provider is compromised, we can't prevent token interception. Document as accepted risk; monitor for unusual resets.Security team
T-04MitigateMax 3 reset requests per email per hour. Return same success message regardless of whether email exists.Backend team
T-05TransferEnforced HTTPS/TLS already mitigates MITM. Responsibility on network layer (TLS termination at load balancer).Infra team
πŸ“‹
Validation: Closing the Loop
After mitigations are implemented, validate them: Do they actually address the threat? Did implementing one control create a new vulnerability? Schedule a review β€” and update your threat model document so the next team inherits your knowledge.

7Module Summary

βœ…
The 5-Step Process
  1. Scope β€” define what you're modeling, identify crown jewels
  2. Model β€” draw DFD with elements (external entities, processes, data stores, flows) and trust boundaries
  3. Identify β€” apply STRIDE per element; build a numbered threat table
  4. Score β€” Likelihood Γ— Impact β†’ prioritized list (Critical, High, Medium, Low)
  5. Mitigate β€” for each threat: Mitigate, Transfer, Eliminate, or Accept (with documentation)
1 / 7