For IT professionals and developers
Free for every learner
About 8 minutes

Lesson 04 of 7 · DevSecOps for IT professionals and developers

Threat-model an application before implementation

Map assets, trust boundaries, likely threats, and early design decisions for a fictional staff shift-swap application.

Anyone can read this lesson. Completion is saved to a learner account.

Lesson objective

By the end, you can

Before implementation, identify the fictional application’s important assets, mark where data or authority crosses trust boundaries, and reason about likely threats so the team can choose appropriate design controls early.

Practical instruction

Threat-model before the first line of code

Start with assets and the application’s purpose

Use ShiftSwap, a fictional web app where staff view their own shifts, request exchanges, and receive email updates. A manager can approve or decline a request. The example uses no real organization, account, system, or credential.

List information and authority worth protecting, not only servers. ShiftSwap assets include account credentials and sessions, staff names and contact details, shift schedules and swap requests, and the manager’s approval authority. These assets guide which security and privacy decisions deserve attention first.

Mark trust boundaries in the data flow

Sketch a staff or manager browser sending a request to the application API, the API reading and updating the schedule database, and the API handing notification content to an external email service. Each handoff crosses a boundary where identity, input, data, or authority must be checked.

A browser is outside the server’s trust boundary even when the app hides controls in its interface. The API must establish the signed-in identity, verify record ownership and manager authority for each operation, and validate every submitted value. Treat the database and email integration as separate boundaries too: decide which data may be stored or sent and which service credentials are needed.

Reason about likely threats before building

Ask how an ordinary staff account could read another person’s schedule, change someone else’s request, or submit an approval as a manager. Consider whether a detailed email could expose sensitive schedule information to the wrong recipient. These are plausible misuse paths to investigate in the design, not claims that a real application has a vulnerability.

Turn the analysis into early design decisions: enforce record-level and role checks in the API, keep manager approvals explicit and auditable, minimize personal details in notifications, and limit integration credentials to the service that needs them. Threat modeling helps IT professionals and developers put those controls in the architecture before implementation makes them harder to change.

Safe hands-on exercise

Build a first-pass model for ShiftSwap

ShiftSwap is a fictional web app for a small team. Staff sign in, view their own shifts, request an exchange with a coworker, and receive email updates. A manager reviews requests and approves or declines them. Use only this scenario; no real target or credentials are involved.

Apply the lesson

Choose the statements that belong in a useful first-pass model. Include important assets, trust boundaries, plausible threats, and decisions the team can make before writing code.

Select the useful parts of a pre-implementation threat model

A complete model covers all five analysis points and avoids treating sign-in or hidden interface controls as sufficient protection. Read the feedback, then change your selections and check again. This check runs only in your browser; it does not connect to or save data in a real application.

Knowledge check

Check your understanding

Before building ShiftSwap, which first-pass analysis best connects its assets, trust boundaries, likely threats, and early design choices?

Choose the best answer