Threat modelling systematically identifies threats before building — far cheaper than fixing post-breach.
# STRIDE threat model
# S -- Spoofing: impersonating a user or service
# T -- Tampering: modifying data without authorisation
# R -- Repudiation: denying an action occurred
# I -- Info Disclosure: exposing private data
# D -- Denial of Service: making service unavailable
# E -- Elevation of Privilege: gaining unauthorised access
# STRIDE applied to login endpoint
POST /api/login
Spoofing: attacker brute-forces credentials
Tampering: modify JWT in transit (man-in-the-middle)
Repudiation:no audit log of login attempts
Info Disc: detailed error reveals valid usernames
DoS: no rate limiting, flood with requests
Elevation: SQL injection bypasses auth check
# PASTA (Process for Attack Simulation and Threat Analysis)
# DREAD scoring: Damage, Reproducibility, Exploitability,
# Affected users, Discoverability