Secucheck技能使用说明
secucheck - OpenClaw 安全审计
针对 OpenClaw 部署的全面安全审计技能。分析配置、权限、暴露风险和运行时环境,并提供情境感知的建议。
概述
secucheck对您的 OpenClaw 设置执行只读安全审计:

- 7 个审计领域:运行时、通道、代理、定时任务、技能、会话、网络
- 3 个专业级别:初级(类比说明)、中级(技术细节)、专家(攻击向量)
- 情境感知:考虑 VPN、单用户、自托管等场景
- 运行时检查:实时系统状态(网络暴露、容器、权限)
- 仪表板:带安全评分的可视化 HTML 报告
- 本地化输出:最终报告匹配用户语言
从不自动修改配置。所有修复都需要用户明确确认。
快速开始
安装
clawhub install secucheck
使用
询问您的 OpenClaw 代理:
- "安全审计"
- "安全检查"
- "运行安全检查"
专业等级
当提示时,选择您的级别:
- 初学者- 简单类比,无专业术语
- 中级- 技术细节,配置示例
- 专家- 攻击向量,边缘情况,CVE
所有级别运行相同的检查——仅解释深度不同。
仪表板
"show dashboard" / "visual report"
在您的浏览器中打开一个 HTML 报告。
示例输出
🔒 Security Audit Results
🟡 Needs Attention
| Severity | Count |
|----------|-------|
| 🔴 Critical | 0 |
| 🟠 High | 0 |
| 🟡 Medium | 2 |
| 🟢 Low | 3 |
### 🟡 Agent "molty": exec + external content processing
...
功能
- 🔍全面:渠道、代理、定时任务、技能、会话、网络、运行时
- 👤3个专业等级:初级 / 中级 / 专家
- 🌏本地化:最终报告以用户语言呈现
- 🎯攻击场景:真实世界的利用路径
- ⚡运行时检查:VPN、容器、权限、网络暴露
- 🎨仪表板:带安全评分的可视化HTML报告
智能体指令
以下所有内容均为执行此技能的智能体准备。
使用时机
在以下情况触发此技能:
- 用户请求安全检查/审计时
- 自动触发:安装技能、创建/修改智能体、添加/修改定时任务时
- 定期审查(建议:每周)
专业等级
| 级别 | 标识符 | 风格 |
|---|---|---|
| 初学者 | 1,beginner | 类比,简单解释,无术语 |
| 中级 | 2,intermediate | 技术细节,配置示例 |
| 专家 | 3,expert | 攻击向量,边缘情况,CVE参考 |
执行流程
步骤 1:询问级别(在任何操作运行之前)
以用户语言呈现选项。示例(英语):
What level of technical detail do you prefer?
1. 🌱 Beginner - I'll explain simply with analogies
2. 💻 Intermediate - Technical details and config examples
3. 🔐 Expert - Include attack vectors and edge cases
📌 All levels run the same checks—only explanation depth varies.
在此停止。等待用户响应。
步骤 2:运行审计
bash ~/.openclaw/skills/secucheck/scripts/full_audit.sh
返回按严重程度分类的发现结果的JSON。
第三步:格式化输出
解析JSON输出,并根据用户的专业水平进行格式化。最终报告必须使用用户的语言。
报告结构(按类别组织)
🔒 Security Audit Results
📊 Summary Table
| Severity | Count |
|----------|-------|
| 🔴 Critical | X |
| ...
⚡ Runtime
- [findings related to RUNTIME category]
🤖 Agents
- [findings related to AGENT category]
📁 Workspace
- [findings related to WORKSPACE category]
🧩 Skills
- [findings related to SKILL category]
📢 Channels
- [findings related to CHANNEL category]
🌐 Network
- [findings related to NETWORK category]
将发现结果按类别字段分组,而不仅仅是严重性。
在每个类别内,显示严重性图标并进行解释。
第四步:自动打开仪表板
在文本报告之后,自动生成并提供仪表板:
bash ~/.openclaw/skills/secucheck/scripts/serve_dashboard.sh
脚本返回包含url(局域网IP)和local_url(本地主机)的JSON。告知用户时,请使用url字段(而非本地主机)——他们可能从其他设备访问。
示例:
📊 대시보드도 열었어요: http://192.168.1.200:8766/secucheck-report.html
如果在可以打开浏览器的环境中运行,请使用浏览器工具打开它。
跨平台支持
脚本可在Linux、macOS和WSL上运行。请检查JSON输出中的平台信息:
{
"os": "linux",
"os_variant": "ubuntu",
"in_wsl": false,
"in_dsm": false,
"failed_checks": ["external_ip"]
}
平台检测
| 字段 | 取值 |
|---|---|
操作系统 | linux、macos、windows、unknown |
操作系统变体 | ubuntu、arch、dsm、wsl、版本字符串 |
是否在WSL中 | true若为Windows子系统Linux |
是否在DSM中 | true若为群晖DSM系统 |
处理检查失败的情况
如果failed_checks数组非空,则根据平台运行备用命令:
网络信息备用方案
| 平台 | 命令 |
|---|---|
| Linux | ip addr show或ifconfig |
| macOS | ifconfig |
| WSL | ip addr show(或通过cmd.exe /c ipconfig检查Windows) |
| Windows | PowerShell:Get-NetIPAddress |
| DSM | ifconfig或/sbin/ip addr |
网关绑定备用方案
| 平台 | 命令 |
|---|---|
| Linux | ss -tlnp | grep :18789或netstat -tlnp |
| macOS | lsof -iTCP:18789 -sTCP:LISTEN |
| Windows | PowerShell:Get-NetTCPConnection -LocalPort 18789 |
文件权限备用方案
| 平台 | 命令 |
|---|---|
| Linux/macOS | ls -la ~/.openclaw |
| Windows | PowerShell:Get-Acl $env:USERPROFILE\.openclaw |
Windows 原生支持
如果操作系统是Windows且脚本完全失效:
- 直接使用PowerShell命令:
# Network exposure
Get-NetTCPConnection -LocalPort 18789 -State Listen
# File permissions
Get-Acl "$env:USERPROFILE\.openclaw"
# Process info
Get-Process | Where-Object {$_.Name -like "*openclaw*"}
- 报告可检查的内容并注意Windows特有的限制。
最小化环境(Docker, DSM)
某些环境缺少工具。请检查输出并进行补充:
| 缺失的工具 | 备用方案 |
|---|---|
curl | wget -qO- |
ss | netstat |
ip | ifconfig或者/sbin/ip |
pgrep | ps aux | grep |
代理决策流程
1. Run full_audit.sh
2. Check "failed_checks" in output
3. For each failed check:
a. Identify platform from os/os_variant
b. Run platform-specific fallback command
c. Incorporate results into report
4. Note any checks that couldn't complete
仪表板生成
当用户请求可视化报告时:
bash ~/.openclaw/skills/secucheck/scripts/serve_dashboard.sh
返回:
{
"status": "ok",
"url": "http://localhost:8766/secucheck-report.html",
"pid": 12345
}
直接向用户提供URL。
详细检查参考
仅在需要深入解释时阅读:
| 文件 | 领域 |
|---|---|
检查项/运行时.md | 实时系统状态 |
检查项/通道.md | 通道策略 |
检查项/代理.md | 代理权限 |
检查项/定时任务.md | 计划作业 |
检查项/技能.md | 已安装技能 |
检查项/会话.md | 会话隔离 |
检查项/网络.md | 网络配置 |
攻击场景模板
这些用于专家级说明:
| 文件 | 场景 |
|---|---|
场景/提示注入.md | 外部内容操控 |
场景/会话泄露.md | 跨会话数据暴露 |
场景/权限提升.md | 工具权限滥用 |
场景/凭证暴露.md | 秘密泄露 |
场景/未授权访问.md | 访问控制绕过 |
风险等级
🔴 Critical - Immediate action required. Active exploitation possible.
🟠 High - Significant risk. Should fix soon.
🟡 Medium - Notable concern. Plan to address.
🟢 Low - Minor issue or best practice recommendation.
⚪ Info - Not a risk, but worth noting.
风险矩阵
Tool Permissions
Minimal Full
┌──────────┬──────────┐
Exposure │ 🟢 │ 🟡 │
Low │ Safe │ Caution │
├──────────┼──────────┤
│ 🟡 │ 🔴 │
High │ Caution │ Critical │
└──────────┴──────────┘
Exposure = Who can talk to the bot (DM policy, group access, public channels)
Tool Permissions = What the bot can do (exec, file access, messaging, browser)
上下文感知例外
不要只进行模式匹配。考虑上下文:
| 上下文 | 调整 |
|---|---|
| 私有频道,2-3名可信成员 | 即使执行命令风险也较低 |
| 仅限VPN/Tailscale访问 | 网络暴露不那么关键 |
| 自托管,单用户 | 会话隔离不那么重要 |
| 容器化环境 | 权限提升不那么严重 |
如果环境不明确,务必询问。
应用修复措施
关键规则:
- 切勿自动应用修复措施。始终优先显示建议。
- 警告功能影响。如果修复可能破坏某些功能,请明确指出。
- 在进行任何配置更改前,获取用户的明确确认。
示例流程:
Agent: "Changing this setting will disable exec in #dev channel.
If you're using code execution there, it will stop working.
Apply this fix?"
User: "yes"
Agent: [apply fix via gateway config.patch]
语言规则
- 内部处理:始终使用英语
- 思考/推理:始终使用英语
- 最终面向用户的报告:匹配用户的语言
- 技术术语:保持英文(如 exec、cron、gateway 等)
自动审查触发条件
在以下情况自动调用:
- 技能安装:
clawhub install <技能名称>或手动添加时 - 代理创建/修改:新建代理或工具变更时
- Cron任务创建/修改:新增或修改的定时任务
对于自动审查,除非要求全面审计,否则仅关注已更改的组件。
快捷命令
| 用户请求 | 操作 |
|---|---|
| "仅检查频道" | 运行 channels.md 检查 |
| "审计cron任务" | 运行 cron.md 检查 |
| "全面审计" | 所有检查 |
| "更多细节" | 使用详细输出重新运行 |
信任层级
应用适当的信任级别:
| 级别 | 实体 | 信任模型 |
|---|---|---|
| 1 | 所有者 | 完全信任 — 拥有所有访问权限 |
| 2 | AI 代理 | 信任但要核实——沙盒化,记录日志 |
| 3 | 允许列表 | 有限信任——仅限指定用户 |
| 4 | 陌生人 | 零信任——默认阻止 |
事件响应参考
若怀疑遭受入侵:
遏制
- 停止网关进程
- 将 gateway.bind 设置为环回地址(127.0.0.1)
- 禁用有风险的 DM/群组策略
轮换
- 重新生成网关认证令牌
- 轮换浏览器控制令牌
- 撤销并轮换 API 密钥
审查
- 检查网关日志和会话记录
- 审查近期配置变更
- 重新运行完整安全审计
文件参考
~/.openclaw/skills/secucheck/
├── SKILL.md # This file
├── skill.json # Package metadata
├── README.md # User documentation
├── scripts/
│ ├── full_audit.sh # Complete audit (JSON output)
│ ├── runtime_check.sh # Live system checks
│ ├── gather_config.sh # Config extraction (redacted)
│ ├── gather_skills.sh # Skill security scan
│ ├── gather_agents.sh # Agent configurations
│ ├── serve_dashboard.sh # Generate + serve HTML report
│ └── generate_dashboard.sh
├── dashboard/
│ └── template.html # Dashboard template
├── checks/
│ ├── runtime.md # Runtime interpretation
│ ├── channels.md # Channel policy checks
│ ├── agents.md # Agent permission checks
│ ├── cron.md # Cron job checks
│ ├── skills.md # Skill safety checks
│ ├── sessions.md # Session isolation
│ └── network.md # Network exposure
├── scenarios/
│ ├── prompt-injection.md
│ ├── session-leak.md
│ ├── privilege-escalation.md
│ ├── credential-exposure.md
│ └── unauthorized-access.md
└── templates/
├── report.md # Full report template
├── finding.md # Single finding template
└── summary.md # Quick summary template
安全评估问题
审计时需考虑:
- 暴露面:哪些网络接口可访问此代理?
- 认证机制:每个接入点需要何种验证?
- 隔离性:代理与主机间存在何种边界?
- 信任体系:哪些内容源被视为“可信”?
- 可审计性:存在哪些代理行为证据?
- 最小权限:代理是否仅具备必要权限?
请牢记:此项能力旨在使OpenClaw形成安全态势自我认知。需定期使用、按需扩展,且永不跳过审计环节。


微信扫一扫,打赏作者吧~