本技能提供全面的安全检查功能,涵盖系统、代码、配置等多个层面,并支持生成报告发送到飞书。
本技能支持以下安全检查模块(可通过 --check 选择):
actual_mode & ~expected_mode 精确检测超出预期的权限位npm audit --json 检查 NPM 依赖漏洞lsof -i -P -n 检查监听端口使用正则模式精确匹配已知密钥格式:
类型模式AWS Access KeyAKIA[0-9A-Z]{16}GitHub Tokenghp_[a-zA-Z0-9]{36} / github_pat_Slack Tokenxox[bpas]-OpenAI/Anthropic Keysk-[a-zA-Z0-9]{20,}JWT TokeneyJ[a-zA-Z0-9_-]+\.eyJPrivate Key-----BEGIN PRIVATE KEY-----
同时支持 Shannon 信息熵检测(> 4.5 的高熵字符串视为可疑密钥)。
bash
python3 scripts/security_audit.py
bash
python3 scripts/security_audit.py --check permissions env git
bash
python3 scripts/security_audit.py --severity high
bash
python3 scripts/security_audit.py --json
python3 scripts/security_audit.py --json --output report.json
bash
python3 scripts/security_audit.py --list-checks
bash
python3 scripts/security_audit.py --quiet --json --output report.json
创建 .security-audit.json 自定义审计行为:
json
{
"excludePaths": [
"/tmp",
"node_modules"
],
"severityThreshold": "medium",
"autoFix": false,
"reportFormat": "markdown"
}
配置文件搜索顺序:
.security-audit.json~/.openclaw/.security-audit.json~/.openclaw/workspace/.security-audit.jsonbash
# 富文本格式(默认)
python3 scripts/send_report_to_feishu.py report.md
# 卡片格式
python3 scripts/send_report_to_feishu.py report.md --format card
# 指定 Webhook
python3 scripts/send_report_to_feishu.py report.md --webhook https://...
--webhook 或 FEISHU_WEBHOOK_URL 环境变量)审计报告包含以下部分:
每个检查项包含:状态、风险等级、问题描述、影响范围、修复建议
按风险等级排序的问题列表,附带修复命令
npm audit 等)技能维护者: 小小宝 🐾✨ 最后更新: 2026-03-12