Threat Modeling: Thinking Like an Attacker
Threat modeling is thinking like an attacker to find security flaws before they're exploited. It systematically analyzes your system to prioritize defenses against the most likely threats. The footgun is treating it as a one-off task, not a continuous process.
WHY IT EXISTS: Security can feel like an endless game of whack-a-mole. Teams often fix vulnerabilities only after they're discovered, which is expensive and risky. Threat modeling was created to move security "left"—making it a proactive part of the design phase, not a reactive cleanup job. It provides a structured way to anticipate attacks instead of just responding to them.
THE MENTAL MODEL: Think of it like a burglar casing a house before a robbery. They don't just check the front door; they check windows, the back gate, and the neighbors' schedules. Threat modeling is the security equivalent: you systematically map out your system's "doors and windows" (entry points), "valuables" (assets), and potential "burglars" (attackers) to figure out where a break-in is most likely and what you should reinforce first.
HOW IT WORKS: The process generally involves four steps. First, you define what you're protecting, usually by diagramming the system's architecture and data flows. Second, you brainstorm and enumerate potential threats for each component—what could go wrong? Third, you analyze and prioritize these threats based on their likelihood and potential impact. Fourth, you identify and prioritize countermeasures or mitigations for the highest-risk threats.
WHEN TO USE IT: Use threat modeling early in the software development lifecycle, before significant code is written. It's most effective when designing a new system or adding a major new feature to an existing one. The output directly informs which security controls, like input validation or encryption, are most critical to implement.
WHEN NOT TO USE IT: Threat modeling is not a replacement for other security practices like penetration testing or code scanning; it's a complementary design-phase activity. Trying to conduct a full threat model during a live security incident is the wrong tool for the job—at that point, you need an incident response plan. It is also likely overkill for simple, low-risk internal tools with no sensitive data.
ONE CANONICAL EXAMPLE: A team building a new user profile page would diagram the flow: user logs in, requests a page, the server fetches data from a database, and renders it. They'd identify threats like an attacker spoofing another user's identity, altering their profile data in transit, or accessing private data they shouldn't see. Based on this, they'd prioritize building strong authentication, using HTTPS, and implementing strict access controls on the database query.
Read the original → en.wikipedia.org
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.