robisson/build-like-amazon-agent-skills/threat-modeling
Claude Code and agent skill by robisson/build-like-amazon-agent-skills
- community
Checking that the SKILL.md file is still in the repository.
Security threat modeling using STRIDE methodology adapted for cloud services. Covers data classification, IAM boundaries, encryption requirements, blast radius analysis, and systematic identification of attack vectors before code is written.
Install
npx vskill@latest install robisson/build-like-amazon-agent-skills/threat-modelingSKILL.md
The same SKILL.md was published earlier as robisson/build-like-amazon-agent-skills/threat-modeling.
Threat Modeling
Overview
Threat modeling is the systematic identification of security threats to a system BEFORE the system is built. It answers four questions: What are we building? What can go wrong? What are we going to do about it? Did we do a good enough job? You cannot secure a system by adding security after the fact—security must be designed in. Threat modeling is how you design it in.
A threat model is not a penetration test. Penetration testing finds bugs in implementation. Threat modeling finds flaws in design. A perfectly implemented system with a flawed design is still insecure. You do threat modeling at design time; you do pen testing at implementation time. Both are required; neither replaces the other.
When to Use
- During the design phase of any new service or feature
- When adding new data flows (especially customer data or credentials)
- When changing authentication or authorization mechanisms
- When adding new external-facing endpoints (API, web, mobile)
- When integrating with a new third-party service
- When changing trust boundaries (new service-to-service communication)
- When an incident reveals a class of vulnerability (model similar systems)
- Before any Design Bar Raiser review for systems handling sensitive data
Agent Persona
Load agents/security-guardian.md when reviewing the threat model. Use it to challenge trust boundaries, data classification, least privilege, encryption, blast radius, and missing abuse cases.
Template
Write the threat model into .bla/design/<feature-name>/threat-model.md — <service-name> when /onboard Path A produces the baseline off existing code — following skills/threat-modeling/templates/threat-model-template.md; that file is the shape of the threat model, never its destination. The template records the decisions this skill produces — classification, boundaries, STRIDE per crossing, IAM, encryption, blast radius, accepted risks — and deliberately does not restate the tables below, which are the authority. It uses this skill's own Critical/High/Medium/Low severities, mapped to the canonical levels in AGENTS.md → One Severity Scale and One Verdict Scale, and adds no new label.
Amazon Context
Threat models are living documents maintained alongside design documents. They are updated when the system changes, when new threat intelligence emerges, or when incidents reveal gaps. Every system that handles customer data, credentials, or payment information requires a formal threat model reviewed by security teams before launch.
The principle of "blast radius minimization" is paramount: design systems so that a compromise of one component cannot cascade to compromise the entire system. This drives decisions about service boundaries, IAM scope, encryption key separation, and network isolation.
The Process
1. Data Classification
Before identifying threats, classify the data your system handles:
| Classification | Definition | Examples | Requirements | |
|---|---|---|---|---|
| Restricted | Compromise causes severe harm to customers or business. Regulatory implications. | Payment card numbers, SSNs, authentication credentials, encryption keys | Encrypted at rest AND in transit. Access logged. Minimal retention. Need-to-know access. Annual audit. | |
| Confidential | Internal business data. Competitive advantage if disclosed. | Customer PII (name, email, address), internal financial data, unreleased product plans | Encrypted at rest AND in transit. Access controlled by role. Retention policy enforced. | |
| Internal | Not public but low sensitivity. Operational data. | Service metrics, internal documentation, team rosters, non-sensitive logs | Encrypted in transit. Access controlled by team. Standard retention. | |
| Public | Intended for public consumption. | Marketing content, public documentation, open-source code | Integrity protection (prevent tampering). No confidentiality requirements. |
Rule: A system's classification is determined by the HIGHEST classification of data it handles. A service that processes one Restricted field is a Restricted service.
2. System Decomposition
Create a Data Flow Diagram (DFD) that identifies:
Elements
- External entities: Users, third-party services, partner systems (outside your trust boundary)
- Processes: Your services, Lambda functions, containers, batch jobs
- Data stores: Databases, caches, S3 buckets, queues, logs
- Data flows: Every arrow between elements (API calls, events, file transfers)
Trust Boundaries
Draw lines around components that share the same trust level:
Every crossing of a trust boundary is a potential attack surface.
3. STRIDE Analysis
For each element and data flow in the DFD, systematically analyze threats using STRIDE:
| Category | Threat | Question to Ask | Example | |
|---|---|---|---|---|
| Spoofing | Identity falsification | Can an attacker pretend to be someone/something else? | Attacker forges JWT to impersonate another user | |
| Tampering | Data modification | Can an attacker modify data in transit or at rest? | Man-in-the-middle modifies API request; attacker modifies S3 object | |
| Repudiation | Denying actions | Can an actor deny performing an action with no proof? | Admin deletes records with no audit trail | |
| Information Disclosure | Data leakage | Can an attacker access data they shouldn't? | Error messages expose internal system details; logs contain PII | |
| Denial of Service | Availability disruption | Can an attacker make the system unavailable? | Unbounded request causes OOM; regex DoS; resource exhaustion | |
| Elevation of Privilege | Unauthorized access escalation | Can an attacker gain higher privileges? | SSRF to access instance metadata; SQL injection to admin role |
STRIDE Per Element
For each component in your DFD, fill in:
4. IAM Boundary Design
Principles
- Each service has its own IAM role. No shared roles between services.
- Roles are scoped to minimum needed actions and resources. Use IAM Access Analyzer.
- Cross-service access uses role assumption, not shared credentials.
- Human access to production is time-bounded and audited. No persistent admin access.
- Separate accounts for separate blast radii. Production, staging, and security tooling in different accounts.
IAM Threat Patterns
| Pattern | Threat | Mitigation | |
|---|---|---|---|
| Shared IAM role across services | Compromise of one service = compromise of all | Separate role per service, minimum permissions | |
| Wildcard resource in policy | Any resource accessible, not just intended ones | Explicit ARNs; use conditions for dynamic resources | |
| No MFA on privileged operations | Credential theft = full access | Require MFA for all human privileged operations | |
| Long-lived access keys | Keys leaked in code/logs = persistent access | Use IAM roles with temporary credentials; rotate keys <90 days | |
| Instance metadata accessible | SSRF → credential theft via 169.254.169.254 | IMDSv2 (require token); restrict network access to metadata | |
| Over-scoped Lambda execution role | Compromised function has broad access | Least privilege per function; separate roles per Lambda |
5. Encryption Requirements
Encryption Decision Matrix
| Data State | Classification: Restricted | Classification: Confidential | Classification: Internal | |
|---|---|---|---|---|
| At rest | KMS CMK (team-managed key), key rotation enabled | KMS CMK or AWS-managed key | AWS-managed key or SSE-S3 | |
| In transit | TLS 1.2+ (mandatory) | TLS 1.2+ (mandatory) | TLS 1.2+ (recommended) | |
| In memory | Clear from memory after use; don't log | Standard precautions | Standard precautions | |
| In backups | Same encryption as primary | Same encryption as primary | AWS-managed encryption | |
| In logs | MUST NOT appear in logs | Mask/redact; tokenize | Acceptable in logs |
Key Management
- Key per service: Each service has its own KMS key. Compromise of one service's key doesn't expose another service's data.
- Key per data classification: Restricted and Confidential data use different keys.
- Key rotation: Automatic annual rotation enabled. Manual rotation immediately on suspected compromise.
- Key access policy: Only the owning service's role can use the key for Encrypt/Decrypt. Admin access (for rotation, deletion) is a separate role.
- Cross-account key access: Grant via key policy, not IAM policy. Explicit deny for any principal not explicitly allowed.
6. Blast Radius Analysis
Blast radius = the extent of damage if a single component is fully compromised.
Analysis Process
For each component, answer:
- If this component is fully compromised (attacker has complete control), what can they access?
- What other systems trust this component? (follow the trust relationships)
- What data can be exfiltrated? (follow the data flows)
- Can the attacker move laterally? (check network access, shared credentials, role chaining)
- What's the recovery time? (how long to detect, contain, and recover)
Blast Radius Containment Strategies
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/threat-modeling/SKILL.md
Popularity
- Repository stars
- 15
- Repository forks
- 3
- 7-day trend score
- 14
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/robisson/build-like-amazon-agent-skills/threat-modeling)