Security for Engineers/Security Foundations

Threat Modeling at Interview Depth

STRIDE lite, trust boundaries, attacker personas, and the 5-minute "how would you secure this design?" thread in system design rounds.

3/5Overview: 30m

Four-question frame (Shostack)

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

Enough for system design — no 50-page threat model required.

STRIDE (lite)

ThreatMeaningExample
SpoofingFake identityStolen JWT
TamperingAlter dataModified request body
RepudiationDeny actionNo audit log
Info disclosureLeak dataVerbose error with stack trace
DoSDeny availabilityExpensive regex on hot path
ElevationGain more privilegeIDOR on admin endpoint

Map one mitigation per category in design reviews.

Trust boundaries

Draw boxes:

  • Internet → API gateway (authenticate)
  • Gateway → service mesh (mTLS, service identity)
  • Service → database (authZ, parameterized queries)
  • Service → S3 (IAM role, presigned scope)

Attacker crosses boundary → controls at that edge.

Attacker personas (interview)

  • Anonymous external — public API abuse
  • Authenticated user — IDOR, horizontal privilege escalation
  • Compromised service account — lateral movement
  • Malicious insider — audit, least privilege

Don't threat-model nation-states unless role is security-focused.

System design security thread

When moderator asks "secure this?":

  1. AuthN — how users/services prove identity
  2. AuthZ — who can do what on which resource
  3. Data — encryption in transit (TLS — Networking) and at rest
  4. Audit — who did what, tamper-evident logs
  5. Abuse — rate limits, input size caps

2–3 minutes each; defer mesh/KMS details to "platform provides X."

Common mistakes

  • "HTTPS so we're secure" — transport only
  • "We use OAuth" — without scopes and token validation detail
  • Ignoring internal threats — east-west auth matters at scale

Cross-reference: Microservices → API Gateway for edge auth; Communication → REST for Problem Details without leaking internals.

Further Reading

Hands-On Tasks (Optional)

Security design drills — threat modeling, auth flows, and incident playbooks. Assumes Networking (TLS) fundamentals.

  • STRIDE a file-upload feature

    User uploads PDF to S3 via presigned URL. One STRIDE category per row: spoofing, tampering, repudiation, info disclosure, DoS, elevation. One mitigation each.

    20m