一键导入
threat-modeling
Use when designing new features, APIs, or system components - guides STRIDE-based threat analysis to identify security concerns early
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when designing new features, APIs, or system components - guides STRIDE-based threat analysis to identify security concerns early
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | threat-modeling |
| description | Use when designing new features, APIs, or system components - guides STRIDE-based threat analysis to identify security concerns early |
Systematic process for identifying, evaluating, and mitigating security threats in systems, applications, and networks.
Primary trigger: You are DESIGNING something new (before implementation).
Invoke this skill when:
Phase: Design (before implementation begins)
| Situation | Use Instead |
|---|---|
| Reviewing existing code/PR | security-code-review |
| Documenting a known risk | risk-assessment |
| Classifying data fields | data-classification (then come back here) |
| Responding to CVE/vuln alert | vulnerability-triage |
| General "is this risky?" question | risk-assessment |
threat-modeling (DESIGN)
│
├──► Found sensitive data? ──► data-classification
│
├──► Found risks to track? ──► risk-assessment
│
└──► Ready to implement? ──► security-code-review (for PR)
access-control-review (if auth)
cryptography-review (if crypto)
Key distinction from risk-assessment:
threat-modeling: "What can ATTACKERS do?" (STRIDE analysis of design)risk-assessment: "What could go WRONG?" (document and track any risk)Threat modeling is required at the Design phase (Activity 3.1):
| Activity | Responsible | Accountable | Supporting |
|---|---|---|---|
| 3.1 Perform threat modelling | Tech-lead | Product Manager | CISO, DPO, SGM, Principal Architect |
| Trigger | Action |
|---|---|
| Start of Project | Full threat model during planning and design phases |
| Post-Deployment | Review and update periodically, especially after major updates |
| After Identified Threats | Revisit when new vulnerabilities discovered in broader ecosystem |
| Role | Responsibility |
|---|---|
| Team Security | Ensure security best practices, review risks, help with analysis, ensure mitigations |
| Product Team | Lead threat modeling, explain design, provide insights on weaknesses, collaborate on mitigations |
| System Architects | Identify architectural vulnerabilities based on design choices |
List and categorize valuable assets that need protection:
Required by SSDLC Activity 2.5:
The architecture diagram shall:
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ External │──HTTPS──│ Process │──gRPC───│ Service │
│ Entity │ │ │ │ │
└──────────────┘ └──────────────┘ └──────────────┘
│ │
[Trust Boundary] │
▼
┌──────────────┐
│ Data Store │
│ │
└──────────────┘
For each component and data flow, consider:
| Threat | Description | Question to Ask |
|---|---|---|
| Spoofing | Impersonating another entity | Can an attacker pretend to be this entity? |
| Tampering | Modifying data or components | Can an attacker modify this data/process? |
| Repudiation | Denial of actions | Can actions be denied without proof? |
| Information Disclosure | Exposing data to unauthorized parties | Can data leak to unauthorized parties? |
| Denial of Service | Disrupting service availability | Can this be made unavailable? |
| Elevation of Privilege | Gaining unauthorized access | Can an attacker gain higher privileges? |
Assess system architecture for:
Assess likelihood and potential impact of identified threats:
Use DREAD for prioritization:
Create actionable mitigation strategies for each threat.
Ensure mitigations are:
From Routine for Threat Modelling:
All open or partially mitigated vulnerabilities must be registered in the Product's Jira Project and analyzed in accordance with Standard for Operational Risk Management.
All Jira-registered Risks must be followed up in ROS process.
Threat model documentation must include:
# Threat Model: [Feature/Component Name]
**Date:** YYYY-MM-DD
**Author:** [Name]
**Version:** 1.0
**Related:** [Design doc, PR, Issue links]
**Product/Service:** [Name]
## Scope
### In Scope
- [Component 1]
- [Component 2]
- [Data flow X to Y]
### Out of Scope
- [Existing component not being changed]
- [Infrastructure concerns handled elsewhere]
## System Overview
[Brief description of what this feature/component does]
## Assets
| Asset | Classification | Description |
|-------|---------------|-------------|
| User credentials | Restricted | Passwords, tokens |
| PII | Restricted | Names, emails, NNIN |
| Session data | Confidential | Session tokens, state |
## Data Flow Diagram
┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │ User │──HTTPS──│ API GW │──gRPC───│ Service │ │ (Browser) │ │ │ │ │ └──────────────┘ └──────────────┘ └──────────────┘ │ │ [Trust Boundary] │ ▼ ┌──────────────┐ │ Database │ │ │ └──────────────┘
## Threat Analysis
### T-001: [Threat Title]
- **Component:** [Which component]
- **STRIDE:** Spoofing / Tampering / Repudiation / Information Disclosure / DoS / Elevation of Privilege
- **Description:** [What could an attacker do?]
- **Attack Vector:** [How would they do it?]
- **Impact:** High / Medium / Low
- **Likelihood:** High / Medium / Low
- **Mitigations:**
- [Mitigation 1]
- [Mitigation 2]
- **Status:** Mitigated / Accepted / Needs Work
- **Jira Risk:** [If residual risk, provide ticket ID]
[Repeat for each threat]
## Summary
| STRIDE Category | Threats Found | Mitigated | Accepted | Needs Work |
|-----------------|---------------|-----------|----------|------------|
| Spoofing | X | X | X | X |
| Tampering | X | X | X | X |
| Repudiation | X | X | X | X |
| Info Disclosure | X | X | X | X |
| Denial of Service | X | X | X | X |
| Elevation of Privilege | X | X | X | X |
## Recommendations
1. [Priority recommendation 1]
2. [Priority recommendation 2]
3. [Priority recommendation 3]
## Approvals
- [ ] Security team review
- [ ] Architecture review
- [ ] Residual risks registered in Jira
Threat modelling is a proactive, but not foolproof, approach to security. While it helps to mitigate many risks, it cannot guarantee absolute security. Continuous monitoring and regular updates are essential to adapting to emerging threats.
T-001: Unauthorized Access to User Data
Reviews access control, authentication, and authorization patterns. Use when reviewing security boundaries, permission models, role-based access, or authentication flows.
Queries Azure Application Insights for logs, errors, and telemetry data. Use when investigating production issues, querying traces, or analyzing application telemetry.
Designs software features collaboratively through visual scenarios and iterative refinement. Use when designing features, tools, UIs, workflows, or any system before implementation.
Reviews Kotlin code for idiomatic style and best practices. Use when reviewing Kotlin code quality, style, or converting Java-style Kotlin to idiomatic Kotlin.
Manual dependency injection using SystemContext (production) and TestContext (test doubles) patterns for Kotlin. Use when structuring service dependencies, wiring application components, or creating test contexts without DI frameworks.
Automate browser interactions, test web pages and work with Playwright tests. Use when writing end-to-end tests, browser automation, or web scraping.