OpenClaw 安全卫士 - 一键安全体检工具
- 一键体检: 快速扫描 OpenClaw 安全配置
- 六大扫描器: 认证授权、工具权限、频道安全、数据安全、插件安全、网络暴露
- 一键修复: 自动修复常见安全问题
- 彩色报告: 控制台彩色输出 + Markdown 报告
# 从源码安装
cd openclaw-security
pip install -e .
# 或使用 pip
pip install openclaw-security# 快速扫描
openclaw-security scan
# 深度扫描
openclaw-security scan --deep
# 扫描特定类别
openclaw-security scan --category auth --category data
# 输出 Markdown 报告
openclaw-security scan --format markdown --output report.md
# 输出 JSON 报告
openclaw-security scan --format json --output report.json# 预览修复内容
openclaw-security fix --preview
# 执行修复
openclaw-security fix --yes
# 修复特定问题
openclaw-security fix --issue credentials --yes# 检查环境配置
openclaw-security doctor| 类别 | 说明 |
|---|---|
| auth | 认证与授权风险 |
| tools | 工具权限风险 |
| channel | 频道安全 |
| data | 数据安全 |
| plugin | 插件安全 |
| network | 网络暴露 |
- gateway.auth.mode 是否为 token (风险)
- 配置中是否存在明文 token (风险)
- gateway.bind 是否为 0.0.0.0 (中危)
- exec/browser 权限是否过大
- 文件读写工具是否受限
- 飞书权限配置
- Webhook 暴露
- credentials 目录权限是否为 700
- 配置文件是否包含敏感信息
- 日志脱敏
- 第三方插件来源
- 插件版本
- 端口暴露
- Remote 模式配置
🔒 OpenClaw 安全扫描报告
============================================================
扫描时间: 2024-01-01 12:00:00
扫描类别: auth, tools, channel, data, plugin, network
------------------------------------------------------------
📁 认证与授权 (2 项)
----------------------------------------
🔴 严重 认证模式为 token
检查项: gateway.auth.mode
描述: gateway.auth.mode 设置为 token 模式,存在安全风险
建议: 建议使用更安全的认证方式
📁 数据安全 (1 项)
----------------------------------------
🟡 警告 credentials 目录权限不安全
检查项: ~/.openclaw/credentials 权限
描述: credentials 目录权限为 755,应为 700
建议: 执行: chmod 700 ~/.openclaw/credentials
============================================================
📊 扫描摘要:
🔴 严重: 1
🟡 警告: 1
🔵 信息: 0
📝 总计: 2
============================================================
# 克隆项目
git clone https://github.com/openclaw/openclaw-security.git
cd openclaw-security
# 安装开发依赖
pip install -e .
# 运行测试
python -m pytest
# 代码格式化
black openclaw_security/
flake8 openclaw_security/MIT License