agentleFS
jamestorrevillasjamestorrevillas/dev-skills/.github/skills/threat-modeling/SKILL.md

threat-modeling

Skill4 starsChanged 9 months agoMITView on GitHub

Use this skill when identifying security threats, designing secure systems, thinking like an attacker, performing security assessments, or applying STRIDE threat modeling. Trigger on keywords: threat model, security design, attack surface, STRIDE, vulnerabilities by design, security review, who can attack this, what could go wrong security-wise.

54 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 10 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

  • narlyseorgSkill

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

  • testified-ossSkill

    exploratory-testing

    Guide exploratory testing sessions including charter creation, session-based testing, heuristics application, and finding documentation. Use when planning exploratory testing, conducting test sessions, or documenting discoveries.

    Also in 3 projects that use this

The file

Files
SKILL.md

Threat Modeling

Core Mindset

Think like an attacker, build like a defender.

Threat modeling is done BEFORE building, not after. Security retrofitted is always weaker and more expensive than security designed in.


The STRIDE Framework

For every component, ask: can an attacker do this?

ThreatDefinitionExample
SpoofingPretend to be someone elseForged JWT token
TamperingModify data in transit or at restSQL injection, request body modification
RepudiationDeny performing an actionNo audit log of who deleted a record
Information DisclosureAccess data they shouldn'tOver-fetching API, verbose error messages
Denial of ServiceMake system unavailableNo rate limiting on auth endpoint
Elevation of PrivilegeGain unauthorized access levelIDOR (accessing other users' data)

Threat Modeling Process

1. DEFINE SCOPE       — What are we modeling? (feature, service, system)
2. IDENTIFY ASSETS    — What are we protecting? (data, services, credentials)
3. DRAW DATA FLOWS    — How does data move through the system?
4. IDENTIFY THREATS   — Apply STRIDE to each component and data flow
5. ASSESS RISK        — Likelihood × Impact for each threat
6. MITIGATE           — For each high-risk threat, define a control
7. VERIFY             — Confirm controls are implemented and working

Attack Surface Analysis

For any new feature, identify:

  • Entry points — Where does user input enter the system?
  • Trust boundaries — Where does data cross privilege levels?
  • Data stores — What sensitive data is stored and where?
  • External dependencies — What third-party services are called?

OWASP Top 10 (Quick Reference)

#ThreatQuick Check
A01Broken Access ControlIs every endpoint checking authorization?
A02Cryptographic FailuresIs sensitive data encrypted at rest and in transit?
A03InjectionAre all queries parameterized? All inputs validated?
A04Insecure DesignWas security considered in the design phase?
A05Security MisconfigurationAre defaults hardened? Are secrets in env vars?
A06Vulnerable ComponentsAre dependencies up to date? Any known CVEs?
A07Auth FailuresIs auth implemented correctly? Session management secure?
A08Software IntegrityAre supply chain and build pipeline trusted?
A09Logging FailuresAre security events logged? Are logs protected?
A10SSRFCan users cause server to make requests to internal resources?

Security Design Principles

  • Least Privilege — Every component gets only the permissions it needs
  • Defense in Depth — Multiple layers of security, no single point of failure
  • Fail Secure — When something breaks, it should fail closed (deny access), not open
  • Zero Trust — Never trust, always verify — even internal services
  • Minimize Attack Surface — Less exposed = less exploitable

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.