AGENT SKILL

audit-security

暂无简介

License 许可
MIT
最近更新
2026-10-22
Stars
★ 1
Forks
0

02 资源文件 1

03 SKILL.md 正文

Security review

This is a code review with a threat model. It reads code and configuration. It does not run exploits, scanners, or anything against a live system.

Scope

Default to the change plus what the change can reach:

git diff $(git merge-base HEAD origin/main)
git diff --stat $(git merge-base HEAD origin/main)
git status --short

For a full-repo audit, say so and work through references/checklist.md area by area, because a whole-codebase pass without a checklist silently becomes a sample.

Reaching beyond the diff matters: a new function that builds a query string is only a vulnerability if something untrusted reaches it. Trace each new input backward to its source and each new sink backward to its callers.

Always check these

Committed secrets. Highest frequency, lowest effort to find, and the one finding with a remediation step people forget.

git diff $(git merge-base HEAD origin/main) | rg -n '(?i)(api[_-]?key|secret|password|passwd|token|private[_-]key|bearer|authorization:)\s*[=:]'
git log --all --oneline -- '**/.env' '**/.env.*' '**/*.pem' '**/*.p12' '**/id_rsa*'
git ls-files | rg '(^|/)\.env($|\.)' 

A secret that reached a remote is compromised even after the commit is removed, because clones and forks keep it. The finding is "rotate this credential", not "delete this line". Say that.

Check that fixtures and examples use values that look synthetic and say they are synthetic. A realistic-looking fake key gets found by a scanner and rotated in a panic.

Authorization on every new or changed route. Authentication proves who the caller is. Authorization decides what this caller may touch, and it is the one that gets skipped.

For each endpoint in the diff, answer both:

  1. Which gate requires a logged-in caller? Name it. If the answer is a global middleware, confirm this route is actually mounted inside it rather than assuming.
  2. Does the query filter by the caller's own scope? A handler that takes an id from the path and looks it up without a tenant or owner filter lets any authenticated user read any record. This is the most common serious finding in real code.
rg -n '(router|app)\.(get|post|put|patch|delete)\(' --glob '!*test*'
rg -n '@(app|router)\.(get|post|put|patch|delete)\(' --glob '*.py'

Injection. Untrusted input reaching an interpreter: SQL, shell, path, template, LDAP, or a NoSQL query document.

rg -n 'execute\(|raw\(|query\(' -A2 | rg -n '\+|\$\{|%s|f["'"'"']'
rg -n 'exec|execSync|spawn|system|popen|eval|Function\(' --glob '!*test*'

String concatenation into a query or a command is the finding. Parameterized queries and argument arrays are the fix. For paths, the fix is resolving and then confirming the result is still inside the intended directory, not stripping .. from the input.

Sensitive data in logs and errors. Grep the diff for logging calls that take a whole request, user, or payload object. Whole-object logging is how passwords, tokens, and personal data end up in a log aggregator with much weaker access control than the database. Also check that error responses to the client do not carry stack traces, query text, or internal hostnames.

Dependencies.

npm audit --omit=dev     # or: pnpm audit, yarn npm audit
pip-audit                 # or: uv pip audit

Report only what the change introduced or what is both reachable and high severity. A list of 300 transitive advisories is noise that buries the two that matter.

Then work the checklist

references/checklist.md covers the rest, organized by OWASP category with detection commands: SSRF, deserialization, CORS and cookie flags, cryptography and password storage, rate limiting on auth endpoints, file upload handling, XSS sinks, redirect validation, mass assignment, and security headers.

Read the whole file for a full audit. For a diff review, read the sections the diff touches.

Report exploitability

A finding named only by its category is unactionable. For each one give:

  • path/to/file.ts:42 and the category.
  • Who: an anonymous caller, any authenticated user, a user in another tenant, or someone who already has local access. The difference between the first two is usually the difference between urgent and scheduled.
  • With what: the concrete input. An actual example string, not "malicious input".
  • To get what: read another tenant's data, execute a command, escalate to admin, deny service.
  • Fix: the specific change, with the parameterized or validated form written out.

Then rank by that, not by a scanner's severity field. An SQL injection behind an admin-only route and an IDOR on a public endpoint are not the same risk, whatever the CVSS table says.

Try to refute each finding before reporting it: look for the validation upstream, the ORM that already parameterizes, the middleware that already gates, the type that makes the input unreachable. Say which findings you confirmed by tracing the full path and which remain plausible but unconfirmed.

Stay inside the lines

  • Read code and configuration. Do not run exploits, port scans, or traffic against any host.
  • Do not include a working exploit in the report. The input that demonstrates the path is enough.
  • Do not print a discovered secret. Give its location and its type, and say to rotate it.
  • If a finding needs a live check to confirm, say what check is needed and leave it to someone with authorization to run it.

04 同仓库更多 Skills

tounsils
tounsils/claude-code-skills

triage-ci

Diagnose a failing CI run by finding the first real failure rather than the last log line, classifying it as defect, flake, infrastructure, or config drift, and fixing the cause without disabling the check. Use when asked to fix the build, fix CI, find out why CI is failing, look at a failing run, or work out what is actually wrong with a red build, and when a pipeline or GitHub Actions run fails, a CI log needs reading, or tests pass locally but fail only in CI.

★ 1
tounsils
tounsils/claude-code-skills

test-gaps

Find the untested branches that matter, write tests that can actually fail, and report pass, fail, and skip counts honestly. Use when asked to add tests, write tests for this, improve coverage, find test gaps, check what is untested, or when a change needs test coverage before it ships.

★ 1
tounsils
tounsils/claude-code-skills

ship-pr

Turn a finished change into a commit message and pull request derived from the actual diff, with a pre-submit checklist covering auth gates, secrets, migrations, and breaking changes. Use when asked to commit this, write a commit message, open a PR, raise a pull request, write the PR description, or get this ready to push.

★ 1
tounsils
tounsils/claude-code-skills

root-cause

Debug by reproducing first, isolating the mechanism, then fixing the cause rather than the symptom, and keeping the reproduction as a regression test. Use when asked to debug this, fix this bug, find out why something happens, investigate a failure, or work out what is going wrong, and when a test fails intermittently or flakily, behavior differs between environments, or someone proposes raising a timeout, adding a retry, or skipping a test to make a problem go away.

★ 1
tounsils
tounsils/claude-code-skills

review-diff

Review uncommitted or branch-local changes for defects, ranked by severity, with a concrete failure scenario behind every finding. Use when asked to review code, review a diff, review my changes, check this before I commit, look over this branch, or do a pre-PR pass. Reviews the change, not the whole repository.

★ 1
tounsils
tounsils/claude-code-skills

restructure

暂无简介

★ 1