| name | security-audit |
| description | This skill should be used when the user says "security audit", "check for vulnerabilities", "security review", "harden project", "dependency audit", "credential scan", "check for secrets", "scan for secrets", "OWASP review", "security checklist", "audit dependencies", "find vulnerabilities", or wants to review their project for security issues, exposed credentials, or vulnerable dependencies. |
| version | 0.1.0 |
Security Audit
Systematic security review of a project covering dependency vulnerabilities, credential exposure, common code vulnerabilities, and configuration hardening.
When to Use
- Before a release or deployment
- After adding new dependencies
- When onboarding to a new codebase
- Periodic security reviews
- After receiving a vulnerability report
Audit Checklist
1. Credential and Secret Scanning
Check for exposed secrets in the codebase:
git grep -n -i -E '(api_key|apikey|secret|password|token|credential|private_key)\s*[:=]' -- ':!*.md' ':!*.lock'
git ls-files | grep -i '\.env'
for f in .env .env.local credentials.json secrets.yaml; do
git check-ignore "$f" 2>/dev/null || echo "WARNING: $f not in .gitignore"
done
Files that must never be committed:
.env, .env.* (environment variables)
credentials.json, service-account.json (cloud credentials)
*.pem, *.key (private keys)
*.p12, *.pfx (certificates with private keys)
2. Dependency Vulnerability Scan
Python:
uv run pip-audit
JavaScript/TypeScript:
bun pm audit
npm audit --omit=dev
Go:
govulncheck ./...
Review results against the severity rubric (shared with the
dependency-auditor agent):
- Critical: exploitable now or actively exploited (leaked live credential,
known-exploited CVE in a reachable path). Must fix before release; blocks
release-prep.
- High: known vulnerability with a plausible attack path. Fix before the next
release.
- Medium: vulnerability with mitigating factors, or a major-version lag on a
security-relevant package. Fix within the sprint.
- Low: outdated without known vulnerabilities; license concerns to review.
Track in backlog.
3. Code Vulnerability Patterns
Scan for common vulnerability patterns:
SQL Injection:
grep -rn 'f".*SELECT\|f".*INSERT\|f".*UPDATE\|f".*DELETE' --include='*.py'
grep -rn "format.*SELECT\|format.*INSERT" --include='*.py'
Command Injection:
grep -rn 'shell=True\|os\.system\|subprocess\.call.*shell' --include='*.py'
grep -rn 'exec(\|eval(' --include='*.py' --include='*.js' --include='*.ts'
XSS (Cross-Site Scripting):
grep -rn 'dangerouslySetInnerHTML\|innerHTML\s*=' --include='*.tsx' --include='*.jsx' --include='*.ts' --include='*.js'
Path Traversal:
grep -rn 'open(.*\+\|os\.path\.join.*input\|req\.\(params\|query\|body\)' --include='*.py' --include='*.js'
4. Authentication and Authorization
Review:
5. Configuration Hardening
6. Docker Security (if applicable)
7. CI/CD Security
Output Format
Present findings as a prioritized list:
## Security Audit Results
### Critical (must fix)
1. [CRED] API key found in src/config.py:42 - move to environment variable
2. [DEP] lodash 4.17.20 has prototype pollution (CVE-2021-23337)
### High (fix before release)
3. [CODE] SQL injection risk in src/db.py:88 - use parameterized queries
### Medium (fix within sprint)
4. [CONFIG] CORS allows * origin in production config
### Low (backlog)
5. [STYLE] Error responses include stack traces in non-debug mode
### Passed
- [x] No .env files in git
- [x] Docker runs as non-root
- [x] Dependencies up to date
Additional Resources