Skip to content

Lesson 3 of 9 · 27m

Threat Models That Survive Contact with Engineering

Create concise threat models that expose trust boundaries, security invariants, and abuse cases engineers can implement and test.

The quickest way to kill threat modeling is to make it a ceremony. I have sat through workshops that produced beautiful attack trees and zero code changes. A threat model is useful only when it changes a design decision, adds a test, or reveals an assumption the team did not know it was making. If it cannot survive contact with engineering, it was documentation theater.

Model boundaries, not boxes

Most teams start by drawing components. Start instead with trust boundaries: where identity, privilege, data ownership, or execution context changes. Those transitions are where security invariants live.

customer browser -> public API        untrusted input becomes authenticated identity
public API -> tenant data store       one tenant must not become another tenant
worker queue -> internal service      asynchronous messages need provenance checks
CI system -> production deploy        build authority must be separable from code authorship

Ask what must remain true even when an attacker controls input, timing, ordering, retries, or another tenant's identifiers. Those statements are more useful than generic attacker personas.

Write invariants in testable language

Bad: "users cannot access unauthorized data." Good: "every object read must evaluate tenant ownership server-side before serialization." The second version tells you where the control belongs and how to test it.

invariant                                      test shape
object access is tenant-scoped                 cross-tenant fixture returns 404 or 403
webhook replays cannot mutate state twice      duplicate event ID is idempotent
admin actions require step-up authentication   normal session is rejected
queued jobs cannot forge producer identity     worker rejects missing signed provenance

A threat model should produce assertions an engineer can implement as unit, integration, or end-to-end tests.

Abuse cases beat attacker trivia

A use case says what the system should do. An abuse case says what happens when someone deliberately uses it wrong. Tie abuse cases to workflows:

workflow: invite a user to a team
abuse case: invite thousands of victims to generate outbound spam
control: per-team and per-recipient rate limits, invite expiry, audit log

workflow: export project data
abuse case: export another tenant's archive by changing the job identifier
control: object authorization checked when creating, polling, and downloading the export

Notice that controls appear at multiple workflow stages. Bugs often live in the stage nobody remembered was a separate object access.

Keep the artifact small and living

For most product changes, one page is enough:

## Security notes: cross-organization project sharing
Data: project metadata, member emails, role assignments
Boundaries: org A -> shared project -> org B; browser -> API; API -> ACL service
Invariants:
- Sharing grants are explicit, scoped, and revocable.
- Members of org B never inherit org A workspace roles.
- Revocation applies to cached project lists within 60 seconds.
Abuse cases: stale grant reuse, invite forwarding, object ID guessing, role confusion.
Tests: cross-org fixture, revocation replay, indirect object reference tests.

This is not a compliance deliverable. It is the design note that future maintainers will actually read.

Field notes

  • STRIDE can help brainstorm, but do not force engineers to categorize every threat before acting on it.
  • If the model has no owner or review date, assume it is stale.
  • The most important threats often come from valid features used at scale: exports, invitations, search, password reset, and integrations.
  • Do not confuse a risk register with a threat model. One tracks acceptance; the other explains how the system can fail.

Was this lesson helpful?

Sign in to rate