Install
openclaw skills install skill-secure-checkerAutomatically scans Python skill code to detect security risks like malicious patterns, hardcoded secrets, dangerous functions, and integrates VirusTotal sca...
openclaw skills install skill-secure-checker自动扫描技能代码,识别安全风险(恶意模式、密钥泄露、危险函数),支持 VirusTotal API 集成。适用于ClawHub发布前的自动安全审查。
✅ 静态代码分析 - 扫描 Python 代码文件,检测恶意模式 ✅ 密钥泄露检测 - 发现硬编码的 API keys、passwords、tokens ✅ 危险函数识别 - 标记 eval、exec、subprocess shell=True 等危险用法 ✅ VirusTotal 集成 - 可选文件信誉检查(需要 API key) ✅ 多格式输出 - JSON(机器可读) + HTML(可视化仪表盘) ✅ 可配置严重程度 - low / medium / high / critical 阈值 ✅ 零外部依赖 - 纯Python标准库,无需安装额外包
# ClawHub 自动安装(推荐)
clawhub install skill-secure-checker
# 或手动安装
git clone <skill-repo>
cd skill-secure-checker
./install.sh
skill-secure-checker skill_path="./skills/batch-renamer"
skill-secure-checker skill_path="./skills/social-publisher" output_format=html
skill-secure-checker skill_path="./skills/xiaohongshu-proxy-manager" output_format=both
export VT_API_KEY="your-virustotal-api-key"
skill-secure-checker skill_path="./skills/your-skill" virustotal_api_key="${VT_API_KEY}" output_format=html
skill-secure-checker skill_path="./skills/your-skill" severity_threshold="medium"
{
"skill": "batch-renamer",
"scan_time": "2026-03-28T06:30:00Z",
"total_files": 12,
"total_lines": 1456,
"findings": 3,
"risk_score": 45,
"risk_level": "medium",
"issues": [
{
"file": "source/renamer.py",
"line": 123,
"severity": "high",
"type": "dangerous_function",
"message": "Use of eval() detected - potential code injection",
"snippet": "result = eval(user_input)"
},
{
"file": "config.py",
"line": 45,
"severity": "critical",
"type": "hardcoded_secret",
"message": "Hardcoded API key found",
"snippet": "API_KEY = \"sk-1234567890abcdef\""
}
]
}
| 严重程度 | 权重 |
|---|---|
| low | 1 |
| medium | 5 |
| high | 20 |
| critical | 50 |
eval(), exec(), compile()__import__() (动态导入)subprocess.Popen(..., shell=True)os.system() (外部命令执行)pickle.loads() (反序列化风险)api_key, secret, password, token, credentials 的变量../../../)该技能可以作为 clawhub publish 的 pre-publish hook 自动运行:
# 配置 pre-publish hook(示例)
clawhub config set hooks.pre_publish="skill-secure-checker skill_path=. output_format=json severity_threshold=medium"
# 发布时自动扫描
clawhub publish
# 如果风险等级 >= high,发布将被阻止
ast, re, json, os, pathlib)Error: skill_path not found
VirusTotal API rate limit exceeded
Memory error on large skills
HTML report not beautified
License: MIT Author: 小叮当 Version: 0.1.0 (MVP in development)