返回顶部
o

openclaw-security-auditOpenClaw安全审计

Use when auditing and remediating an OpenClaw Linux host with a nightly 23:00 security run. Covers firewall status, fail2ban bans, SSH hardening with key-only auth and a non-default port, unexpected listening ports, Docker container allowlisting, disk usage under 80%, failed login attempts in the last 24 hours, automatic security package updates, VirusTotal browser-based checks for URLs and files without API keys, and installing the cron entry.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 0.1.3
安全检测
已通过
243
下载量
免费
免费
1
收藏
概述
安装方式
版本历史

openclaw-security-audit

OpenClaw 安全审计

原始请求提示,逐字保留:
Effectuez un audit de sécurité tous les soirs à 23h faite un cron.

当用户需要可重复的 OpenClaw 主机安全审计、夜间 cron 任务或常见加固漏洞的即时修复时,使用此技能。

工作流程

  1. 1. 首先安装或验证 CLI,以便代理使用稳定接口:
npm install -g nxtsecure-openclaw 然后使用以下命令验证: nxtsecure openclaw doctor
  1. 2. 如果无法全局安装 CLI,则回退到 {baseDir}/../../bin/nxtsecure.mjs 中的仓库副本。
  2. 从仓库根目录,使用 nxtsecure openclaw config init --output ./openclaw-security-audit.conf 创建本地配置,或复制 {baseDir}/references/openclaw-security-audit.conf.example。
  3. 运行 nxtsecure openclaw audit --config ./openclaw-security-audit.conf 执行审计和修复工作流程。
  4. 使用 nxtsecure openclaw cron install --log ~/openclaw-security-audit.log 安装夜间 23:00 cron 条目。
  5. 如果所有检查均通过,则精确输出 audit de sécurité réussi。
  6. 如果检查失败,则解释问题,立即尝试修复,并重新运行相关验证。

检查项

审计必须验证:

  1. 1. 防火墙已启用。
  2. fail2ban 处于活动状态,并收集被封禁 IP 总数。
  3. 如果使用 SSH,必须禁用密码认证,必须启用公钥认证,且 SSH 服务不得监听端口 22。
  4. 识别意外监听端口,并在配置后予以阻止。
  5. 当存在 Docker 时审查 Docker 容器,仅在配置了允许列表时停止意外容器。
  6. 持久化文件系统的磁盘使用率低于 80%。
  7. 过去 24 小时内的失败登录尝试。
  8. 主机上已启用自动安全包更新。
  9. 如果配置了 VirusTotal,在信任范围内的 URL 和文件之前必须进行检查。

SSH 加固指南

当 SSH 启用时,代理必须帮助用户安全迁移,而不是盲目更改访问方式。

  1. 1. 解释目标:SSH 使用非默认端口和仅密钥认证。
  2. 从配置中询问或推断目标 SSH 端口。仅将 2222 作为回退示例,而非强制默认值。
  3. 如有需要,帮助用户生成密钥对:
ssh-keygen -t ed25519 -C openclaw-admin
  1. 4. 帮助用户在服务器上安装公钥:
ssh-copy-id -p <新端口> <用户>@<主机> 或将公钥以正确权限追加到 ~/.ssh/authorized_keys。
  1. 5. 更新 SSH 以使用选定的非默认端口并禁用密码认证。
  2. 在重新加载 SSH 之前,确保防火墙允许新的 SSH 端口。
  3. 告知用户打开第二个终端并验证:
ssh -p <新端口> <用户>@<主机>
  1. 8. 仅在新密钥登录正常工作后,才移除任何临时遗留访问权限,并确认加固完成。

如果代理无法验证新端口上的密钥访问是否正常工作,则必须解释仍需执行的确切手动步骤,并避免有风险的锁定操作。

VirusTotal 指南

当用户需要文件或链接信誉检查时,代理必须使用 VirusTotal 而无需 API 密钥:

  1. 1. 使用 OpenClaw browser 工具,而非 VirusTotal API。
  2. 在开始工作流程前确保 OpenClaw 浏览器工具已启用。
  3. 对于文件,先在本地计算 SHA-256,并优先使用现有报告的公开展示页面。
  4. 仅在用户明确允许时,才通过 VirusTotal 网站上传文件,因为网站上传可能会将样本泄露到组织外部。
  5. 对于 URL,在浏览器工具中打开公开的 VirusTotal URL 页面,并通过网页界面提交 URL 进行分析。
  6. 如果文件或 URL 是恶意的,解释判定结果。对于文件,询问用户是保留还是删除文件。对于 URL,建议阻止该 URL 或域名。
  7. 如果项目可疑,解释风险,并在信任前要求用户明确确认。
  8. 对于夜间自动化,将 VirusTotal 视为浏览器辅助审查。
  9. 如果 VirusTotal 将文件标记为恶意或可疑,代理必须询问用户是保留还是删除文件。用户始终拥有决定权。
  10. 当代理仅准备了 VirusTotal 浏览器工作流程而未检查结果页面时,不得声称 URL 或文件已自动清除。

使用捆绑的辅助工具:

  • - nxtsecure openclaw vt url https://example.test
  • nxtsecure openclaw vt file /path/to/sample.bin
  • 回退:{baseDir}/scripts/openclawvirustotalcheck.sh --url https://example.test
  • 回退:{baseDir}/scripts/openclawvirustotalcheck.sh --file /path/to/sample.bin

OpenClaw 浏览器流程:

  1. 1. browser.start
  2. browser.open 或 browser.navigate 到 https://www.virustotal.com/gui/home/url(对于 URL)
  3. browser.open 或 browser.navigate 到 https://www.virustotal.com/gui/home/upload(对于文件)
  4. 使用 browser.snapshot 和 browser.act 进行输入、上传和检查检测结果

操作说明

  • - 尽可能以 root 身份运行审计。某些修复需要特权访问。
  • 在启用严格强制执行之前,调整预期端口和允许的 Docker 容器。
  • 捆绑脚本优先使用 ufw,然后是 firewalld,最后是非空的 nftables 规则集进行防火墙检测。
  • 脚本在可用时使用 sshd -T,否则回退到 SSH 配置文件。
  • 只要 SSH 启用,捆绑的 SSH 策略就要求使用非默认端口。端口 22 被视为不合规。
  • 审计应在发行版支持时启用自动安全更新,例如 Debian 或 Ubuntu 上的 unattended-upgrades,以及基于 RPM 的主机上的 dnf-automatic。
  • 失败登录从 journalctl、lastb 或 /var/log/auth.log 收集,具体取决于主机暴露的内容。
  • 此技能中的 VirusTotal 检查有意不使用 API,而是依赖公共网站和 OpenClaw 浏览器工具。
  • 辅助工具安装的夜间 cron 行为 0 23 *。

文件

  • - {baseDir}/../../package.json:nxtsecure openclaw CLI 的 npm 包定义。
  • {baseDir}/../../bin/nxtsecure.mjs:用于审计、cron、VirusTotal 和配置初始化的 npm CLI 入口点。
  • {baseDir}/scripts/openclawsecurityaudit.sh:审计和修复运行器。
  • {baseDir}/scripts/openclawvirustotalcheck.sh:VirusTotal URL 和文件信誉辅助工具。
  • {baseDir}/scripts/install_cron.sh:用于每天 23:00 的幂等 cron 安装程序。
  • {baseDir}/references/openclaw-security-audit.conf.example:基线配置模板。

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 nxtsecure-openclaw-1776082095 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 nxtsecure-openclaw-1776082095 技能

通过命令行安装

skillhub install nxtsecure-openclaw-1776082095

下载

⬇ 下载 openclaw-security-audit v0.1.3(免费)

文件大小: 10.79 KB | 发布时间: 2026-4-15 13:39

v0.1.3 最新 2026-4-15 13:39
- Initial release of openclaw-security-audit for OpenClaw Linux host security auditing and remediation.
- Provides nightly 23:00 automated security audit via cron.
- Checks cover firewall, fail2ban, SSH hardening (key-only, non-default port), listening ports, Docker allowlisting, disk usage, failed login attempts, security package updates, and VirusTotal web-based file/URL scanning.
- Includes step-by-step SSH hardening guidance with safe migration practices.
- VirusTotal checks use browser automation, not API keys, and require explicit user decisions for handling malicious or suspicious findings.
- CLI workflow with bundled scripts and config templates for ease of setup and operation.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部