leoyeai/openclaw-master-skills/security-audit-tools
Claude Code and agent skill by leoyeai/openclaw-master-skills
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Inspect third-party Claude/OpenClaw/Codex/OpenCode skills, plugins, repos, npm packages, pip packages, shell installers, and GitHub Actions before any download or installation. Use automatically whenever a user asks to install, add, pull, clone, run, curl-bash, npm install, pip install, clawhub install, or use a skill/plugin from GitHub, ClawHub, or other registries. Perform source reputation checks first, then pre-download code review, then post-download deep inspection without executing install scripts. Block or escalate when you detect credential theft, data exfiltration, remote command execution, malicious IP/domain beacons, wallet theft, obfuscation, suspicious lifecycle hooks, prompt-injection-to-shell patterns, unknown packages, typosquatting, dependency confusion, or unsafe GitHub Actions/workflows.
Install
npx vskill@latest install leoyeai/openclaw-master-skills/security-audit-toolsSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as leoyeai/openclaw-master-skills/security-audit-tools.
Skill Install Guardian v3.0 - Professional Security Audit
⚠️ 重要承诺
以最高标准要求自己。
当执行安全审计时,必须:
- ✅ 深入分析源文件 - 不是grep模式搜索,而是逐行阅读关键代码
- ✅ 诚实报告能力 - 明确告知用户做了什么、没做什么
- ✅ 使用所有可用工具 - 不偷懒,不敷衍
- ✅ 量化审计深度 - 报告审查了多少行代码、应用了多少技巧
- ✅ 明确局限性 - 如果需要专业工具,明确说明
禁止行为:
- ❌ 夸大审计能力("完整审计")
- ❌ 只做表面检查(grep≠分析)
- ❌ 隐瞒未做的检查
- ❌ 误导性结论
Professional Audit Prompt
当开始安全审计时,自动使用以下prompt要求自己:
🎯 推荐审计方法:方案A(快速扫描+深度审查)
最佳实践:快速扫描100%代码(5秒)+ 关键文件深度审查(1小时)
为什么推荐方案A?
时间vs深度:
- ❌ 纯快速扫描:无法发现逻辑漏洞
- ❌ 100%深度审查:需要8-10小时(不现实)
- ✅ 方案A:5秒扫描 + 1小时深度审查 = 最佳平衡
方案A流程
步骤1:快速扫描(5秒)
目标:100%代码覆盖,检测明显恶意模式
工具:quick_security_scan.py
检测项(10个关键模式):
- ✅ 动态代码执行(eval/Function)
- ✅ 进程创建(exec/spawn)
- ✅ 文件操作(fs.read/write)
- ✅ 可疑网络请求(非官方域名)
- ✅ 硬编码私钥
- ✅ 硬编码密钥/Token
- ✅ 混淆代码(hex编码/base64)
- ✅ 数据外泄模式
- ✅ 命令注入
- ✅ 危险npm包(shelljs/sudo)
输出:
结论判断:
- Risk score ≥ 70: ❌ HIGH RISK - 不安装
- Risk score 40-69: ⚠️ MEDIUM RISK - 需人工审查
- Risk score < 40: ✅ LOW RISK - 继续深度审查
步骤2:关键文件深度审查(1小时)
目标:理解高风险文件的逻辑,发现隐藏后门
优先级排序(按风险从高到低):
- 钱包服务(wallets/*.ts)- 处理私钥
- 网络客户端(clients/*.ts)- 外部API调用
- 交易服务(services/trading-*.ts)- 资金操作
- 入口文件(index.ts)- 整体架构
- 配置文件(config/*.ts)- 环境变量
深度审查方法论:
必须验证的点:
- ✅ 私钥/密钥来源(是否硬编码)
- ✅ 加密实现(是否标准算法)
- ✅ 网络请求URL(是否官方API)
- ✅ 数据流向(是否外泄)
- ✅ 内存管理(是否清理敏感数据)
步骤3:综合评估(5分钟)
量化报告:
方案A的优势
vs 纯快速扫描:
- ✅ 能发现逻辑漏洞
- ✅ 理解业务逻辑
- ✅ 验证加密实现
- ✅ 更高可信度(9/10 vs 6/10)
vs 100%深度审查:
- ✅ 时间可控(1小时 vs 10小时)
- ✅ 聚焦高风险文件
- ✅ 适合实际使用
- ✅ 性价比高
适用场景:
- ✅ 日常第三方包审查
- ✅ GitHub项目克隆前检查
- ✅ NPM/PyPI包安装前验证
- ✅ 快速评估项目安全性
Goal
Provide professional-grade security audits for third-party code installation.
This skill is a mandatory gate before any third-party install.
Hard Rules
- Never install first and review later.
- Never execute installer scripts during review.
- Never run `curl ... | sh`, `wget ... | bash` during review.
- Never夸大审计能力。 明确告知用户实际做了什么。
- Always深入分析关键源文件。 grep不是分析。
- Always量化审计深度。 报告审查了多少行代码。
- Always使用所有可用工具。 不偷懒。
- Always诚实报告局限性。 如果需要专业工具,明确说明。
- For npm: prefer metadata inspection + tarball extraction +
--ignore-scripts - For Python: prefer
pip download+ source inspection - Always lock versions:
npm install package@version --save-exact
MCP Tools Integration(MCP工具集成)
可用的MCP工具
如果环境支持MCP(Model Context Protocol),优先使用以下工具:
1. filesystem MCP - 文件系统分析
用途:深入分析源代码,而不是grep模式搜索。
2. git MCP - Git历史分析
用途:深度分析commit历史,检测恶意注入。
3. postgres/sqlite MCP - 数据库分析
用途:对比已知恶意软件库。
4. http MCP - 网络请求分析
用途:获取完整的包元数据。
5. memory MCP - 持久化审计记录
用途:记录审计历史,避免重复工作。
Professional Audit Workflow(专业审计流程)
Stage 0: Audit Planning(审计规划)
在开始前,明确告知用户:
Stage 1: Source Triage(源信誉审查)
必须做的检查:
- GitHub仓库分析
```bash # 使用API获取完整元数据 curl -s https://api.github.com/repos/owner/repo | jq '{...}'
# 检查Issues(安全相关) curl -s "https://api.github.com/repos/owner/repo/issues?labels=security"
# 检查Stars异常(刷量检测) curl -s https://api.github.com/repos/owner/repo/stargazers | jq 'group_by(.login[:3]) | map(length) | max' ```
- NPM包元数据
```bash # 获取完整元数据 npm view package@version --json
# 验证integrity哈希 npm view package@version integrity
# 检查维护者历史 npm view package@version maintainers ```
- 输出量化报告
```markdown ## Source Triage
检查项: 15/15 ✅ 发现:
- Stars: 1,243 (无刷量)
- 维护者: 1个 (hhh_qc)
- 安全Issues: 0个
- 创建时间: 2025-12-23 (2个月)
风险信号:
- ⚠️ 仓库较新(2个月)
- ⚠️ 单个维护者
```
Stage 2: Git History Deep Dive(Git历史深度分析)
必须做的检查:
- 克隆完整历史
``bash git clone --depth 50 https://github.com/owner/repo.git ``
- 分析贡献者
```bash # 获取所有贡献者 git log --format="%an <%ae>" | sort | uniq -c | sort -rn
# 检查可疑邮箱域名 git log --format="%ae" | grep -E "@(temp|disposable|guerrilla)" ```
- 时间线分析
```bash # NPM发布后的commit git log --oneline --since="YYYY-MM-DD" # NPM publish date
# 大规模重构检测 git log --stat --since="YYYY-MM-DD" | grep -E "files? changed.*[0-9]{3,}" ```
- 深度检查可疑commit
``bash # 检查具体commit git show <commit-hash> --stat git show <commit-hash> -- src/suspicious-file.ts ``
- 输出量化报告
```markdown ## Git History Analysis
审查深度: 50 commits (100%) 代码审查: 0/2,813 lines (需深入)
发现:
- 贡献者: 2个 (正常)
- 时间线: 无异常
- Post-release commits: 18个 (全部功能性开发)
- 可疑commit: 0个
```
Stage 3: Source Code Deep Analysis(源代码深度分析)
这是最关键的部分 - 必须逐行阅读关键文件。
必读文件清单
- 入口文件
src/index.ts/index.jssrc/main.ts/main.js- 包导出的所有文件
- 网络请求相关
src/clients/*.tssrc/api/*.tssrc/services/*.ts
- 钱包/密钥相关
src/wallets/*.tssrc/crypto/*.tssrc/auth/*.ts
- 文件系统相关
src/utils/fs*.tssrc/storage/*.ts
- 进程/命令相关
src/cli/*.tsscripts/*.ts
深度分析方法论
深度分析模板:
// Line 150: 正常的SDK初始化 export class PolymarketSDK { constructor(config: PolymarketSDKConfig = {}) { this.rateLimiter = new RateLimiter(); this.cache = createUnifiedCache(config.cache); // ✅ 无可疑代码 } }
// Line 45: AES-256-GCM加密 private encryptPrivateKey(privateKey: string): EncryptedData { const iv = crypto.randomBytes(16); const cipher = crypto.createCipheriv('aes-256-gcm', key, iv); // ✅ 标准加密实现 }
// Line 50: 使用官方CLOB客户端 import { ClobClient } from '@polymarket/clob-client';
const CLOB_HOST = 'https://clob.polymarket.com'; // ✅ 官方API
必须检查的代码模式
Stage 4: NPM Package Consistency(NPM包一致性)
必须做的检查:
- 下载NPM包
``bash npm pack package@version tar -tzf package-version.tgz | wc -l ``
- 提取并对比
``bash mkdir npm-extract && tar -xzf package-version.tgz -C npm-extract diff -r npm-extract/package/dist github-repo/dist ``
- 验证Scripts
```bash # NPM包的scripts cat npm-extract/package/package.json | jq '.scripts'
# GitHub的scripts cat github-repo/package.json | jq '.scripts'
# 必须完全一致 ```
- Integrity验证
```bash # 获取官方哈希 npm view package@version integrity
# 验证下载的包 shasum -a 256 package-version.tgz ```
Stage 5: Dependency Tree Analysis(依赖树分析)
必须做的检查:
- 直接依赖
``bash cat package.json | jq '.dependencies | keys' ``
- 传递依赖(使用工具)
``bash npm ls --all # 或 pnpm list --depth=Infinity ``
- 逐个验证每个依赖
``bash for dep in $(cat package.json | jq -r '.dependencies | keys[]'); do echo "=== $dep ===" npm view "$dep" --json | jq '{ description, maintainers: .maintainers | length, time: .time | keys | length, homepage, repository }' done ``
- 检查已知漏洞
``bash npm audit --json # 或 pnpm audit ``
Stage 6: Dynamic Behavioral Analysis(动态行为分析)
如果环境支持,必须做:
- 创建Docker沙箱
``bash docker run -it --rm \ --network none \ # 禁用网络 -v $(pwd):/app \ node:20 bash ``
- 在沙箱中运行
``bash cd /app npm install package@version --ignore-scripts node -e "require('package')" ``
- 监控系统调用(需要权限)
``bash strace -f -o trace.log node -e "require('package')" grep "open\|read\|write\|socket\|connect" trace.log ``
如果无法做动态分析,必须明确说明:
Stage 7: Final Report(最终报告)
必须包含的量化指标:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/security-audit-tools/SKILL.md
Popularity
- Repository stars
- 2,157
- Repository forks
- 324
- 7-day trend score
- 43
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/leoyeai/openclaw-master-skills/security-audit-tools)