Course contentsShow
← Security
Lesson 2031 of 3,05241. Secure Development LifecycleFree lesson

Threat Modeling in Design Phase

Apply threat modeling to architectural designs to identify attack surfaces, trust boundaries, and security controls before coding.

Threat Modeling in Design Phase

What you'll learn: How to systematically identify security threats in your architecture before writing code, saving time and preventing vulnerabilities.

What Is Threat Modeling in Design?

Threat modeling during the design phase is like creating a security blueprint before construction begins. You analyze your architectural diagrams to identify where attackers might strike, what they might target, and how your defenses should be positioned—all before a single line of code is written.

This proactive approach maps three critical elements:

Attack surfaces are all the points where data enters or exits your system—APIs, user inputs, file uploads, database connections. Think of them as doors and windows in a building: you need to know where they all are.

Trust boundaries mark where data or requests transition between security zones. For example, when an unauthenticated user's request crosses into your application, or when your app queries a database. Each boundary is a checkpoint where assumptions change and validation must occur.

Security controls are the countermeasures you'll place at strategic points—authentication checks, input validation, encryption layers, rate limiting.

The Process

Start with your architectural design documents. Draw data flow diagrams showing how information moves through your system. At each trust boundary crossing, ask: "What could go wrong here?" Use frameworks like STRIDE (Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service, Elevation of Privilege) to systematically consider threat categories.

Document threats, rate their risk, and decide on mitigations. This creates a security design specification that developers implement alongside functional requirements.

Why It Matters

Finding an authentication bypass in a design diagram takes minutes. Finding it in production code costs days of rework, potential breaches, and damaged trust. Threat modeling shifts security left—addressing problems when they're cheapest to fix.

Key Takeaway: Threat modeling in the design phase identifies attack surfaces, trust boundaries, and required security controls before coding begins, making security fixes dramatically cheaper and more effective than post-deployment patches.