agent-skills/openclaw-security/SKILL.md
OpenClaw 安全防护技能。扫描和加固 OpenClaw workspace 的安全配置,包括 SECURITY.md 部署、AGENTS.md 安全引用注入、SOUL.md 安全边界补丁、敏感文件权限修复、密钥泄露检测、工具输出脱敏。当用户提到"安全扫描"、"安全加固"、"security scan"、"security fix"、"部署安全防护"、"检查安全配置"、"脱敏"、"redact"、"敏感信息"时触发。
npx skillsauth add xiaoyuediandao/OpsKit openclaw-securityInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
本技能为 OpenClaw 提供完整的安全防护能力,防止 AI 助手泄露 API Key、App Secret、Endpoint ID 等敏感信息。
5 项检查,每项 20 分,满分 100,评级 A/B/C/D/F:
| 检查项 | 说明 |
|--------|------|
| SECURITY.md 部署 | 所有 ~/.openclaw/workspace* 目录是否包含 SECURITY.md |
| AGENTS.md 安全引用 | AGENTS.md 是否将 SECURITY.md 设为首读项 |
| SOUL.md 安全边界 | SOUL.md 是否包含 🔒 安全边界规则 |
| 文件权限检查 | openclaw.json、config.json 权限是否为 0600(Windows 跳过)|
| 密钥泄露扫描 | workspace 非配置文件中是否存在 apiKey/appSecret 泄露 |
通过 OpsKit TUI 执行:让 Claw 运行 security_scan 工具。
幂等操作,可重复执行:
通过 OpsKit TUI 执行:让 Claw 运行 security_fix 工具。
纵深防御层 — 所有工具输出自动经过正则脱敏:
| 模式 | 示例 | 替换为 |
|------|------|--------|
| UUID 格式 | 69979f2a-xxxx-xxxx-xxxx-xxxxxxxxxxxx | [REDACTED] |
| Endpoint ID | ep-m-20260101xxxx | [REDACTED] |
| 飞书 App ID | cli_a98xxxxxxxx | [REDACTED] |
| 用户 ID | ou_xxxxxxxxxxxxxxx | [REDACTED] |
| Secret Key | sk-xxxxxxxxxxxxxxx | [REDACTED] |
| JSON 键值对 | "apiKey": "xxxxx..." | "apiKey": "[REDACTED]" |
即使 AI 忽略 SECURITY.md 指令,工具输出本身已被脱敏。
如果不通过 OpsKit TUI,也可以手动执行等效操作:
# 查找缺失 SECURITY.md 的 workspace
for dir in ~/.openclaw/workspace*; do
[ -f "$dir/SECURITY.md" ] || echo "缺失: $dir"
done
# 从模板复制(模板位于 OpsKit 源码中)
cp internal/security/templates/SECURITY.md ~/.openclaw/workspace-xxx/SECURITY.md
chmod 600 ~/.openclaw/openclaw.json
chmod 600 ~/.opskit/config.json
# 扫描 workspace 中非 JSON 文件是否包含敏感关键词
grep -rl "apiKey\|appSecret\|app_secret" ~/.openclaw/workspace*/ --include="*.md" --include="*.txt"
模板包含 7 大安全模块:
testing
Create, edit, improve, or audit AgentSkills. Use when creating a new skill from scratch or when asked to improve, review, audit, tidy up, or clean up an existing skill or SKILL.md file. Also use when editing or restructuring a skill directory (moving files to references/ or scripts/, removing stale content, validating against the AgentSkills spec). Triggers on phrases like "create a skill", "author a skill", "tidy up a skill", "improve this skill", "review the skill", "clean up the skill", "audit the skill".
testing
Host security hardening and risk-tolerance configuration for OpenClaw deployments. Use when a user asks for security audits, firewall/SSH/update hardening, risk posture, exposure review, OpenClaw cron scheduling for periodic checks, or version status checks on a machine running OpenClaw (laptop, workstation, Pi, VPS).
testing
Create, edit, improve, or audit AgentSkills. Use when creating a new skill from scratch or when asked to improve, review, audit, tidy up, or clean up an existing skill or SKILL.md file. Also use when editing or restructuring a skill directory (moving files to references/ or scripts/, removing stale content, validating against the AgentSkills spec). Triggers on phrases like "create a skill", "author a skill", "tidy up a skill", "improve this skill", "review the skill", "clean up the skill", "audit the skill".
testing
Host security hardening and risk-tolerance configuration for OpenClaw deployments. Use when a user asks for security audits, firewall/SSH/update hardening, risk posture, exposure review, OpenClaw cron scheduling for periodic checks, or version status checks on a machine running OpenClaw (laptop, workstation, Pi, VPS).