Threat Modeling

Objectives: By the end of this topic, you will be able to…

  • Understand and apply basic threat modeling methodologies
  • Use visual tools to represent threats
  • Formulate practical countermeasures for simulated scenarios
  • Justify security decisions in system design

What is threat modeling?

Threat modeling is the systematic process of:

  • Identifying which assets need to be protected
  • Determining who could attack them (threat actors)
  • Analyzing how they could do it (attack vectors)
  • Assessing vulnerabilities and their impact
  • Defining controls to mitigate those risks

Purpose: anticipate potential attacks, design more secure systems from the start, and prioritize security controls and resources.


Why is it important?

Threat modeling is applied mainly during the design phase of the Secure Software Development Lifecycle (SDLC), before implementing solutions, when:

  • Fixing vulnerabilities is cheaper
  • The architecture can be modified without major impacts

Benefits:

  • Improves communication between teams (security, development, product)
  • Helps understand the system from an attacker’s perspective
  • Prioritizes protection of the most critical assets

Threat modeling methodologies

STRIDE (Microsoft)

Each letter represents a threat category:

Threat TypeDescription
SpoofingIdentity impersonation
TamperingData or code manipulation
RepudiationDenial of actions without evidence
Information DisclosureLeakage of sensitive information
Denial of ServiceService disruption
Elevation of PrivilegeGaining unauthorized permissions

Useful for mapping threats by component in a system.

DREAD (threat prioritization)

Used to rank and prioritize threats based on risk:

CriterionAssociated Question
DamageHow severe is the damage if it happens?
ReproducibilityHow easily can the attack be repeated?
ExploitabilityHow easy is it to exploit the threat?
Affected UsersHow many users are affected?
DiscoverabilityHow easy is it to discover the threat?

Each criterion is scored from 1 to 10. The average gives an idea of the overall risk.

PASTA (Process for Attack Simulation and Threat Analysis)

A more comprehensive methodology oriented toward enterprise risk management, consisting of 7 stages: define business objectives, define attack surface, model threats, model vulnerabilities, analyze impact, model attacks, and plan mitigations. More widely used in complex or regulated corporate environments.


Data Flow Diagrams (DFDs)

DFDs visualize how information flows in a system and help identify critical points from a security perspective.

ElementCommon SymbolExample
External entityRectangleUser, external system
ProcessCircle/OvalWeb service, business logic
Data storeTwo linesDatabase, files
Data flowArrowInteraction between elements

Why use DFDs?

  • Identify where data enters/exits the system
  • Apply STRIDE to each component
  • Provide a clear communication tool for developers and analysts

Identifying threats, vectors, and mitigations

Example: User login web system

AssetThreat (STRIDE)VectorMitigation
User credentialsSpoofing, DisclosureBrute force, MITMPassword hashing, HTTPS
DatabaseTamperingSQL InjectionInput validation, WAF
System logsRepudiationLog deletionImmutable logs, auditing
Internal APIElevation of PrivilegeEndpoint abuseAccess control, JWT validation

Key questions for threat analysis:

  • What attackers can access the system?
  • What assets are valuable to them?
  • What vectors could they use?
  • What vulnerabilities exist at entry/exit points?
  • What controls would reduce risk?

Hands-on lab

Requirements: Draw.io, Threat Dragon, or Lucidchart. Base case: Online Banking Web Application

Part 1: Case introduction and asset analysis

  1. Review the base case: online banking web system
  2. In pairs, identify critical assets and list entry points and actors
  3. Create a basic Data Flow Diagram (DFD) with at least:
    • 2 processes, 2 data stores, 2 external entities, 2 data flows with direction

Part 2: Applying STRIDE to the DFD

  1. Analyze the DFD and review each component, applying STRIDE
  2. Complete a table with at least one threat per component:
ElementSTRIDE TypeThreat DescriptionProposed Countermeasure
LoginSpoofingAttacker impersonates a legitimate userMulti-factor authentication, suspicious IP detection
DBTamperingAlteration of transaction recordsDigital signatures, integrity control
API EmailRepudiationUser denies making a transferAudit logging with timestamp and session token

Part 3: Risk analysis with DREAD

  1. Select 2-3 threats from the STRIDE analysis
  2. Apply the DREAD formula:
(D + R + E + A + D) / 5 = Total Risk
  1. Compare threats and discuss which should be mitigated first

Part 4: Documentation and export

  1. Export the DFD diagram as .png or PDF
  2. Export STRIDE and DREAD tables
  3. Write a mini report containing: system description, DFD, threats table, DREAD scores, prioritized countermeasures

Submission

  • Data Flow Diagram (.png or .pdf)
  • STRIDE table with at least 5 different threats
  • DREAD table with scores and priorities
  • Document or presentation with findings

Key concepts

TermDefinition
STRIDEThreat categorization model: Spoofing, Tampering, Repudiation, Information Disclosure, DoS, Elevation of Privilege
DREADThreat prioritization model based on five risk criteria
DFDData flow diagram that visualizes how information flows through a system
PASTAThreat modeling methodology oriented toward enterprise risk management

Test yourself

  1. STRIDE: Given an e-commerce system with a shopping cart, payment gateway, and customer database, identify at least one threat for each STRIDE category.

  2. DREAD: For a SQL injection vulnerability in a login form, assign DREAD scores (1-10) to each criterion and calculate the total risk. Justify your scores.

  3. Design: Why is it more cost-effective to apply threat modeling during the design phase than to fix vulnerabilities in production?


Navigation:Previous | Home | Next