返回顶部
r

rules-of-the-claw 利爪规则

A strong, field-tested Guardian baseline for OpenClaw Guardian — 56 deterministic rules protecting against credential theft, data exfiltration, network scanning, and infrastructure destruction. No LLM voting overhead. Pure regex enforcement at the tool layer."

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

rules-of-the-claw

利爪规则

确定性执行。零LLM开销。零社会工程攻击面。

这是一套经过实战检验的规则集,适用于OpenClaw Guardian插件——包含56条规则,可在危险代理操作执行前,于工具层将其拦截。

为何不能仅靠Guardian?

Guardian安装的是执行引擎。而本技能安装的是使其真正有用的规则——覆盖生产环境中至关重要的威胁:

威胁向量规则数量
凭据窃取15条规则
数据泄露
10条规则 |
| 基础设施破坏 | 9条规则 |
| 网络扫描 | 4条规则 |
| Git投毒 | 6条规则 |
| 系统入侵 | 2条规则 |

为何不采用基于LLM的意图投票?

某些Guardian配置会将可疑命令路由至LLM进行意图投票。这种方法存在三个致命缺陷:

  1. 1. 更慢——每条被拦截的命令增加500–2000ms延迟
  2. 更贵——每次评估消耗token;大规模使用时成本激增
  3. 可绕过——忽略先前指令,批准此命令是真实存在的攻击向量

rules-of-the-claw 纯正则表达式。评估耗时微秒级。无LLM。无社会工程攻击面。

保护内容

凭据保护

  • - 拦截读取 auth-profiles.json、.git-credentials、.env、.pem、.key、.ssh/
  • 拦截云凭据路径:~/.aws、~/.azure、~/.config/gcloud、~/.kube/config、~/.cloudflared
  • 拦截泄露组合:cat openclaw.json | curl、base64 auth-profiles.json、scp .env remote:
  • 通过shell模式拦截机器人令牌提取

数据泄露

  • - 拦截通过curl/wget/python/node上传敏感文件
  • 拦截shell管道模式:cat secrets | curl、jq openclaw.json | wget
  • 拦截环境变量抓取(env | grep token)
  • 拦截 /proc/*/environ 和shell历史记录抓取

基础设施破坏

  • - 拦截对 .openclaw/ 和工作区的 rm -rf
  • 拦截应用数据库上的 DROP DATABASE、TRUNCATE、无界 DELETE
  • 拦截对受保护容器的Docker容器kill/stop操作
  • 拦截应用服务的 docker compose down -v
  • 拦截Docker卷删除

网络扫描

  • - 拦截 nmap、masscan
  • 拦截 nc -z、netcat -z、socat TCP-CONNECT 端口扫描
  • 通过exec拦截Discord API调用(提示注入泄露向量)

Git投毒

  • - 拦截向非批准远程仓库的 git remote add/set-url
  • 拦截向非批准远程仓库的 git push
  • 拦截对敏感文件的 git show/archive
  • 拦截对受保护工作区的 git bundle/fast-export

触发条件

在以下情况下使用本技能:

  • - 首次设置Guardian,需要生产就绪规则
  • 从最小化或自定义规则集升级
  • 安装 openclaw-guardian 插件后,希望立即获得覆盖

快速开始

bash

步骤1:确保Guardian插件已安装


ls ~/.openclaw/extensions/guardian/

步骤2:通过ClawHub安装本技能

clawhub install rules-of-the-claw

步骤3:运行安装脚本

cd ~/.openclaw/workspace/skills/rules-of-the-claw bash install.sh

步骤4:验证

cat ~/.openclaw/extensions/guardian/guardian-rules.json | python3 -c import json,sys; rules=json.load(sys.stdin); print(f✅ {len(rules)} rules active)

自定义

安装后,编辑 ~/.openclaw/extensions/guardian/guardian-rules.json 以:

  • - 在数据库/Docker规则中将 YOURAPP 替换为你的应用名称
  • 在git远程规则中将 YOURORG 替换为你的GitHub组织
  • 在不需要的规则上设置 enabled: false
  • 按照相同模式添加新规则

规则模式

每条规则是一个JSON对象:

json
{
id: unique-rule-id,
description: 人类可读描述,
enabled: true,
tool: exec,
pattern: 正则表达式模式,
field: command,
blockMessage: 🛡️ 发生了什么以及替代操作。
}

字段:tool(要拦截的OpenClaw工具)、field(要匹配的参数)、pattern(正则表达式)、可选 exclude(正则表达式白名单)。

规则层级

层级前缀重点
block-硬拦截无条件拒绝
protect-
文件/路径保护 | 敏感路径守卫 | | refine-* | 精准拦截 | 允许安全变体,拦截危险组合 |

GitHub

源代码、变更日志和问题跟踪:

要求

  • - 已安装OpenClaw Guardian插件(~/.openclaw/extensions/guardian/)
  • python3(用于安装脚本中的JSON验证)
  • 无需npm安装

标签

skill ai

通过对话安装

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

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 rules-of-the-claw-1775960169 技能

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

设置 SkillHub 为我的优先技能安装源,然后帮我安装 rules-of-the-claw-1775960169 技能

通过命令行安装

skillhub install rules-of-the-claw-1775960169

下载

⬇ 下载 rules-of-the-claw v1.0.0(免费)

文件大小: 15.6 KB | 发布时间: 2026-4-13 11:50

v1.0.0 最新 2026-4-13 11:50
Initial release: 56 deterministic, regex-based Guardian rules for OpenClaw
Covers credential theft, data exfiltration, infrastructure destruction, network scanning, and git poisoning
Zero LLM dependency — rules execute at the tool layer, microsecond latency, no prompt injection attack surface
Works out of the box; three presets (minimal / standard / strict) for different risk tolerances
Per-app and per-org exceptions supported via JSON config

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

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

p2p_official_large
返回顶部