agentleFS
pabloleonalcaidepabloleonalcaide/development-skills/skills/security-hardening/SKILL.md

security-hardening

Skill1 starsChanged 36 days agoMITView on GitHub

Threat-model a change and harden it before it ships — trust boundaries, authn/authz, input validation, secrets, SSRF, destructive operations, rate limits and supply chain. Use when a change touches authentication or authorization, payments, user or external input, webhooks, file paths, outbound requests, secrets or new dependencies, or when the user asks for a security review of a design. Invoked by /develop when the blueprint declares security impact.

25 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use coordinate, incident-response and 6 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.
  • swyxioSkill

    coordinate

    Coordinate focused Luna helpers for bounded work and Astra advisers for difficult design questions while doing the main work yourself.

    Also in 3 projects that use this

  • AnthropicSkill

    incident-response

    Run an incident response workflow — triage, communicate, and write postmortem. Trigger with "we have an incident", "production is down", an alert that needs severity assessment, a status update mid-incident, or when writing a blameless postmortem after resolution.

    Also in 5 projects that use this

  • barisariburnuSkill

    performance-optimization

    Complete performance optimization guide for Next.js applications including frontend, backend, database, caching, and general optimization strategies. Use when improving performance, reducing bundle size, optimizing queries, or implementing caching.

    Also in 4 projects that use this

  • GitHubSkill

    accessibility-audit

    Audits actual components and routes against applicable WCAG 2.2 A/AA criteria using consumer-owned design-system evidence and repository tools. Use when asked for an accessibility audit, a11y check, keyboard or focus review, contrast check, or screen-reader verification.

    Also in 3 projects that use this

  • shanggqmSkill

    data-analysis

    数据分析技能,提供结构化的数据查询、统计分析和报告生成工作流。当用户需要查询数据库、进行数据统计分析、生成分析报告时使用。按规范输出原始数据、计算结果、Markdown报告和HTML可视化报告。

    Also in 3 projects that use this

  • AnthropicSkill

    documentation

    Write and maintain technical documentation. Trigger with "write docs for", "document this", "create a README", "write a runbook", "onboarding guide", or when the user needs help with any form of technical writing — API docs, architecture docs, or operational runbooks.

    Also in 3 projects that use this

The file

Files
SKILL.md

Security hardening

Security is a design property, not a review step: decide where trust ends before writing the code that crosses that line. This skill runs at design time (phase B/C of develop) and leaves a checklist that the hardening reviewers verify against the diff.

When NOT to use

  • Dependency CVE alerts — that is a dependency-maintenance task, not a design review.
  • Changes with no new input, output, permission or dependency (pure refactors, copy changes).
  • As a substitute for a post-hoc diff review tool: this skill shapes the design; a diff review checks the result.

Process

  1. Map the trust boundaries. List every place data crosses from a less-trusted to a more-trusted zone: HTTP request → handler, webhook → handler, queue message → consumer, file upload → storage, LLM output → code or tool call, another process's arguments or env → your logic. Rule: trust follows who wrote a value, not which channel delivered it — a value read from your own database that a user wrote is still user input.
  2. STRIDE each boundary — one row per boundary, only the threats that apply:

    BoundarySpoofingTamperingRepudiationInfo disclosureDoSElevation
  3. Write the abuse cases as the first tests. For each real threat, a test that plays the attacker: another tenant's id, a forged signature, a ../ path, an oversized payload, a replayed request. These go through the same seams as the feature tests.
  4. Classify the actions in the change into three tiers and put them in the blueprint:
    • Always — validate at the boundary, check authorization on the resource (not just authentication), parameterize queries, encode output, log security events without secrets.
    • Ask first — new dependency, new outbound host, new permission or role, schema change on auth data, disabling a check "temporarily".
    • Never — secrets in code/logs/URLs, eval on external input, trusting client-side checks, disabling TLS verification, audit fix --force.
  5. Apply the controls. Open REFERENCE.md at the section you need when you reach that code, not before.
  6. Hand the checklist to hardening. The Verification list below goes into the Standards reviewer's input.

Common Rationalizations

RationalizationReality
"It's an internal endpoint"Internal networks get breached; SSRF turns every internal endpoint into an external one.
"The frontend already validates it"The frontend is the attacker's code. Validate at the server boundary.
"The user is authenticated, that's enough"Authentication says who; authorization says whether this user may touch this resource. IDOR lives in the gap.
"I'll remove the secret from git later"Once pushed it is leaked. Rotate first, then purge history.
"It's just a dev dependency"Install scripts run on every machine and CI runner that installs it.

Red Flags

  • A handler reads an id from the request and loads the resource without checking ownership.
  • A string concatenated into a query, shell command, path or URL.
  • A webhook handler that does not verify the signature before parsing.
  • Secrets, tokens or personal data in a log line, error message or URL.
  • A catch that swallows an authorization error and continues.
  • A new dependency added without checking its install scripts and maintenance.

Verification

  • Every trust boundary in the change is listed with its applicable threats
  • Each real threat has an abuse-case test that fails without the control
  • Authorization is checked on the resource at every new or changed entry point
  • No secret or personal data in code, logs, errors or URLs (grep the diff)
  • Any "Ask first" action was asked and the answer recorded in the blueprint

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.