Threat modeling
Turn a data-flow diagram into testable abuse cases.
The idea
Draw how the browser, identity provider, API, database, and payment service exchange data. Mark trust boundaries and ask how a caller could spoof identity, tamper with input, disclose another tenant’s data, or exhaust a resource. Rank concrete threats by impact and plausible exposure.
Follow the flow
Make it concrete
This excerpt isolates the concept. Connect it to the booking API as you work through the exercise.
Browser → [trust boundary] → Booking API
Booking API → tenant-scoped PostgreSQL
Booking API → payment provider
Threat: valid user requests another tenant's booking
Mitigation: trusted tenant predicate + negative testDecisions that matter
- Choose a control against a concrete risk and document its owner.
- Exercise negative cases in authorized test fixtures.
- Retain evidence at a specific revision and revisit it when the system changes.
Your turn
Write one abuse case for a booking export endpoint.
Reveal a worked answer
A legitimate user changes an export identifier to download another tenant’s records. Require resource-level tenant authorization for generation and download, avoid predictable public URLs, and add a regression test for cross-tenant access.