Threat Modeling

STRIDE, data flow diagrams, attack trees and risk rating, a step-by-step threat modeling workshop, and how to make it part of architecture reviews.

The four questions (Threat Modeling Manifesto)

  1. What are we working on? (model the system)
  2. What can go wrong? (identify threats)
  3. What are we going to do about it? (mitigations)
  4. Did we do a good enough job? (validate)

STRIDE

Threat Violates Example Typical control
Spoofing Authentication Forged service identity mTLS, strong auth
Tampering Integrity Modified message in transit TLS, signatures, checksums
Repudiation Non-repudiation User denies a transfer Audit logs, signed records
Information disclosure Confidentiality Data leak via logs Encryption, access control, redaction
Denial of service Availability API flooding Rate limits, autoscaling, WAF
Elevation of privilege Authorization User becomes admin Least privilege, authorization checks

Other methods: PASTA (risk-centric), LINDDUN (privacy threats), attack trees, MITRE ATT&CK for adversary techniques.

Example data flow diagram with trust boundaries

flowchart LR
  subgraph Internet [Untrusted: Internet]
    U[Customer]
  end
  subgraph DMZ [Trust boundary: edge]
    WAF[WAF / CDN]
    GW[API gateway]
  end
  subgraph Internal [Trust boundary: private network]
    SVC[Payment service]
    DB[(Payments DB)]
    Q[[Queue]]
  end
  PSP[External PSP]
  U -- HTTPS --> WAF --> GW --> SVC
  SVC --> DB
  SVC --> Q
  SVC -- mTLS --> PSP

For each element and flow crossing a trust boundary, ask the STRIDE questions.

Workshop steps (90 minutes)

  1. Draw the DFD with trust boundaries (15 min).
  2. Walk each flow with STRIDE; list threats (40 min).
  3. Rate risk (likelihood × impact, or DREAD/CVSS-style) (15 min).
  4. Agree mitigations, owners and tickets; accept residual risks explicitly (20 min).

Tools: Microsoft Threat Modeling Tool, OWASP Threat Dragon, IriusRisk, or a whiteboard and a spreadsheet.

Interview questions and answers

When should threat modeling happen?

At design time for new systems and significant changes (new data flows, external integrations, authentication changes), revisited when architecture changes. It is cheapest before code exists.