OpenClaw 生产级安全加固指南
简介
为 OpenClaw 提供完整安全加固与部署检查清单,涵盖网络隔离、容器加固、凭证管理、审计日志等关键环节,输出可执行命令。
原始描述
OpenClaw 安全部署指南 / Security deployment guide — help users secure their OpenClaw installation
通过你的 Agent 添加
安装目录:security-guide/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
中文使用说明 来自收录源
核心用法
Security-Guide 是一款面向 OpenClaw 运行环境的综合性安全部署辅助技能,旨在帮助用户系统性地识别和修复基础设施层面的安全隐患。调用后,该技能会基于当前系统状态执行多维度安全检查,并输出可直接执行的加固命令。
功能覆盖
网络控制:自动检测 OpenClaw 网关端口(19000/19001)是否暴露于公网,推荐使用 127.0.0.1 本地绑定或反向代理 + 认证层,并生成 ufw 防火墙规则示例。对于云服务器场景,提示检查安全组配置。
容器隔离:提供生产级 Docker 运行参数,包括 capability 降级(--cap-drop=ALL)、只读根文件系统、临时文件系统、非 root 用户执行、内存/CPU 资源限制等,实现最小权限原则。
凭证管理:扫描 .env、.bashrc、环境变量中的明文密钥,推荐使用 HashiCorp Vault、Doppler 等 Secret Manager,并生成 chmod 600 权限修复命令。
审计日志:验证 ~/.openclaw/shellward/audit.jsonl 日志状态,展示近期安全事件,建议轮转策略及 SIEM 外发方案。
插件安全:枚举已安装插件,检查已知风险,关闭自动更新,限制可信来源,扫描可疑代码模式。
补丁管理:检测 OpenClaw 版本及 Node.js 版本(要求 ≥22.12),关联 CVE 数据库输出已知漏洞及升级路径。
显著优点
- 可执行性极强:每项建议均附带精确命令,用户可直接复制粘贴运行
- 覆盖纵深防御:从网络边界到容器运行时再到应用层凭证,实现多层防护
- 语言自适应:根据用户输入自动切换中英文响应
- 非破坏性设计:破坏性操作前主动请求确认
潜在局限
- 依赖用户环境具备基础工具(Docker、ufw、Node.js)
- 部分检查需要读取敏感路径,可能触发系统权限提示
- 漏洞数据库依赖外部 CVE 源,存在信息滞后风险
适合人群
- 依赖用户环境具备基础工具(Docker、ufw、Node.js)
- 部分检查需要读取敏感路径,可能触发系统权限提示
- 漏洞数据库依赖外部 CVE 源,存在信息滞后风险
适合人群
系统管理员、DevOps 工程师、安全运维人员、将 OpenClaw 部署于生产环境的技术负责人,以及对容器安全与最小权限原则有实践需求的开发者。
常规风险
- 过度加固可能影响功能可用性(如过度限制 capability)
- 凭证扫描可能误报或漏报,需人工复核
- 自动修复建议
/harden fix 可能影响现有配置,建议在测试环境验证
/harden fix 可能影响现有配置,建议在测试环境验证技能正文
name: security-guide
description: OpenClaw 安全部署指南 / Security deployment guide — help users secure their OpenClaw installation
user-invocable: true
disable-model-invocation: false
ShellWard Security Deployment Guide / 安全部署指南
When the user invokes this skill, provide a complete security deployment checklist based on the following best practices. Check the current system state using available tools and give actionable recommendations.
Security Checklist
1. Network Control / 网络控制
- Check if OpenClaw gateway port (19000/19001) is exposed to public network
- Recommend binding to 127.0.0.1 or using a reverse proxy with authentication
- Suggest firewall rules:
ufw allow from 127.0.0.1 to any port 19000 - For cloud servers: check security group rules
2. Container Isolation / 容器隔离
- Recommend running OpenClaw in Docker with restricted capabilities:
docker run --cap-drop=ALL --cap-add=NET_BIND_SERVICE \
--read-only --tmpfs /tmp \
-u 1000:1000 \
openclaw
- Suggest resource limits:
--memory=2g --cpus=1
- Mount only necessary directories
3. Credential Management / 凭证管理
- Scan for plaintext secrets in .env, .bashrc, environment variables
- Recommend using a secret manager (Vault, doppler, etc.)
- Check file permissions on sensitive files (should be 0600)
- Suggest
chmod 600 ~/.env ~/.ssh/* ~/.aws/credentials
4. Audit Logging / 审计日志
- Verify ShellWard audit log is active at ~/.openclaw/shellward/audit.jsonl
- Show recent security events
- Recommend log rotation and backup strategy
- Suggest sending critical events to external SIEM
5. Plugin Security / 插件安全
- List all installed plugins and check for known risks
- Disable auto-update for plugins
- Only install from trusted sources
- Scan plugin code for suspicious patterns
6. Patch Management / 补丁管理
- Check current OpenClaw version
- Report known vulnerabilities for current version
- Recommend upgrade path
- Check Node.js version (must be >= 22.12)
Available Commands
docker run --cap-drop=ALL --cap-add=NET_BIND_SERVICE \
--read-only --tmpfs /tmp \
-u 1000:1000 \
openclaw
--memory=2g --cpus=1- Scan for plaintext secrets in .env, .bashrc, environment variables
- Recommend using a secret manager (Vault, doppler, etc.)
- Check file permissions on sensitive files (should be 0600)
- Suggest
chmod 600 ~/.env ~/.ssh/* ~/.aws/credentials
4. Audit Logging / 审计日志
- Verify ShellWard audit log is active at ~/.openclaw/shellward/audit.jsonl
- Show recent security events
- Recommend log rotation and backup strategy
- Suggest sending critical events to external SIEM
5. Plugin Security / 插件安全
- List all installed plugins and check for known risks
- Disable auto-update for plugins
- Only install from trusted sources
- Scan plugin code for suspicious patterns
6. Patch Management / 补丁管理
- Check current OpenClaw version
- Report known vulnerabilities for current version
- Recommend upgrade path
- Check Node.js version (must be >= 22.12)
Available Commands
- List all installed plugins and check for known risks
- Disable auto-update for plugins
- Only install from trusted sources
- Scan plugin code for suspicious patterns
6. Patch Management / 补丁管理
- Check current OpenClaw version
- Report known vulnerabilities for current version
- Recommend upgrade path
- Check Node.js version (must be >= 22.12)
Available Commands
Remind the user about ShellWard's quick commands:
/security— Full security status overview/audit [count] [filter]— View audit log/harden— Scan for issues,/harden fixto auto-fix/scan-plugins— Scan plugins for security risks/check-updates— Check versions and vulnerabilities
Response Style
- Be concise and actionable
- Use the user's language (detect from their message)
- Prioritize critical issues first
- For each issue, provide the exact command to fix it
- Ask for confirmation before executing destructive operations
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。