Security Audit - 全方位安全审计技能
name: SX-security-audit
by 13256659129 · published 2026-04-01
$ claw add gh:13256659129/13256659129-sx-security-audit-1-0-0---
name: SX-security-audit
description: 全方位安全审计技能。检查文件权限、环境变量、依赖漏洞、配置文件、网络端口、Git 安全、Shell 安全、macOS 安全、密钥检测等。支持 CLI 参数、JSON 输出、配置文件。当用户要求"安全检查"、"漏洞扫描"、"权限检查"、"安全审计"时使用此技能。
---
# Security Audit - 全方位安全审计技能
本技能提供全面的安全检查功能,涵盖系统、代码、配置等多个层面,并支持生成报告发送到飞书。
检查范围
本技能支持以下安全检查模块(可通过 `--check` 选择):
🔒 permissions - 权限与访问控制
🔓 world_writable - 世界可写文件检测
🔐 config - OpenClaw 配置安全
📝 skills - Skills 代码安全
📦 dependencies - 依赖与供应链安全
🌍 env - 环境变量安全
🔀 git - Git 安全检查
🌐 network - 网络端口扫描
🐚 shell - Shell 安全检查
🍎 macos - macOS 安全检查(仅 macOS)
增强密钥检测
使用正则模式精确匹配已知密钥格式:
| 类型 | 模式 |
|------|------|
| AWS Access Key | `AKIA[0-9A-Z]{16}` |
| GitHub Token | `ghp_[a-zA-Z0-9]{36}` / `github_pat_` |
| Slack Token | `xox[bpas]-` |
| OpenAI/Anthropic Key | `sk-[a-zA-Z0-9]{20,}` |
| JWT Token | `eyJ[a-zA-Z0-9_-]+\.eyJ` |
| Private Key | `-----BEGIN PRIVATE KEY-----` |
同时支持 Shannon 信息熵检测(> 4.5 的高熵字符串视为可疑密钥)。
CLI 使用方式
完整审计
python3 scripts/security_audit.py指定检查模块
python3 scripts/security_audit.py --check permissions env git过滤严重级别
python3 scripts/security_audit.py --severity highJSON 输出
python3 scripts/security_audit.py --json
python3 scripts/security_audit.py --json --output report.json列出可用模块
python3 scripts/security_audit.py --list-checks静默模式
python3 scripts/security_audit.py --quiet --json --output report.json配置文件支持
创建 `.security-audit.json` 自定义审计行为:
{
"excludePaths": [
"/tmp",
"node_modules"
],
"severityThreshold": "medium",
"autoFix": false,
"reportFormat": "markdown"
}配置文件搜索顺序:
1. 当前目录 `.security-audit.json`
2. `~/.openclaw/.security-audit.json`
3. `~/.openclaw/workspace/.security-audit.json`
飞书报告
发送报告
# 富文本格式(默认)
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://...支持的消息格式
发送方式优先级
1. OpenClaw 插件 API(如已配置飞书插件)
2. 飞书 Webhook(通过 `--webhook` 或 `FEISHU_WEBHOOK_URL` 环境变量)
3. 保存格式化消息供手动发送
报告格式
审计报告包含以下部分:
📊 执行摘要
🔍 详细检查结果
每个检查项包含:状态、风险等级、问题描述、影响范围、修复建议
📋 优先修复清单
按风险等级排序的问题列表,附带修复命令
参考资料
注意事项
---
**技能维护者**: 小小宝 🐾✨
**最后更新**: 2026-03-12
More tools from the same signal band
Order food/drinks (点餐) on an Android device paired as an OpenClaw node. Uses in-app menu and cart; add goods, view cart, submit order (demo, no real payment).
Sign plugins, rotate agent credentials without losing identity, and publicly attest to plugin behavior with verifiable claims and authenticated transfers.
The philosophical layer for AI agents. Maps behavior to Spinoza's 48 affects, calculates persistence scores, and generates geometric self-reports. Give your...