审核代码库、基础设施和代理人工智能系统的安全问题。涵盖传统安全性(依赖项、机密、OWASP Web Top 10、SSL/TLS、f...
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install agentic-security-audit或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install agentic-security-audit⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/agentic-security-audit/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: security-audit description: Audit codebases, infrastructure, AND agentic AI systems for security issues. Covers traditional security (dependencies, secrets, OWASP web top 10, SSL/TLS, file permissions) PLUS agentic security (prompt injection scanning, identity spoofing detection, memory poisoning checks, multi-agent communication audit, OWASP Agentic Top 10). Use when scanning for vulnerabilities, detecting hardcoded secrets, reviewing agent workspace configuration, checking prompt injection vectors, or auditing agent permissions and boundaries. metadata: {"clawdbot":{"emoji":"🔒","requires":{"anyBins":["npm","pip","git","openssl","curl"]},"os":["linux","darwin","win32"]}} ---
Scan, detect, and fix security issues in codebases and infrastructure. Covers dependency vulnerabilities, secret detection, OWASP top 10, SSL/TLS verification, file permissions, and secure coding patterns.
# Built-in npm audit
npm audit
npm audit --json | jq '.vulnerabilities | to_entries[] | {name: .key, severity: .value.severity, via: .value.via[0]}'
# Fix automatically where possible
npm audit fix
# Show only high and critical
npm audit --audit-level=high
# Check a specific package
npm audit --package-lock-only
# Alternative: use npx to scan without installing
npx audit-ci --high
# pip-audit (recommended)
pip install pip-audit
pip-audit
pip-audit -r requirements.txt
pip-audit --format=json
# safety (alternative)
pip install safety
safety check
safety check -r requirements.txt --json
# Check a specific package
pip-audit --requirement=- <<< "requests==2.25.0"
# Built-in vuln checker
go install golang.org/x/vuln/cmd/govulncheck@latest
govulncheck ./...
# Check specific binary
govulncheck -mode=binary ./myapp
# cargo-audit
cargo install cargo-audit
cargo audit
# With fix suggestions
cargo audit fix
# Install: https://aquasecurity.github.io/trivy
# Scan filesystem
trivy fs .
# Scan specific language
trivy fs --scanners vuln --severity HIGH,CRITICAL .
# Scan Docker image
trivy image myapp:latest
# JSON output
trivy fs --format json -o results.json .
# AWS keys
grep -rn 'AKIA[0-9A-Z]\{16\}' --include='*.{js,ts,py,go,java,rb,env,yml,yaml,json,xml,cfg,conf,ini}' .
# Generic API keys and tokens
grep -rn -i 'api[_-]\?key\|api[_-]\?secret\|access[_-]\?token\|auth[_-]\?token\|bearer ' \
--include='*.{js,ts,py,go,java,rb,env,yml,yaml,json}' .
# Private keys
grep -rn 'BEGIN.*PRIVATE KEY' .
# Passwords in config
grep -rn -i 'password\s*[:=]' --include='*.{env,yml,yaml,json,xml,cfg,conf,ini,toml}' .
# Connection strings with credentials
grep -rn -i 'mongodb://\|mysql://\|postgres://\|redis://' --include='*.{js,ts,py,go,env,yml,yaml,json}' . | grep -v 'localhost\|127.0.0.1\|example'
# JWT tokens (three base64 segments separated by dots)
grep -rn 'eyJ[A-Za-z0-9_-]*\.eyJ[A-Za-z0-9_-]*\.' --include='*.{js,ts,py,go,log,json}' .
# Scan git history for secrets (not just current files)
# Using git log + grep
git log -p --all | grep -n -i 'api.key\|password\|secret\|token' | head -50
# Check staged files before commit
git diff --cached --name-only | xargs grep -l -i 'api.key\|password\|secret\|token' 2>/dev/null
#!/bin/bash
# .git/hooks/pre-commit - Block commits containing potential secrets
PATTERNS=(
'AKIA[0-9A-Z]{16}'
'BEGIN.*PRIVATE KEY'
'password\s*[:=]\s*["\x27][^"\x27]+'
'api[_-]?key\s*[:=]\s*["\x27][^"\x27]+'
'sk-[A-Za-z0-9]{20,}'
'ghp_[A-Za-z0-9]{36}'
'xox[bpoas]-[A-Za-z0-9-]+'
)
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM)
[ -z "$STAGED_FILES" ] && exit 0
EXIT_CODE=0
for pattern in "${PATTERNS[@]}"; do
matches=$(echo "$STAGED_FILES" | xargs grep -Pn "$pattern" 2>/dev/null)
if [ -n "$matches" ]; then
echo "BLOCKED: Potential secret detected matching pattern: $pattern"
echo "$matches"
EXIT_CODE=1
fi
done
if [ $EXIT_CODE -ne 0 ]; then
echo ""
echo "To proceed anyway: git commit --no-verify"
echo "To remove secrets: replace with environment variables"
fi
exit $EXIT_CODE
# Check if sensitive files are tracked
echo "--- Files that should probably be gitignored ---"
for pattern in '.env' '.env.*' '*.pem' '*.key' '*.p12' '*.pfx' 'credentials.json' \
'service-account*.json' '*.keystore' 'id_rsa' 'id_ed25519'; do
found=$(git ls-files "$pattern" 2>/dev/null)
[ -n "$found" ] && echo " TRACKED: $found"
done
# Check if .gitignore exists and has common patterns
if [ ! -f .gitignore ]; then
echo "WARNING: No .gitignore file found"
else
for entry in '.env' 'node_modules' '*.key' '*.pem'; do
grep -q "$entry" .gitignore || echo " MISSING from .gitignore: $entry"
done
fi
# SQL injection: string concatenation in queries
grep -rn "query\|execute\|cursor" --include='*.{py,js,ts,go,java,rb}' . | \
grep -i "f\"\|format(\|%s\|\${\|+ \"\|concat\|sprintf" | \
grep -iv "parameterized\|placeholder\|prepared"
# Command injection: user input in shell commands
grep -rn "exec(\|spawn(\|system(\|popen(\|subprocess\|os\.system\|child_process" \
--include='*.{py,js,ts,go,java,rb}' .
# Check for parameterized queries (good)
grep -rn "\\$[0-9]\|\\?\|%s\|:param\|@param\|prepared" --include='*.{py,js,ts,go,java,rb}' .
# Weak password hashing (MD5, SHA1 used for passwords)
grep -rn "md5\|sha1\|sha256" --include='*.{py,js,ts,go,java,rb}' . | grep -i "password\|passwd"
# Hardcoded credentials
grep -rn -i "admin.*password\|password.*admin\|default.*password" \
--include='*.{py,js,ts,go,java,rb,yml,yaml,json}' .
# Session tokens in URLs
grep -rn "session\|token\|jwt" --include='*.{py,js,ts,go,java,rb}' . | grep -i "url\|query\|param\|GET"
# Check for rate limiting on auth endpoints
grep -rn -i "rate.limit\|throttle\|brute" --include='*.{py,js,ts,go,java,rb}' .
# Unescaped output in templates
grep -rn "innerHTML\|dangerouslySetInnerHTML\|v-html\|\|html(" \
--include='*.{js,ts,jsx,tsx,vue,html}' .
# Template injection
grep -rn "{{{.*}}}\|<%=\|<%-\|\$\!{" --include='*.{html,ejs,hbs,pug,erb}' .
# Document.write
grep -rn "document\.write\|document\.writeln" --include='*.{js,ts,html}' .
# eval with user input
grep -rn "eval(\|new Function(\|setTimeout.*string\|setInterval.*string" \
--include='*.{js,ts}' .
# Direct ID usage in routes without authz check
grep -rn "params\.id\|params\[.id.\]\|req\.params\.\|request\.args\.\|request\.GET\." \
--include='*.{py,js,ts,go,java,rb}' . | \
grep -i "user\|account\|profile\|order\|document"
# CORS wildcard
grep -rn "Access-Control-Allow-Origin.*\*\|cors({.*origin.*true\|cors()" \
--include='*.{py,js,ts,go,java,rb}' .
# Debug mode in production configs
grep -rn "DEBUG\s*=\s*True\|debug:\s*true\|NODE_ENV.*development" \
--include='*.{py,js,ts,yml,yaml,json,env}' .
# Verbose error messages exposed to clients
grep -rn "stack\|traceback\|stackTrace" --include='*.{py,js,ts,go,java,rb}' . | \
grep -i "response\|send\|return\|res\."
...
安装 代理安全审计 后,可以对 AI 说这些话来触发它
Help me get started with Agentic Security Audit
Explains what Agentic Security Audit does, walks through the setup, and runs a quick demo based on your current project
Use Agentic Security Audit to audit codebases, infrastructure, AND agentic AI systems for securit...
Invokes Agentic Security Audit with the right parameters and returns the result directly in the conversation
What can I do with Agentic Security Audit in my developer & devops workflow?
Lists the top use cases for Agentic Security Audit, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/agentic-security-audit/ 目录(个人级,所有项目可用),或 .claude/skills/agentic-security-audit/(项目级)。重启 AI 客户端后,用 /agentic-security-audit 主动调用,或让 AI 根据上下文自动发现并使用。
代理安全审计 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
代理安全审计 可免费安装使用。请查阅仓库了解许可证信息。
审核代码库、基础设施和代理人工智能系统的安全问题。涵盖传统安全性(依赖项、机密、OWASP Web Top 10、SSL/TLS、f...
代理安全审计 属于「Developer & DevOps」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my developer & devops tasks using Agentic Security Audit
Identifies repetitive steps in your workflow and sets up Agentic Security Audit to handle them automatically