agentleFS
ToddGBensonToddGBenson/keel/.claude/skills/threat-modeling/SKILL.md

threat-modeling

Skill0 starsChanged 3 months agoApache-2.0View on GitHub

Run STRIDE threat modeling on a change delta and produce dispositioned threats with allocated controls. Use when running G2 design review, writing or reviewing a threat model, assessing what can go wrong with a design, or when a story is flagged security-relevant. Also use when asked to identify attack surface, trust boundaries, or security risks in a proposed change.

47 other projects use a version of this.

Adopted by

Most recently taken up by

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.
  • hardw00tSkill

    iac-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

  • vbrevikSkill

    container-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

  • wgpsecSkill

    prompt-injection

    AI/LLM 间接 Prompt 注入攻击。当目标 AI 系统会处理外部数据源(网页、文档、邮件、数据库、API 返回)时使用。覆盖间接注入、工具链劫持、RAG 投毒、数据外泄等技术。OWASP LLM Top 10 #1 漏洞类别

    Also in 4 projects that use this

  • allanninalSkill

    threat-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

  • jx1100370217Skill

    security-hardening

    Harden OpenClaw security configuration. Use when: (1) Setting up security for new OpenClaw installation, (2) Configuring exec approvals and allowlists, (3) Securing gateway access, (4) Setting up tool policies, (5) User asks about OpenClaw security or hardening.

    Also in 3 projects that use this

  • jefflesterSkill

    api-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

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 6 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 42 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If the change touches an existing boundary, re-examine that boundary.

    line 17
  2. Distinctive:

    Every trust boundary crossing examined

    line 90
  3. Distinctive:

    Every STRIDE category considered against every boundary — *even where the answer is "none", record that you looked*

    line 91
  4. Distinctive:

    Every mitigation names a component and a verification method

    line 94
  5. Distinctive:

    Every acceptance has approval, POA&M entry, and expiry

    line 95
  6. Distinctive:

    Every threat model rests on assumptions.

    line 101

“Common” is measured: kept by at least 6 in 10 of the 42 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Threat modeling

The method behind G2. Consumers: architect, security-engineer, /design, process/gates/g2-design.md, docs/templates/threat-model.md.

Model the delta, not the system

Full-system threat models go stale within a sprint and stop being read. Model what this change adds or alters — the new boundary crossing, the new data path, the new privilege. Delta models stay true because they are small enough to keep true.

If the change touches an existing boundary, re-examine that boundary. If it does not, do not re-model it.

The four questions

Shostack's frame. Answer them in order; skipping to controls produces controls for threats nobody established.

1. What are we building?

Draw the data flow of the delta with trust boundaries marked. A boundary is anywhere data crosses between components with different privilege, ownership, or trustworthiness.

[User] ──HTTPS──▶ ║ [API] ──▶ [DraftService] ──▶ ║ [Postgres]
                  ║ boundary: untrusted → app    ║ boundary: app → data

Then name:

  • Assets — what is worth attacking. Data, credentials, availability, the integrity of a decision.
  • Actors — legitimate users and their rights; adversaries and their plausible capability.

Be realistic about adversaries. A nation-state threat model for an internal CRUD app produces a long document and no actionable controls.

2. What can go wrong?

STRIDE, applied at each trust boundary crossing. Walking the boundaries is what makes this systematic rather than a brainstorm.

ThreatThe questionCommon real finding
SpoofingCan an actor claim an identity they do not hold?Session fixation, token replay, missing origin validation
TamperingCan data be modified in transit, at rest, or in the pipeline?Unsigned artifacts, mutable tags, missing integrity check
RepudiationCan an actor deny an action we cannot prove?Missing audit event, log without actor identity
Information disclosureCan data reach an unauthorized party?IDOR — still the most common finding in mature code. Also over-broad responses, error messages, logs, timing
Denial of serviceCan availability be exhausted, by whom, at what cost to them?Unbounded query, no rate limit, amplification
Elevation of privilegeCan an actor gain rights beyond their grant?Authz on the route not the object, confused deputy, path traversal

Record each as: threat · category · attacker · precondition · impact · likelihood · severity.

The precondition column does the most work. "An attacker reads another user's draft" is vague; "any authenticated user can read any draft by changing the ID, no other precondition" is a finding with a severity you can defend.

If the change is AI-relevant, also consider prompt injection (direct and indirect), insecure output handling, and tool-call abuse — but cross-reference the AI Impact Assessment rather than duplicating it. See the ai-impact-assessment skill.

3. What are we going to do about it?

Every threat gets one of four dispositions. An undispositioned threat fails G2.

DispositionRequires
MitigateA control, the file or component implementing it, and the verification method
TransferWho now carries it, under what contract
AcceptHuman approval + POA&M entry + expiry date + named compensating control
EliminateRemove the feature, or do not collect the data

Two rules that decide most G2 rejections:

"Implemented in the application layer" is not an allocation. Name the file. A developer cannot act on a vague allocation and QA cannot verify it.

A mitigation with no verification method is an intention. "We will validate input" stays an intention until someone names the test that proves it. That test is what G4 looks for.

4. Did we do a good job?

  • Every trust boundary crossing examined
  • Every STRIDE category considered against every boundary — even where the answer is "none", record that you looked
  • Every threat dispositioned
  • Every mitigation names a component and a verification method
  • Every acceptance has approval, POA&M entry, and expiry
  • Attack surface change identified and justified (SA-15(5))
  • Reviewed by an identity other than the author

Assumptions — state them as falsifiable

Every threat model rests on assumptions. Write them as things that could be false, because when one breaks the model must be re-run and nobody will notice unless it was written down.

"The API gateway terminates TLS and rejects unauthenticated requests." "The database is not directly reachable from the internet." "Session tokens are rotated on privilege change."

The negative-case handoff

For every control you allocate, the verification method should be a test proving the control denies. A test showing an authorized user succeeds proves the feature works. Only the denial test proves the control works, and only it is SA-11 evidence.

Say this explicitly in the allocation so the developer writes the right test.

Output

docs/templates/threat-model.md → evidence/<issue>/g2/threat-model.md.

Controls

SA-11(2) (threat and vulnerability analysis) · SA-8 (security engineering principles) · SA-15(5) (attack surface reduction) · RA-3 (risk assessment) · PL-8.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.