1. Foundations of Security

Threat Models

Teach methods for identifying adversaries, assets, attack surfaces, and creating threat model representations.

Threat Models

Welcome to this lesson on threat modeling, students! This lesson will teach you how to systematically identify and analyze potential security threats to systems and organizations. By the end of this lesson, you'll understand how to identify adversaries, catalog assets, map attack surfaces, and create comprehensive threat model representations using proven methodologies. Think of threat modeling as creating a security blueprint - just like architects plan buildings to withstand earthquakes, we plan systems to withstand cyber attacks! πŸ›‘οΈ

Understanding Threat Modeling Fundamentals

Threat modeling is a structured approach to identifying, understanding, and addressing potential security threats before they become real problems. Imagine you're designing a new smartphone app that handles banking information - wouldn't you want to know what could go wrong before millions of people start using it? That's exactly what threat modeling helps us do! πŸ“±

At its core, threat modeling answers four critical questions: What are we building? What can go wrong? What are we going to do about it? And did we do a good job? This systematic approach has been used by major tech companies like Microsoft, Google, and Amazon to secure their products and services.

The process typically involves several key components. First, we need to understand our assets - these are the valuable things we're trying to protect, like customer data, intellectual property, or system availability. Next, we identify adversaries - the people or groups who might want to attack our system, ranging from curious teenagers to sophisticated nation-state actors. We also need to map our attack surface - all the ways an attacker could potentially reach our assets, like network connections, user interfaces, or physical access points.

According to cybersecurity research, organizations that implement threat modeling early in their development process can reduce security vulnerabilities by up to 50% and save significant costs compared to fixing issues after deployment. This makes threat modeling not just a security practice, but a smart business strategy! πŸ’Ό

Identifying Adversaries and Their Motivations

Understanding who might attack your system is crucial for effective threat modeling. Adversaries come in many forms, each with different capabilities, motivations, and resources. Let's explore the main categories you'll encounter, students! 🎯

Script kiddies represent the entry level of cyber threats. These are typically young, inexperienced attackers who use pre-written tools and scripts without fully understanding how they work. While they may lack sophistication, they can still cause significant damage through automated attacks or by accidentally stumbling upon vulnerabilities. Think of them as digital vandals - they might deface your website or launch simple denial-of-service attacks for fun or recognition.

Cybercriminals operate with financial motivation and often possess moderate to advanced technical skills. They might target your system to steal credit card information, personal data for identity theft, or to deploy ransomware. According to the FBI's Internet Crime Report, cybercrime losses exceeded $10.2 billion in 2022 alone, making this category a significant threat to businesses and individuals.

Insider threats come from people within your organization who have legitimate access to systems. These could be disgruntled employees, contractors, or business partners. The 2023 Verizon Data Breach Investigations Report found that insider threats were involved in 19% of all data breaches, making them a critical consideration in any threat model.

Nation-state actors represent the most sophisticated and well-resourced adversaries. These government-sponsored groups have advanced capabilities and virtually unlimited time and resources. They typically target critical infrastructure, government systems, or companies with valuable intellectual property. Examples include groups like APT1 (China) or Fancy Bear (Russia).

When identifying adversaries for your specific system, consider their motivation (what they want), capability (what they can do), and opportunity (how they can reach you). A small e-commerce website might primarily worry about cybercriminals seeking credit card data, while a defense contractor would need to consider nation-state actors interested in classified information.

Cataloging Assets and Attack Surfaces

Now that we understand who might attack us, let's identify what they're after and how they might get it, students! Asset identification is like taking inventory of everything valuable in your digital world πŸ“Š

Data assets are often the crown jewels of modern organizations. This includes customer personal information, financial records, intellectual property, trade secrets, and operational data. For example, a healthcare organization's electronic health records are incredibly valuable - they can sell for $250-$1000 each on the dark web, compared to just $1-$3 for credit card information. When cataloging data assets, consider not just what data you store, but also what data flows through your systems.

System assets include the hardware, software, and infrastructure that keep your organization running. This encompasses servers, databases, network equipment, applications, and cloud services. Don't forget about less obvious assets like backup systems, monitoring tools, or development environments - attackers often target these "forgotten" systems as stepping stones to more valuable targets.

Process assets represent your operational procedures, business processes, and institutional knowledge. While harder to quantify, these assets are crucial for business continuity. An attacker who disrupts your order processing system or corrupts your customer service procedures can cause significant damage even without stealing data.

The attack surface represents all the ways an adversary could potentially reach your assets. Think of it as mapping every door, window, and ventilation shaft in a building - each represents a potential entry point! 🏒

Network attack surfaces include internet-facing services, wireless networks, VPN endpoints, and partner connections. A single misconfigured web server or unsecured API endpoint can provide attackers with their initial foothold. According to Shodan, a search engine for internet-connected devices, there are millions of exposed databases, cameras, and industrial control systems visible on the internet.

Application attack surfaces encompass web applications, mobile apps, desktop software, and APIs. Common vulnerabilities include injection flaws, broken authentication, and insecure data storage. The OWASP Top 10 provides an excellent reference for the most critical web application security risks.

Physical attack surfaces involve buildings, data centers, employee workstations, and mobile devices. An attacker who gains physical access to a server room or can install a malicious USB device has bypassed many digital security controls.

Human attack surfaces recognize that people are often the weakest link in security. Social engineering attacks like phishing, pretexting, or baiting exploit human psychology rather than technical vulnerabilities. The 2023 Verizon report found that 74% of breaches involved a human element.

Threat Modeling Methodologies and Frameworks

Several proven methodologies can guide your threat modeling efforts, each with its own strengths and applications, students! Let's explore the most widely used frameworks πŸ”§

STRIDE is Microsoft's threat modeling methodology that categorizes threats into six types: Spoofing (impersonating someone else), Tampering (modifying data or code), Repudiation (denying actions), Information Disclosure (exposing information), Denial of Service (making systems unavailable), and Elevation of Privilege (gaining unauthorized access). STRIDE works particularly well for software applications and provides a systematic way to think through different attack categories.

For example, when analyzing a login system using STRIDE, you might identify spoofing threats (fake login pages), tampering threats (modifying authentication tokens), or information disclosure threats (exposing user credentials in logs).

DREAD provides a risk assessment framework that evaluates threats based on five criteria: Damage potential, Reproducibility, Exploitability, Affected users, and Discoverability. Each factor is rated on a scale (typically 1-10), and the scores are combined to prioritize threats. While DREAD has fallen out of favor due to its subjective nature, it remains useful for initial risk assessments.

PASTA (Process for Attack Simulation and Threat Analysis) is a seven-stage methodology that emphasizes business context and risk analysis. PASTA stages include defining objectives, defining technical scope, application decomposition, threat analysis, weakness analysis, attack modeling, and risk analysis. This approach is particularly valuable for complex enterprise environments where business impact must be clearly understood.

OCTAVE (Operationally Critical Threat, Asset, and Vulnerability Evaluation) focuses on organizational risk and business impact. It's designed to be led by internal teams rather than external consultants, making it ideal for organizations wanting to build internal threat modeling capabilities.

When choosing a methodology, consider your organization's size, technical complexity, regulatory requirements, and available resources. Many organizations combine elements from multiple frameworks to create customized approaches that fit their specific needs.

Creating Threat Model Representations

Visual representations make threat models easier to understand, communicate, and maintain, students! Think of these diagrams as maps that help everyone navigate the security landscape πŸ—ΊοΈ

Data Flow Diagrams (DFDs) are the foundation of most threat modeling efforts. These diagrams show how data moves through your system, identifying processes, data stores, external entities, and trust boundaries. Trust boundaries are particularly important - they represent points where data moves between different security contexts, such as from a web application to a database or from your internal network to a cloud service.

A typical DFD uses standard symbols: circles for processes, parallel lines for data stores, rectangles for external entities, and arrows for data flows. Trust boundaries are shown as dotted lines that separate different security zones. For example, a simple web application might show users (external entity) sending requests through the internet (trust boundary) to a web server (process), which queries a database (data store).

Attack trees provide a hierarchical representation of how attackers might achieve their goals. The root of the tree represents the attacker's objective (like "steal customer data"), and branches show different ways to achieve that goal. Each branch can be further decomposed into specific attack steps. Attack trees help identify both obvious and subtle attack paths, making them excellent for comprehensive threat analysis.

For instance, an attack tree for "compromise user account" might have main branches for "steal credentials," "exploit authentication vulnerabilities," and "social engineering." The "steal credentials" branch might further split into "phishing attack," "keylogger malware," and "database breach."

Threat modeling templates provide structured formats for documenting your analysis. These typically include sections for system description, assumptions, assets, threats, vulnerabilities, and countermeasures. Many organizations create standardized templates to ensure consistency across different projects and teams.

Modern threat modeling tools like Microsoft Threat Modeling Tool, OWASP Threat Dragon, or ThreatModeler can automate much of the diagramming and analysis process. These tools often integrate with development workflows, making it easier to keep threat models updated as systems evolve.

Conclusion

Threat modeling is an essential security practice that helps organizations proactively identify and address potential threats before they become real problems. By systematically identifying adversaries, cataloging assets, mapping attack surfaces, and using proven methodologies like STRIDE or PASTA, you can create comprehensive security strategies tailored to your specific risks. Remember that threat modeling is not a one-time activity - it should be regularly updated as systems evolve and new threats emerge. The visual representations and structured approaches we've discussed provide practical tools for making complex security concepts understandable and actionable across your organization.

Study Notes

β€’ Threat modeling is a structured process for identifying, prioritizing, and addressing potential security threats to systems before deployment

β€’ Four key questions: What are we building? What can go wrong? What are we going to do about it? Did we do a good job?

β€’ Main adversary types: Script kiddies (low skill, automated tools), Cybercriminals (financially motivated), Insider threats (legitimate access), Nation-state actors (highly sophisticated)

β€’ Asset categories: Data assets (customer info, intellectual property), System assets (hardware, software, infrastructure), Process assets (business procedures, institutional knowledge)

β€’ Attack surface components: Network (internet-facing services, APIs), Application (web apps, mobile apps), Physical (buildings, devices), Human (social engineering targets)

β€’ STRIDE framework: Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service, Elevation of Privilege

β€’ DREAD assessment: Damage potential, Reproducibility, Exploitability, Affected users, Discoverability (rated 1-10 each)

β€’ PASTA methodology: Seven-stage process emphasizing business context and risk analysis

β€’ Data Flow Diagrams (DFDs): Show data movement using circles (processes), parallel lines (data stores), rectangles (external entities), arrows (data flows)

β€’ Trust boundaries: Dotted lines in DFDs representing points where data crosses security contexts

β€’ Attack trees: Hierarchical representation with attacker goals at root and attack methods as branches

β€’ Threat modeling benefits: Up to 50% reduction in vulnerabilities when implemented early in development process

Practice Quiz

5 questions to test your understanding

Threat Models β€” Security Studies | A-Warded