Netspective Logo

Threat Modeling

Systematic approach to identifying and mitigating security threats in software systems

Threat modeling is a structured approach to identifying, quantifying, and addressing security threats to a system. It should be performed during the design phase and updated throughout the development lifecycle.

What is Threat Modeling?

Threat modeling answers four key questions:

QuestionFocus
What are we building?System architecture, data flows, trust boundaries
What can go wrong?Potential threats and attack vectors
What are we doing about it?Mitigations and security controls
Did we do a good job?Validation and review

When to Perform Threat Modeling

TimingTriggerScope
Initial DesignNew system or featureFull system
Major ChangesArchitecture modificationsChanged components
New IntegrationsThird-party services, APIsIntegration points
Security IncidentsAfter breach or near-missAffected areas
Regular ReviewsQuarterly/annuallyFull system refresh

STRIDE Threat Model

Microsoft's STRIDE framework categorizes threats by type:

STRIDE Framework

STRIDE per Element

Apply STRIDE based on system element type:

Element TypeRelevant STRIDE Threats
External EntitySpoofing, Repudiation
ProcessAll STRIDE categories
Data StoreTampering, Information Disclosure, Denial of Service
Data FlowTampering, Information Disclosure, Denial of Service

DREAD Risk Rating

Quantify threat severity using DREAD scoring:

FactorQuestionScale
DamageHow bad would an attack be?1-10
ReproducibilityHow easy to reproduce the attack?1-10
ExploitabilityHow much skill needed to exploit?1-10
Affected UsersHow many users are impacted?1-10
DiscoverabilityHow easy to find the vulnerability?1-10

Risk Score = (D + R + E + A + D) / 5

ScoreRisk LevelAction
1-3LowDocument, address in future release
4-6MediumAddress in current release cycle
7-10High/CriticalAddress immediately before release

Threat Modeling Process

Step 1: Define Scope

Document the system boundaries:

Trust Boundary Diagram

Step 2: Create Data Flow Diagram

Document how data moves through the system:

Data Flow Diagram

Step 3: Identify Threats

For each data flow and component, apply STRIDE:

ComponentData FlowThreatCategory
Web ServerUser → WebCredential theftSpoofing
Web ServerUser → WebSession hijackingSpoofing
API ServerWeb → APIParameter tamperingTampering
DatabaseAPI → DBSQL injectionTampering
API ServerAllNo audit logsRepudiation
DatabaseAPI → DBData exposure in errorsInfo Disclosure
Web ServerUser → WebDDoS attackDenial of Service
API ServerWeb → APIBroken access controlElevation of Privilege

Step 4: Document Mitigations

For each identified threat, define controls:

ThreatRisk (DREAD)MitigationStatus
Credential theft8.0MFA, secure password storageImplemented
Session hijacking7.2Secure cookies, short expiryImplemented
Parameter tampering6.4Input validation, parameterized queriesImplemented
SQL injection9.0Parameterized queries, ORMImplemented
Missing audit logs5.0Comprehensive audit loggingIn Progress
Data exposure6.8Custom error pages, sanitized responsesImplemented
DDoS attack5.4Rate limiting, CDN, WAFPartial
Broken access control8.4RBAC, authorization checksImplemented

Step 5: Validate and Review

  • Review threat model with security team
  • Verify mitigations are implemented
  • Update model when system changes
  • Track remediation of open items

Threat Modeling Templates

Threat Card Template

## Threat: [Threat Name]

**ID**: T-001
**Category**: [STRIDE Category]
**Component**: [Affected Component]
**Data Flow**: [Affected Data Flow]

### Description
[Detailed description of the threat]

### Attack Scenario
1. Attacker does X
2. This causes Y
3. Resulting in Z

### Impact
- Confidentiality: [High/Medium/Low]
- Integrity: [High/Medium/Low]
- Availability: [High/Medium/Low]

### DREAD Score
- Damage: X/10
- Reproducibility: X/10
- Exploitability: X/10
- Affected Users: X/10
- Discoverability: X/10
- **Total**: X.X

### Mitigations
| Control | Description | Status |
|---------|-------------|--------|
| [Control 1] | [Description] | [Status] |

### References
- [Related standards, CVEs, etc.]

Common Threat Patterns

Authentication Threats

ThreatAttack VectorMitigation
Credential StuffingReused passwords from breachesMFA, breach detection
Brute ForcePassword guessingRate limiting, account lockout
Session FixationForcing known session IDRegenerate session on login
Token TheftStealing JWT/session tokenSecure storage, short expiry

Authorization Threats

ThreatAttack VectorMitigation
Broken Object Level AuthDirect object referenceAuthorization checks on every request
Broken Function Level AuthMissing role checksRBAC enforcement
Mass AssignmentModifying protected fieldsExplicit field allowlists
Privilege EscalationExploiting role bugsLeast privilege, testing

Data Threats

ThreatAttack VectorMitigation
SQL InjectionMalicious SQL in inputParameterized queries
NoSQL InjectionMalicious operatorsInput validation, sanitization
Data ExposureVerbose errors, logsSanitized responses, log filtering
Insecure StoragePlaintext sensitive dataEncryption at rest

Tools for Threat Modeling

ToolTypeUse Case
Microsoft Threat Modeling ToolDesktopSTRIDE-based modeling
OWASP Threat DragonWeb/DesktopOpen source, diagramming
IriusRiskEnterpriseAutomated threat analysis
ThreagileCode-basedThreat model as code
draw.ioDiagrammingDFD creation

Threat Modeling for Compliance

FDA Requirements (Medical Devices)

  • Document all identified threats
  • Map threats to mitigations
  • Include in Design History File (DHF)
  • Update with design changes

HIPAA Requirements

  • Focus on PHI data flows
  • Document access controls
  • Include in security risk assessment
  • Annual review required

FedRAMP Requirements

  • Map to NIST SP 800-53 controls
  • Document in System Security Plan
  • Include in security assessment
  • Continuous monitoring updates

Best Practices

Do

  • Include threat modeling in design phase
  • Involve developers, security, and ops
  • Update models when system changes
  • Prioritize based on risk scores
  • Document assumptions and trust boundaries
  • Link threats to specific mitigations

Don't

  • Skip threat modeling for "simple" features
  • Create models and never update them
  • Ignore threats because they seem unlikely
  • Focus only on external attackers
  • Treat threat modeling as a checkbox
  • Keep models separate from development docs


Compliance

This section fulfills ISO 13485 requirements for risk management (7.1) and design inputs (7.3.3), and ISO 27001 requirements for threat intelligence (A.5.7), risk assessment (A.5.8), and secure architecture (A.8.27).

View full compliance matrix

How is this guide?

Last updated on

On this page