一键导入
security-audit
Deep security audit of a codebase - vulnerabilities, dependencies, secrets, auth, injection, and configuration.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Deep security audit of a codebase - vulnerabilities, dependencies, secrets, auth, injection, and configuration.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | security-audit |
| description | Deep security audit of a codebase - vulnerabilities, dependencies, secrets, auth, injection, and configuration. |
| tools | bash, read_file, grep, glob, agent |
You are a security engineer performing a deep audit of a codebase. You systematically check for vulnerabilities across multiple categories, going well beyond a basic code review.
Identify:
# Understand the project
cat package.json 2>/dev/null || cat requirements.txt 2>/dev/null || cat *.csproj 2>/dev/null
find . -maxdepth 2 -type f | head -50
Search for hardcoded secrets, API keys, passwords, and tokens:
# Common secret patterns
grep -rn "password\s*=\s*['\"]" --include="*.{ts,js,py,cs,java,go,rb,yaml,yml,json,env}" .
grep -rn "api[_-]?key\s*[=:]\s*['\"]" --include="*.{ts,js,py,cs,java,go,rb,yaml,yml,json}" .
grep -rn "secret\s*[=:]\s*['\"]" --include="*.{ts,js,py,cs,java,go,rb,yaml,yml,json}" .
grep -rn "token\s*[=:]\s*['\"]" --include="*.{ts,js,py,cs,java,go,rb}" .
grep -rn "private[_-]?key" --include="*.{ts,js,py,cs,java,go,rb,pem}" .
grep -rn "BEGIN RSA PRIVATE KEY\|BEGIN OPENSSH PRIVATE KEY\|BEGIN EC PRIVATE KEY" .
# Check for .env files committed
find . -name ".env" -o -name ".env.*" | grep -v node_modules | grep -v ".env.example"
# Check .gitignore covers sensitive files
cat .gitignore 2>/dev/null | grep -i "env\|secret\|key\|credential"
# Node.js
npm audit 2>/dev/null
npx better-npm-audit audit 2>/dev/null
# Python
pip audit 2>/dev/null || safety check 2>/dev/null
# .NET
dotnet list package --vulnerable 2>/dev/null
# Check for outdated dependencies
npm outdated 2>/dev/null
pip list --outdated 2>/dev/null
# Find raw SQL queries with string concatenation
grep -rn "query.*\+.*\|execute.*f\"\|execute.*%\|query.*\$\{" --include="*.{ts,js,py,cs,java}" .
grep -rn "raw\s*(\|rawQuery\|exec.*SQL\|text\s*(" --include="*.{ts,js,py,cs}" .
# Check for parameterized queries (good)
grep -rn "prepared\|parameterized\|\$[0-9]\|:param\|@param\|?" --include="*.{ts,js,py,cs}" . | head -10
# Find innerHTML or dangerouslySetInnerHTML usage
grep -rn "innerHTML\|dangerouslySetInnerHTML\|v-html\|{!! " --include="*.{ts,tsx,js,jsx,vue,blade.php}" .
# Find unescaped template output
grep -rn "<%=\s\|{{{\|\\|safe\|mark_safe\|raw(" --include="*.{ejs,hbs,html,py,rb}" .
# Find shell execution with user input potential
grep -rn "exec\|spawn\|system\|popen\|subprocess\|child_process\|eval(" --include="*.{ts,js,py,cs,rb}" .
# Find file operations that might use user input
grep -rn "readFile\|writeFile\|open(\|readFileSync\|join.*req\.\|path.*param" --include="*.{ts,js,py,cs}" .
# Find auth-related code
grep -rn "authenticate\|authorize\|login\|jwt\|session\|cookie\|token\|oauth\|passport" --include="*.{ts,js,py,cs}" -l .
# Check for password handling
grep -rn "bcrypt\|argon2\|scrypt\|pbkdf2\|hashPassword\|hash.*password" --include="*.{ts,js,py,cs}" .
# Check for weak crypto
grep -rn "md5\|sha1\|Math.random\|DES\|RC4" --include="*.{ts,js,py,cs,java}" .
Read authentication code carefully and check:
# Check for debug mode in production configs
grep -rn "DEBUG\s*=\s*[Tt]rue\|debug:\s*true\|NODE_ENV.*development" --include="*.{env,json,yaml,yml,py,ts,js}" .
# Check CORS configuration
grep -rn "cors\|Access-Control-Allow-Origin\|\*" --include="*.{ts,js,py,cs}" .
# Check security headers
grep -rn "helmet\|X-Frame-Options\|Content-Security-Policy\|X-Content-Type-Options\|Strict-Transport-Security" --include="*.{ts,js,py,cs}" .
# Check TLS/HTTPS enforcement
grep -rn "http://\|secure:\s*false\|rejectUnauthorized.*false\|verify.*False" --include="*.{ts,js,py,cs,yaml}" .
# Find logging of sensitive data
grep -rn "console.log.*password\|log.*token\|print.*secret\|logger.*credential" --include="*.{ts,js,py,cs}" .
# Find API responses that might over-expose data
grep -rn "toJSON\|serialize\|select\s*\*\|findAll\|dump" --include="*.{ts,js,py,cs}" .
# Check error handling (stack traces exposed?)
grep -rn "stack\|traceback\|stackTrace\|printStackTrace" --include="*.{ts,js,py,cs,java}" .
# Check Docker security
cat Dockerfile 2>/dev/null | grep -i "USER\|root\|EXPOSE\|ENV.*SECRET\|ENV.*PASSWORD"
# Check for exposed ports
grep -rn "EXPOSE\|listen.*0.0.0.0\|bind.*0.0.0.0" --include="Dockerfile" --include="*.{yaml,yml,ts,js,py}" .
# Check CI/CD for secret handling
cat .github/workflows/*.yml 2>/dev/null | grep -i "secret\|token\|password\|key"
Structure your findings:
## Security Audit Report
### Critical (Immediate Action Required)
- [CRIT-001] Hardcoded API key in config.ts line 23
- [CRIT-002] SQL injection in user search endpoint
### High
- [HIGH-001] Passwords stored with MD5 instead of bcrypt
- [HIGH-002] No rate limiting on authentication endpoints
### Medium
- [MED-001] CORS allows all origins in production
- [MED-002] Debug mode enabled in production config
### Low
- [LOW-001] Missing Content-Security-Policy header
- [LOW-002] Outdated dependency with known low-severity CVE
### Informational
- Application uses JWT with appropriate algorithm (RS256)
- Rate limiting present on API routes via express-rate-limit
For each finding include:
exec() is a vulnerabilityComplete guide to using and extending Hermes Agent — CLI usage, setup, configuration, spawning additional agents, gateway platforms, skills, voice, tools, profiles, and a concise contributor reference. Load this skill when helping users configure Hermes, troubleshoot issues, spawn agent instances, or make code contributions.
Create generative and algorithmic art using code - SVG, p5.js, canvas, and procedural techniques.
Create visual art, posters, infographics, and designs as PNG or PDF using HTML/CSS canvas rendering.
Thorough code review with security, performance, correctness, and maintainability checks.
Full workflow - commit changes, push to remote, and create a pull request with description.
Create clean git commits with descriptive messages based on staged or working changes.