threat-modeling
Skill8 starsChanged 9 days agoMITView on GitHub
Builds practical threat models - a data flow diagram with trust boundaries, STRIDE analysis per element, ranked threats, and mitigations turned into tracked work. Use when designing a new system or feature, reviewing a design doc or architecture for security, adding an external integration, auth flow, file upload, payment path or new data store, or when the user asks for a threat model or STRIDE analysis. Not for line-by-line code review (use security-audit).
45 other projects use a version of this.
Adopted by
Most recently taken up by
- kinhluan/skillstheir own version, first seen Nov 8, 2026
- AxlZero21/Skillstheir own version, first seen Nov 8, 2026
- bepaldes/heimdall-agenttheir own version, first seen Nov 8, 2026
- SWEStash/swe-workflow-skillstheir own version, first seen Nov 8, 2026
- nledford/engineering-review-boardtheir own version, first seen Nov 3, 2026
- HyperVon/agent-guidance-kittheir own version, first seen Nov 1, 2026
Used with
Projects with it also use iac-security, container-security and 7 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
hardw00tSkilliac-security
Infrastructure-as-Code security scanning router for Terraform, CloudFormation, Kubernetes manifests, Helm, ARM/Bicep. Orchestrates Checkov, tfsec, Terrascan, KICS, kubesec, kube-linter, Polaris, cfn-lint/cfn-nag, and OPA/Conftest. Use when auditing IaC for misconfigurations, scanning Terraform plans, validating K8s security policies, checking cloud infrastructure compliance, or authoring custom policy-as-code (Rego).
Also in 4 projects that use this
vbrevikSkillcontainer-security
Scan container images, Dockerfiles, docker-compose files, and Kubernetes manifests for security misconfigurations and vulnerabilities. Uses Trivy for image/IaC scanning and Kubescape for K8s policy compliance. Falls back to regex-based Dockerfile and K8s YAML analysis when tools are unavailable. Produces STIG V-ID-tagged findings for /stig-compliance pipeline. Use when (1) reviewing Docker or K8s configuration changes, (2) scanning container images for OS-level CVEs, (3) validating K8s RBAC and NetworkPolicy configuration, (4) before deployment. Works air-gapped with pre-downloaded vulnerability database.
Also in 4 projects that use this
wgpsecSkillprompt-injection
AI/LLM 间接 Prompt 注入攻击。当目标 AI 系统会处理外部数据源(网页、文档、邮件、数据库、API 返回)时使用。覆盖间接注入、工具链劫持、RAG 投毒、数据外泄等技术。OWASP LLM Top 10 #1 漏洞类别
Also in 4 projects that use this
allanninalSkillthreat-hunting
Hunt threats using Sigma detection rules and security analysis techniques. Use when investigating security incidents, creating detection rules, or analyzing suspicious activity.
Also in 3 projects that use this
narlyseorgSkillsecure-code-review
Use when reviewing source code for security vulnerabilities, performing static analysis of a codebase, auditing code for injection flaws, authentication issues, cryptographic weaknesses, insecure deserialization, SSRF, path traversal, memory safety bugs, hardcoded secrets, or misconfigurations. Use when the user asks to find security bugs in code, assess code quality from a security perspective, or review pull requests for security implications. Use when performing dependency audits, secrets scanning, or configuration review of application source.
Also in 3 projects that use this
jefflesterSkillapi-security
API security best practices and common vulnerability prevention. Enforces security checks for authentication, input validation, SQL injection, XSS, and OWASP Top 10 vulnerabilities. Use when building or modifying APIs.
Also in 3 projects that use this
Other versions45 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 45
- briiirussell/cybersecurity-skills★ 489same name
- fr33d3m0n/skill-threat-modeling★ 347same name
- proflead/codex-skills-library★ 153same name
- hardw00t/ai-security-arsenal★ 101same name
- nahid-sparktales/agent-dispatcher★ 59same name
- mn-youssef/security-skills★ 47same name
- kumaran-is/claude-code-onboarding★ 35same name
- nimadorostkar/Claude-Skills-collection★ 33same name
- ulises-jeremias/agent-toolkit★ 19same name
- Indium-AI-Labs/indium-agentkit★ 18same name
35 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository60 other files it gives its agents.
- api-designSkill
- auth-implementationSkill
- background-jobsSkill
- building-agentsSkill
- caching-strategiesSkill
- ci-cd-pipelinesSkill
- cloud-cost-optimizationSkill
- codebase-onboardingSkill
- code-review-changesSkill
- concurrency-patternsSkill
- database-migrationsSkill
- database-schema-designSkill
- database-testingSkill
- data-pipelinesSkill
- data-privacy-retentionSkill
- dependency-upgradesSkill
- design-docsSkill
- design-systemsSkill
- dockerfilesSkill
- domain-driven-designSkill
- event-driven-architectureSkill
- file-storage-uploadsSkill
- frontend-securitySkill
- git-workflowSkill
- graphql-apisSkill
- grpc-servicesSkill
- incident-responseSkill
- infrastructure-as-codeSkill
- internationalizationSkill
- kubernetes-deploymentsSkill
- large-scale-migrationsSkill
- legacy-refactoringSkill
- llm-evalsSkill
- llm-integrationSkill
- mcp-serversSkill
- micro-frontendsSkill
- ml-experimentsSkill
- monorepo-managementSkill
- nosql-designSkill
- observabilitySkill
- orm-patternsSkill
- performance-profilingSkill
- postgres-operationsSkill
- rag-systemsSkill
- react-patternsSkill
- realtime-apisSkill
- resilience-patternsSkill
- root-cause-debuggingSkill
- search-integrationSkill
- security-auditSkill
- seo-and-ssrSkill
- sql-optimizationSkill
- system-designSkill
- test-strategySkill
- typescript-patternsSkill
- unit-testingSkill
- verify-before-doneSkill
- web-accessibilitySkill
- web-performanceSkill
- writing-skillsSkill
The file
We split this skill into the rules it gives an agent
12 rules. 0 are common, 11 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 40 edited versions we read keep these.
11
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Before a security review, audit or launch.
- Distinctive: line 16
After an incident, to find sibling threats.
- Very specific: line 18
Not for: finding bugs in a specific diff (use security-audit and code-review-changes).
- Distinctive: line 22
Scope it: Write down in 5-10 lines:
- Distinctive: line 27
If you can't answer these from the code or docs, ask the user.
- Distinctive: line 31
Keep it to the level where each arrow is a real network call or data movement.
- Distinctive: line 88
Use a simple 3x3 unless the team already has a scale:
- Distinctive: line 109
When a full model is overkill, answer in the PR description:
- Distinctive: line 113
Run the STRIDE row for the new element only.
- Distinctive: line 116
If any answer is "nothing handles it", either fix it in the PR or open a tracked item before merging.
- Distinctive: line 123
After a security incident or a pentest finding in this area.
- Distinctive: line 140
Every threat is specific, ranked, and has a response.
“Common” is measured: kept by at least 6 in 10 of the 40 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Threat Modeling
A threat model answers four questions (Adam Shostack's framework): What are we working on? What can go wrong? What are we going to do about it? Did we do a good job? The output is not a document for its own sake. It is a short list of specific threats, each with a mitigation that someone owns.
When to use
- A new service, feature or integration is being designed, or a design doc is up for review.
- A change crosses a trust boundary: new public endpoint, third-party API, webhook, file upload, new tenant or role, new data store with sensitive data.
- Before a security review, audit or launch.
- After an incident, to find sibling threats.
Not for: finding bugs in a specific diff (use security-audit and code-review-changes). Not a compliance checklist.
Workflow
- Scope it. Write down in 5-10 lines:
- What is being built and the boundary of this model (one feature, one service, the whole system).
- Assets: what an attacker wants or what must not break (customer data, credentials, money movement, admin access, availability).
- Actors: legitimate users and roles, admins, other services, third parties, and attackers (anonymous internet user, malicious tenant, compromised dependency, insider).
- Assumptions: what you are trusting (cloud provider, identity provider, network controls). Wrong assumptions are a common root cause, so list them. If you can't answer these from the code or docs, ask the user. Do not invent the architecture.
- Draw a data flow diagram (DFD) in Mermaid. Use only four element types plus boundaries:
- External entity (users, third-party systems), process (your code), data store (DBs, queues, buckets, caches), data flow (arrows, labeled with what moves and over what protocol).
- Trust boundaries as subgraphs: internet vs your edge, your services vs data tier, tenant vs tenant, your system vs third parties. Keep it to the level where each arrow is a real network call or data movement. 5-15 elements is typical for a feature.
- Apply STRIDE per element. For each element, ask the STRIDE questions that apply to its type (table below). Spend most time on flows that cross a trust boundary. Read references/stride-questions.md for the question bank.
- Write each threat specifically: who does what, to which element, with what result. "An authenticated user of tenant A changes the
tenantIdinGET /invoices/{id}and reads tenant B's invoices" is a threat. "Hackers could access data" is not. - Check existing controls. For each threat, look in the code and config for what already mitigates it (authz middleware, TLS, signed URLs, rate limits). Note gaps honestly.
- Rank each threat (see Ranking). Don't spend time ordering low-risk items.
- Decide a response for each: mitigate, eliminate (remove the feature or data), transfer (to a provider, with a contract), or accept (with a named owner who agrees). Prefer eliminating data you don't need.
- Record and track. Save the model next to the design (for example
docs/threat-models/<feature>.md): scope, DFD, threat table, decisions. Turn each mitigation into a work item. Ask the user before creating tickets in an external tracker. - Verify. Where practical, back mitigations with tests (an authz test that tenant A gets 404 for tenant B's object, a test that oversized uploads are rejected).
DFD example
flowchart LR
user([Browser user])
stripe([Payment provider])
subgraph edge [Trust boundary: public edge]
api[API service]
end
subgraph internal [Trust boundary: private network]
worker[Billing worker]
db[(Postgres: invoices)]
q[(Queue: billing-events)]
end
user -- "HTTPS: login, GET/POST invoices" --> api
api -- "SQL over TLS" --> db
api -- "publish invoice.created" --> q
q -- "consume" --> worker
worker -- "HTTPS: create charge" --> stripe
stripe -- "HTTPS webhook: charge.succeeded" --> apiThe webhook from the payment provider into the public API is a boundary crossing worth the most attention (spoofed webhooks, replay).
STRIDE
| Threat | Property violated | Example | Typical mitigations |
| Spoofing | Authentication | Forged webhook; stolen session cookie; service impersonation | Strong authN, MFA, signed webhooks, mTLS or workload identity |
| Tampering | Integrity | Modified request params, message on queue altered, unsigned artifact | Server-side validation, signatures/HMAC, TLS, DB constraints, immutable logs |
| Repudiation | Non-repudiation | User denies issuing a refund; no record of admin action | Audit log with actor, action, target, time; tamper-resistant storage |
| Information disclosure | Confidentiality | IDOR, verbose errors, secrets in logs, public bucket | Object-level authz, least privilege, encryption, redaction, private by default |
| Denial of service | Availability | Unbounded uploads, expensive queries, retry storms | Rate limits, quotas, timeouts, size limits, pagination, autoscaling limits |
| Elevation of privilege | Authorization | User calls admin endpoint; container escape; mass assignment | Deny by default, server-side role checks, allowlisted fields, sandboxing |
Which STRIDE categories apply to which element
| Element | S | T | R | I | D | E |
| External entity | yes | yes | ||||
| Process | yes | yes | yes | yes | yes | yes |
| Data store | yes | if it holds logs | yes | yes | ||
| Data flow | yes | yes | yes |
This is the classic STRIDE-per-element mapping. Use it to avoid both skipping categories and asking nonsensical ones.
Ranking
Use a simple 3x3 unless the team already has a scale:
| Impact low | Impact medium | Impact high | |
| Likelihood high | Medium | High | Critical |
| Likelihood medium | Low | Medium | High |
| Likelihood low | Low | Low | Medium |
- Likelihood: how reachable is it (anonymous internet vs authenticated insider), how much skill is needed, is it already exploited in the wild for this pattern.
- Impact: data exposed (whose, how much), money, safety, regulatory, blast radius across tenants.
- Critical and High need a mitigation before launch or an explicit, owned acceptance.
Threat table template
| ID | Element / flow | STRIDE | Threat | Existing controls | L | I | Risk | Response | Mitigation / work item | Owner |
| T1 | Webhook: provider to API | S, T | Attacker posts forged charge.succeeded, invoice marked paid | None | H | H | Critical | Mitigate | Verify provider signature and timestamp; reject replays older than 5 min; idempotency on event ID | |
| T2 | API: GET /invoices/{id} | I, E | User of tenant A reads tenant B invoice by ID | Auth required | M | H | High | Mitigate | Scope every query by tenant from the session, not the request; add cross-tenant test |
Lightweight version (single PR or small feature)
When a full model is overkill, answer in the PR description:
- What does this change expose or accept that it didn't before (new input, endpoint, permission, data)?
- Which trust boundary does it cross?
- Run the STRIDE row for the new element only.
- List the 1-3 most likely threats and what in the diff handles each.
If any answer is "nothing handles it", either fix it in the PR or open a tracked item before merging.
When to revisit
- A new trust boundary, data store, external integration or role is added.
- Authentication or authorization logic changes.
- Sensitive data types are added (payments, health, government IDs, credentials).
- After a security incident or a pentest finding in this area.
- At least once a year for critical systems.
Anti-patterns
- Generic threats: "SQL injection", "DDoS" with no element and no scenario. Tie each threat to an element and a concrete attacker action.
- Boiling the ocean: modeling the whole company in one sitting. Scope to the change; models can be linked.
- Architecture diagram instead of a DFD: boxes for every class or pod. Show data movement and boundaries only.
- Threats without owners: a table that nobody tracks. Every Critical/High needs a work item and an owner.
- Ignoring non-internet attackers: malicious tenants, compromised dependencies, CI systems and insiders are frequent real attackers.
- One-time exercise: a model that is never updated drifts from reality within months.
- Mitigation by assumption: "the network is private" or "the frontend validates it" are not controls.
Done when
- Scope, assets, actors and assumptions are written down.
- A DFD exists with trust boundaries, and every boundary-crossing flow has been through STRIDE.
- Every threat is specific, ranked, and has a response; every Critical/High has a mitigation or an owned acceptance.
- Mitigations exist as tracked work items (created with the user's OK) and the model is saved next to the design.
References
- references/stride-questions.md — read during step 3 for the question bank per STRIDE category and element type.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

