名称: openclaw-hardener
描述: "加固 OpenClaw(工作区 + ~/.openclaw):运行 OpenClaw 安全审计,捕获提示注入/数据泄露风险,扫描密钥,并应用安全修复(chmod/执行位清理)。包含可选的 config.patch 规划,以减少攻击面。"
此技能提供了一个用户可选的加固工具,能够:
openclaw security audit --deep / --fix)。.env 文件、不安全的序列化模式等)。config.patch 计划以收紧运行时策略。脚本:
- skills_live/openclaw-hardener/scripts/hardener.py
示例:
# 只读检查(推荐默认方式)
python3 skills_live/openclaw-hardener/scripts/hardener.py check --all
# 仅运行 OpenClaw 内置审计(深度)
python3 skills_live/openclaw-hardener/scripts/hardener.py check --openclaw
# 仅运行工作区检查
python3 skills_live/openclaw-hardener/scripts/hardener.py check --workspace
# 应用安全修复(chmod/执行位清理 + 可选的 openclaw audit --fix)
python3 skills_live/openclaw-hardener/scripts/hardener.py fix --all
# 生成 config.patch 计划(输出 JSON5 补丁)
python3 skills_live/openclaw-hardener/scripts/hardener.py plan-config
# 应用计划(需要运行中的网关;使用 `openclaw gateway call`)
python3 skills_live/openclaw-hardener/scripts/hardener.py apply-config
fix 或 apply-config,否则不更改任何文件或配置。openclaw security audit --deep(在修复模式下运行 --fix)。~/.openclaw 下的权限合理性(基础检查)。.env 文件(警告)和已跟踪的 .env 文件(失败)。生成一个保守的 config.patch 模板,重点关注:
- 收紧入站访问默认设置(配对/白名单,提及门控)仅在您选择加入时。
- 确保启用敏感日志脱敏。
(具体键值取决于您的配置;该计划是尽力而为的,应进行审查。)