secops
Security review, dependency audit and scanner choice: routes each artifact to its scanner (Ruff S for Python, gitleaks for secrets, pip-audit for the Python lock, osv-scanner for JS, R and other lockfiles, ShellCheck for shell), names each finding's rule and CWE, and sets the layer each check runs at (edit, commit, CI). Use when reviewing code or a file for security problems (load it before reading the code), auditing dependencies for known vulnerabilities, or choosing a repo's security checks.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-12
- Stars
- ★ 6
- Forks
- 1
01 前言 Front Matter
- name
- secops
- description
- Security review, dependency audit and scanner choice: routes each artifact to its scanner (Ruff S for Python, gitleaks for secrets, pip-audit for the Python lock, osv-scanner for JS, R and other lockfiles, ShellCheck for shell), names each finding's rule and CWE, and sets the layer each check runs at (edit, commit, CI). Use when reviewing code or a file for security problems (load it before reading the code), auditing dependencies for known vulnerabilities, or choosing a repo's security checks.
02 资源文件 1
- 脚本scripts/scan-untrusted.sh24.9 KB
03 SKILL.md 正文
SecOps router
Pick the check for the artifact, run it at the earliest layer that can block, and fail loud: a scanner that did not run reports UNKNOWN, never zero findings. This skill routes; the tools do the work.
Which scanner
| Artifact | Scanner | How |
|---|---|---|
| Python source | Ruff S rules (flake8-bandit) | ruff check --select S <paths>; suppress only per site, # noqa: Sxxx # why: … |
| Secrets in any file or commit | gitleaks | gitleaks detect --redact --exit-code 1 --log-opts="--all"; ignores are reviewed fingerprints in .gitleaksignore, never path or regex allowlists |
| Python dependencies (uv / pip lock) | pip-audit (uv audit once it is GA) |
uv export --frozen --no-emit-workspace --no-emit-project -o req.txt then pip-audit --disable-pip --require-hashes --strict -r req.txt; each ignore carries an ID, a why and an expiry date |
Other lockfiles: JS (package-lock.json, pnpm-lock.yaml, yarn.lock, bun.lock), R (renv.lock), Go (go.mod), Rust (Cargo.lock), Java (pom.xml, gradle.lockfile), Ruby (Gemfile.lock), PHP (composer.lock), .NET (packages.lock.json) |
osv-scanner | osv-scanner scan -L <file> |
| Shell scripts | ShellCheck | shellcheck --enable=check-set-e-suppressed <files> |
| GitHub Actions and the lock itself | Dependabot | github-actions + the package ecosystem, weekly, with a cooldown |
Reviewing a file
- Run each scanner the file's table row names, plus gitleaks. If one cannot run here, say so (UNKNOWN) and review by reading.
For code you did not write (a branch, a PR, a fetched repo), run this skill's
scripts/scan-untrusted.sh --base <trusted ref> [--head <ref>] <repo>instead, on a full (not shallow) clone; it needs git, jq, python3 and the scanners on PATH. The repo controls its scanner config, ignore files, inline suppressions, file names, attributes and history; the script keeps each from hiding a finding inbase..head. Exit 0 is clean, 1 findings or suppressors, 2 an error, 3 a scanner could not run; read every UNKNOWN line, since exit 1 does not show them. Exit 0 covers Python, shell, the lockfiles above and secrets in every file; JS/TS, workflow YAML, build files (Dockerfile, Makefile, justfile, Procfile, Gemfile, Rakefile, Vagrantfile, Jenkinsfile) and other languages are not scanned, so read those, and any file a changed script runs whose name has an extension no scanner reads or is allowlisted data (the script's header lists the names). Judge each SUPPRESSOR line as a finding, send a Python lockfile it marks UNKNOWN to pip-audit as above, and read each commit (git log -p <base>..<head>) for what no scanner sees. - Report each finding with its rule and CWE, the line, and the fix at the source. For example,
subprocess.run(cmd, shell=True)with interpolated input is Ruff S602 (CWE-78, command injection); the fix is an argv list without a shell, not an escape. - Then check what scanners miss: validation at trust boundaries (
Skill(defense-in-depth)), secret handling (Skill(secrets-management)) and model output used as input (Skill(llm-output-safety)).
Which layer
| Layer | What runs | Blocks? |
|---|---|---|
| Edit | the language formatter/linter hook (findings reach the model) | no — advisory |
| Commit | a staged-file check: high-signal Ruff S rules + a secret-literal regex; gitleaks protect --staged |
yes — exit 2, with an auditable bypass marker; a best-effort guardrail, not a boundary |
| CI | full Ruff S over the gated paths, gitleaks over full history, the hashed dependency audit | yes — the merge gate |
| Weekly | the same CI jobs on a schedule, plus Dependabot | surfaces new advisories without a push |
Pin every scanner (version and checksum, or a commit SHA), take it from the project's locked environment, and never run a binary the scanned repo ships.
Standards to cite
Cite by name and edition, not by guessed IDs: OWASP ASVS 5.0 for verification requirements, OWASP Top 10:2025 for risk classes, NIST SSDF (SP 800-218) for the practice areas. Do not cite SSDF 1.2 practice IDs: 1.2 was still a draft when this was written (2026-10), so its IDs may change before it is final.
Related
Skill(secrets-management)— storing, injecting and rotating secrets; secret scanning set-up.Skill(defense-in-depth)— validation at trust boundaries.Skill(llm-output-safety)— model output is untrusted input.
04 同仓库更多 Skills
deploy-helper
You can use this to help with deploy stuff, deploying, deployments, releases, shipping, pushing to prod, going live, rollouts.
writing-for-agents
Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.
verify-plan
Slash entry for plan verification: runs plan-verification on an existing AA-MA plan, writes [task]-verification.md, and with --iterate loops until the plan converges. Use when the user types /verify-plan or wants the verification report saved.
verify-impl
Post-impl adversarial review symmetric to /verify-plan. Dispatches up to 5 parallel audit agents (code-reviewer, security-auditor, tdd-sequence-auditor, context7-evidence-auditor, future-proofing-auditor) based on the milestone's plan-declared Audit-Profile. CRITICAL findings surface via AskUserQuestion accept/dispute/defer panel before §7.3 user authorization. Introduced in v0.8.0 per ADR-0005. Invoked by Phase 6.8 of /execute-aa-ma-milestone.
understand-codebase
Onboard to a new, inherited, or shared codebase. Read it, understand it, map it, and learn its conventions, versioning, tests, tech stack, rules (AGENTS.md / CLAUDE.md / .cursorrules / etc.), build/run/CI, integrations, security posture, and repo health — then produce an honest pros/cons verdict, a "contribute safely" playbook, and an "add a feature" playbook, written to ONBOARDING.md at the repo root plus a .claude/onboarding/ set of deep-dives — and optionally author an AGENTS.md if one is missing, or review and propose improvements to an existing one. Tiered (Quick / Standard / Deep). Reuses codemem (index + diagrams), gsd-map-codebase, system-mapping, code-intelligence, impact-analysis rather than re-implementing them; Deep tier runs a TeamCreate agent-team. Keywords: new codebase, shared codebase, inherited code, onboard, understand this repo, how do I contribute, how do I add a feature, ramp up, get oriented, ONBOARDING.md, AGENTS.md, codebase walkthrough, joining a project.
token-compression
Output token compression for AA-MA workflows. Reduces response tokens by 40-75% while preserving full technical accuracy. Three intensity levels mapped to execution modes: lite (HITL), full (general), ultra (AFK). Auto-activates during AA-MA execution based on task Mode field. Manual activation via /compress lite|full|ultra.