Threat modeling

From williamzujkowski/standards · View interactive version

Threat modeling is an AI agent skill from the GitHub repository williamzujkowski/standards. Ttampering: description: Modifying data or code maliciously targets: [dataintegrity, codeintegrity] example: "Altering transaction amounts in transit"

How to use this skill

Skill file

Threat Modeling

Identify, prioritize, and mitigate security threats systematically using STRIDE methodology

Level 1: Quick Reference

STRIDE Threat Categories

threats:
  S_spoofing:
    description: Impersonating something or someone else
    targets: [authentication, identity]
    example: "Using stolen credentials to access system"

  T_tampering:
    description: Modifying data or code maliciously
    targets: [data_integrity, code_integrity]
    example: "Altering transaction amounts in transit"

  R_repudiation:
    description: Claiming to not have performed an action
    targets: [logging, audit_trails]
    example: "Denying fraudulent transaction was performed"

  I_information_disclosure:
    description: Exposing information to unauthorized parties
    targets: [confidentiality, data_protection]
    example: "Leaking customer PII through error messages"

  D_denial_of_service:
    description: Making system unavailable or degraded
    targets: [availability, performance]
    example: "Overwhelming API with requests"

  E_elevation_of_privilege:
    description: Gaining unauthorized higher access level
    targets: [authorization, access_control]
    example: "Exploiting bug to gain admin rights"

Four Key Questions

  1. What are we building?
  1. What can go wrong?
  1. What should we do about it?
  1. Did we do a good job?

Essential Checklist

Planning Phase:

Analysis Phase:

Prioritization:

Mitigation:

Documentation:


Level 2:

📚 Full Examples: See REFERENCE.md for complete code samples, detailed configurations, and production-ready implementations.

Implementation Guide

STRIDE Methodology

Systematic Threat Identification

See REFERENCE.md for complete implementation.

STRIDE-per-Element Pattern

See REFERENCE.md for complete implementation.

Attack Trees

Building Attack Trees

See REFERENCE.md for complete implementation.

Attack Tree Template

See REFERENCE.md for complete implementation.

Data Flow Diagrams (DFD)

DFD Notation

See REFERENCE.md for complete implementation.

Example DFD: Web Application

See REFERENCE.md for complete implementation.

DFD Analysis Checklist

See REFERENCE.md for complete implementation.

Trust Boundaries

Identifying Trust Boundaries

See REFERENCE.md for complete implementation.

Boundary Crossing Analysis

See REFERENCE.md for complete implementation.

Threat Prioritization (DREAD)

DREAD Scoring System

See REFERENCE.md for complete implementation.

Threat Prioritization Example

See REFERENCE.md for complete implementation.

Mitigation Strategies

Mitigation Pattern Catalog

See REFERENCE.md for complete implementation.

PASTA Methodology

Process for Attack Simulation and Threat Analysis

See REFERENCE.md for complete implementation.

Tools

Microsoft Threat Modeling Tool

See REFERENCE.md for complete implementation.

Threat Modeling Workflow

See REFERENCE.md for complete implementation.

NIST Integration

NIST RA-3: Risk Assessment

See REFERENCE.md for complete implementation.

NIST RA-5: Vulnerability Monitoring and Scanning

See REFERENCE.md for complete implementation.

Practical Examples

Example 1: Authentication Service Threat Model

See REFERENCE.md for complete implementation.

Example 2: API Gateway Threat Model

See REFERENCE.md for complete implementation.


Level 3: Deep Dive Resources

Advanced Topics

Tools & Frameworks

References

Community

Examples

Basic Usage

// TODO: Add basic example for threat-modeling
// This example demonstrates core functionality

Advanced Usage

// TODO: Add advanced example for threat-modeling
// This example shows production-ready patterns

Integration Example

// TODO: Add integration example showing how threat-modeling
// works with other systems and services

See examples/threat-modeling/ for complete working examples.

Integration Points

This skill integrates with:

Upstream Dependencies

Downstream Consumers

Related Skills

Common Integration Patterns

  1. Development Workflow: How this skill fits into daily development
  2. Production Deployment: Integration with production systems
  3. Monitoring & Alerting: Observability integration points

Common Pitfalls

Pitfall 1: Insufficient Testing

Problem: Not testing edge cases and error conditions leads to production bugs

Solution: Implement comprehensive test coverage including:

Prevention: Enforce minimum code coverage (80%+) in CI/CD pipeline

Pitfall 2: Hardcoded Configuration

Problem: Hardcoding values makes applications inflexible and environment-dependent

Solution: Use environment variables and configuration management:

Prevention: Use tools like dotenv, config validators, and secret scanners

Pitfall 3: Ignoring Security Best Practices

Problem: Security vulnerabilities from not following established security patterns

Solution: Follow security guidelines:

Prevention: Use security linters, SAST tools, and regular dependency updates

Best Practices:


Next Steps:

  1. Review bundled templates in templates/
  2. Use stride-template.md for your first threat model
  3. Generate DFDs with data-flow-diagram.md
  4. Run threat-report-generator.py to create reports
  5. Study real-world examples in resources/stride-examples.md

Related Skills: [security-testing] [secure-coding] [vulnerability-management]

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.