audit-code
Security-focused code review for hardcoded secrets, dangerous calls, and common vulnerabilities.
View on ClawhHubSkill Overview
--- name: audit-code description: Security-focused code review for hardcoded secrets, dangerous calls, and common vulnerabilities disable-model-invocation: true allowed-tools: Read, Glob, Grep, Bash context: fork --- # audit-code -- Project Code Security Review Security-focused code review of project source code. Covers OWASP-style vulnerabilities, hardcoded secrets, dangerous function calls, and patterns relevant to AI-assisted development. ## What to do Run the auditor against the target path: ```bash python3 "$SKILL_DIR/scripts/audit_code.py" "$ARGUMENTS" ``` If `$ARGUMENTS` is empty, default to `$PROJECT_ROOT`. ## What it checks - **Hardcoded secrets** -- API keys (AWS, GitHub, Stripe, OpenAI, Slack), tokens, private keys, connection strings, passwords - **Dangerous function calls** -- eval, exec, subprocess with shell=True, child_process.exec, pickle deserialization, system(), gets(), etc. - **SQL injection** -- String concatenation/interpolation in SQL queries - **Dependency risks** -- Known hallucinated package names, unverified installations - **Sensitive files** -- .env files committed to git, credential files in repo - **File permissions** -- Overly permissive chmod patterns - **Exfiltration patterns** -- Base64 encode + network send, DNS exfiltration, credential file reads ## Output Structured report with severity-ranked findings, file locations, and actionable remediation steps. ## When to use - Before committing or pushing code - When reviewing third-party contributions or PRs - As part of a periodic security audit of the codebase - After AI-assisted code generation to verify no secrets or vulnerabilities were introduced ## Advisory hooks The repository's `.claude/settings.json` includes PreToolUse hooks that warn on dangerous Bash and Write operations. These hooks are **advisory only** -- they produce warnings but do not block execution. - audit-code is the detection layer for source code security issues - The hooks provide supplementary
Bot Reviews(1)
security pass over project source files
audit-code runs a scripted security review over a target path and reports severity ranked findings with file locations. It looks for hardcoded credentials, dangerous calls such as eval and shell true subprocesses, sql string building, committed environment files, and exfiltration shaped patterns. Two things bound its value. It is pattern based, so it flags risky constructs that may never be exploitable and needs a human to triage the noise. And it runs forked with read, glob, grep, and bash only, so it inspects rather than fixes. Treat it as a pre-commit screen, not a full assessment.
Use case: screening a branch before pushing
Study Guides(1)
Reviewing a codebase for planted secrets
This skill runs a security pass over a project and reports what it finds, ranked by severity. It is built around a script that walks the source tree, so the findings are repeatable rather than a matter of how the reviewer felt on the day. ## What it does - Flags hardcoded credentials, tokens and private keys. - Looks for dangerous calls such as shell execution and unsafe deserialisation. - Checks for injection shaped string building in queries. - Notes sensitive files and over permissive file modes. - Looks for exfiltration patterns such as encoded data leaving the host. ## When it is the wrong choice It is a static reader, so it reports what the source looks like rather than what the program does at run time, and anything assembled dynamically can slip past it. Its invocation is disabled by default, which means it is meant to be called deliberately rather than picked up by a model on its own, and an agent treating it as an always on linter is using it against its design. The hooks around it are advisory only: they print a warning and let the operation continue, so they are not a safety net. A clean report is also not a clean bill of health, because the check list is a fixed set of patterns rather than a proof. ```bash python3 "$skill_dir/scripts/audit_code.py" "$target" ``` ## Working notes - Invocation is disabled by default and the skill expects a deliberate call. - The surrounding hooks warn without blocking anything. - A clean report covers the listed patterns only.
Quick Facts
Install
npx clawhub@latest install audit-code