Threat modeling in SDLC
Model before choosing controls
Threat modeling is a structured review of a system to identify harmful outcomes and choose protections. Start by describing the system, identify what could go wrong, decide what to change and review whether the protections are adequate. A model is scoped to a design and its assumptions; repeat it when an interface or data flow changes.
Draw data flows and boundaries
For the bookstore, draw: browser → order API → order store; order API → audit log. Label the browser as external, the API as a server component and the store as a restricted data component. A trust boundary separates contexts with different trust assumptions or privileges. The browser-to-API flow crosses a boundary: the API must not treat a request as authorized simply because it comes from the official browser interface.
Threats, controls and evidence
Scenario T-01: an order is returned to the wrong customer. The protected asset is order confidentiality; a missing ownership check is a possible weakness. Control: validate the authenticated identity against the stored owner before disclosure. Evidence: REQ-01 tests from the previous lesson. Another scenario is an unavailable order store; a clear failure response and recovery plan address availability, not ownership.
Prioritize and revisit
For each scenario record impact, plausible conditions, proposed mitigation, owner, verification and remaining risk. Do not rank only by a generic severity label: consider the data, exposure and existing protections. A new export endpoint changes the data flows and may need its own authorization requirement. Missing design information is an open question, not proof that the risk is absent.
Practice: model a stock report
A stock report is read by warehouse staff and generated from a restricted database. Draw the components and flows, identify a boundary, and propose a confidentiality scenario and an availability scenario. For each, connect a control to a verification step. No network traffic or real customer data is needed.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Threat modeling in SDLC — knowledge check
Apply secure development concepts to fictional bookstore records.
What is the first useful input to threat modeling?
Which flow crosses a trust boundary in the example?
What control addresses T-01, disclosure to the wrong customer?
A new export endpoint is added. What should the team do?
The report does not describe the export service identity. How record it?