AgentSkillsCN

threat-modeling

运用STRIDE方法论进行威胁建模,识别威胁、评估风险并设计安全控制措施。在设计安全系统,或评估应用安全时加以运用。

SKILL.md
--- frontmatter
name: threat-modeling
description: Conduct threat modeling using STRIDE methodology. Identify threats, assess risks, and design security controls. Use when designing secure systems or assessing application security.
license: MIT
metadata:
  author: devops-skills
  version: "1.0"

Threat Modeling

Identify and mitigate security threats during system design.

STRIDE Methodology

ThreatDescriptionMitigation
SpoofingPretending to be someone elseAuthentication
TamperingModifying dataIntegrity controls
RepudiationDenying actionsAudit logging
Information DisclosureData exposureEncryption
Denial of ServiceMaking service unavailableRate limiting
Elevation of PrivilegeGaining higher accessAuthorization

Process

yaml
steps:
  1_scope:
    - Define system boundaries
    - Identify assets
    - Document data flows
    
  2_diagram:
    - Create data flow diagrams
    - Identify trust boundaries
    - Mark entry points
    
  3_identify:
    - Apply STRIDE to each component
    - List potential threats
    - Document attack vectors
    
  4_assess:
    - Rate likelihood and impact
    - Prioritize by risk score
    
  5_mitigate:
    - Design countermeasures
    - Accept/transfer risks
    - Document decisions

Data Flow Diagram

code
[External User] --> |HTTPS| --> [Load Balancer]
                                      |
                                      v
                               [Web Server]
                                      |
                              [Trust Boundary]
                                      |
                                      v
                                [App Server] --> [Database]

Threat Cards

yaml
threat:
  id: T001
  name: SQL Injection
  category: Tampering
  component: Database queries
  likelihood: High
  impact: Critical
  mitigations:
    - Parameterized queries
    - Input validation
    - WAF rules
  status: Mitigated

Best Practices

  • Integrate into SDLC
  • Review on architecture changes
  • Include development team
  • Document all decisions
  • Regular reassessment

Related Skills