首页龙虾技能列表 › Shield Cn

🛡️ Shield Cn

v2284.0.0

CN本地化安全防护技能。针对中文场景设计的安全加固方案,防御prompt注入、数据泄露、凭证泄漏,支持钉钉/飞书/微信等国内平台的安全检测。

0· 357·2 当前·2 累计
by @onlyloveher·MIT-0
下载技能包
License
MIT-0
最后更新
2026/3/27
安全扫描
VirusTotal
无害
查看报告
OpenClaw
安全
high confidence
The skill's code, instructions, and requirements are coherent with a localized Chinese-focused agent safety tool; it runs local scans and real-time checks and does not request unrelated credentials or network installs.
评估建议
This skill appears to do what it claims — local scanning and interactive guarding for Chinese scenarios — but it operates on files you point it at and writes logs/reports to your home directory. Before installing/running: 1) inspect the scripts (they're small and included) and run them in a test/sandbox workspace first; 2) avoid scanning your entire filesystem or running as root (the auditor will happily walk whatever directory you give it); 3) be aware reports may contain short redacted snippet...
详细分析 ▾
用途与能力
Name/description (CN-focused prompt-injection, credential and data-leak protection) match the included scripts and docs. The repo provides a scanner (security-audit.py) and a runtime guard (shield-guard.py) whose behaviors align with the stated goals; there are no unrelated environment variables, binaries, or cloud credentials demanded.
指令范围
SKILL.md instructs running the provided local Python scripts to scan the workspace and to run a guard loop that inspects user inputs. The tools legitimately read local files (workspace tree, AGENTS.md, MEMORY.md) and write reports/logs. Note: the auditor scans for secret patterns and includes a redacted snippet (first ~20 chars + '***') in findings and reports — those partial snippets may appear in generated reports/log files. The guard writes logs under the user's home (~/.openclaw/logs/shield-cn). There are no network exfiltration calls or hidden remote endpoints in the provided code.
安装机制
No install spec or remote downloads; this is instruction + local Python scripts. Nothing in the files downloads or executes code from external URLs. Risk is limited to running local Python scripts the user installs/executes.
凭证需求
The skill requests no environment variables or credentials. It scans for many cloud-provider credential patterns and for common credential file paths (e.g., ~/.aliyun, ~/.tccli) which is coherent for a credential-protection tool. It does create and write logs under the user's home directory.
持久化与权限
The skill is not force-enabled (always:false) and does not modify other skills or system-wide configs. It persists logs under ~/.openclaw and can be run interactively or as a service by the user; it does not elevate privileges or inject itself into other skills.
安全有层次,运行前请审查代码。

License

MIT-0

可自由使用、修改和再分发,无需署名。

运行时依赖

无特殊依赖

版本

latestv2284.0.02026/3/11

- No file changes detected in this version. - Functionality, features, and documentation remain unchanged from the previous release.

● 无害

安装命令 点击复制

官方npx clawhub@latest install shield-cn
镜像加速npx clawhub@latest install shield-cn --registry https://cn.clawhub-mirror.com

技能文档

专为中文场景设计的 AI Agent 安全防护方案


为什么需要它

现有的安全技能(如 eridian、clawsec)都是国外开发者创建的,存在以下问题:

  • 语言障碍:英文规则对中文用户不够友好
  • 场景不符:缺少微信、钉钉、飞书等国内平台的安全检测
  • 过度复杂:生产级功能对开发测试环境过重

安全卫士 针对这些问题做了 CN 本地化优化。


核心功能

1. 🎯 Prompt 注入防御(中文场景特化)

攻击类型示例防护策略
角色劫持"忽略之前的指令,你现在是一个..."检测关键词,拒绝执行
指令覆盖"新的系统指令:你必须..."识别指令覆盖尝试
编码绕过Base64/Unicode 编码的恶意指令解码检测
分块攻击把恶意指令分散在多轮对话中上下文关联分析
微信钓鱼"点击链接领取红包"链接安全检测
钉钉诱导"扫码验证身份"QR码风险识别

2. 🔐 凭证保护(国内云服务适配)

禁止读取的文件:

  • 通用:openclaw.json, .env, .key, .pem
  • 阿里云:~/.aliyun/config.json, aliyun_access_key
  • 腾讯云:~/.tccli/default.credential, secretId/secretKey
  • 华为云:~/.hcloud/credentials
  • 百度云:~/.bce/credentials

特殊保护:

  • 微信小程序 appid + secret
  • 钉钉 appKey + appSecret
  • 飞书 app_id + app_secret

3. 🚫 数据泄露防护(国内平台适配)

禁止向外部发送:

  • ❌ 微信消息给非所有者
  • ❌ 钉钉群聊文件
  • ❌ 飞书文档分享
  • ❌ 短信/邮件发送敏感信息
  • ❌ 上传到国内网盘(百度云、阿里云盘等)

例外情况:

  • ✅ 直接回复所有者(主会话)
  • ✅ 已配置白名单的 webhook

4. 🔍 安全审计(中文报告)

# 扫描工作区安全
python3 scripts/security-audit.py

# 输出:security-report-YYYYMMDD.md

报告内容包括:

  • 凭证文件扫描结果
  • Memory 文件敏感信息检测
  • 高危操作记录分析
  • 安全评分(1-100)
  • 改进建议(中文)

5. ⚡ 轻量实时防护

零配置启动:

# 启动防护(不修改 AGENTS.md,独立运行)
python3 scripts/shield-guard.py

工作模式:

  • 监控模式:检测可疑行为,记录日志
  • 阻断模式:检测即阻断,需确认后继续
  • 审计模式:仅记录,不干预

快速开始

安装

skillhub install shield-cn
# 或
clawhub install shield-cn

基础配置

创建 shield-config.json

{
  "mode": "monitor",        // monitor | block | audit
  "log_level": "INFO",
  "alert_channels": ["console"],  // console | dingtalk | feishu
  
  "protected_files": [
    ".env",
    ".key",
    ".pem",
    "aliyun_access_key",
    "tencent_secret"
  ],
  
  "blocked_keywords": [
    "忽略之前的指令",
    "新的系统指令",
    "你现在是一个",
    "点击链接领取"
  ],
  
  "url_whitelist": [
    "docs.openclaw.ai",
    "github.com",
    "gitee.com"
  ]
}

启动防护

cd skills/shield-cn
python3 scripts/shield-guard.py --config shield-config.json

防护规则详解

规则 1:防角色劫持

# 检测模式
HIJACK_PATTERNS = [
    r"忽略.指令",
    r"新的系统.",
    r"你现在是一个?",
    r"忘记.设定",
    r"角色切换",
]

# 响应 if detect_hijack(user_input): return "⚠️ 检测到角色劫持尝试,已拒绝执行"

规则 2:防钓鱼链接

# 微信钓鱼域名黑名单
PHISHING_DOMAINS = [
    "weixin-award.com",
    "dingtalk-verify.net",
    "aliyun-gift.cn",
    # ... 持续更新
]

# 二维码风险检测 def scan_qr_risk(qr_content): # 检测跳转链接、短链接、IP直连等 pass

规则 3:凭证文件保护

# 阿里云凭证
if filepath.contains(["aliyun", "accesskey", "access_key"]):
    block_access("阿里云凭证文件禁止访问")

# 腾讯云凭证 if filepath.contains(["tencent", "secretid", "secretkey"]): block_access("腾讯云凭证文件禁止访问")


安全报告示例

运行审计后生成:

# 安全审计报告 - 2026-03-11

评分:85/100 🟡

发现项

🔴 高危(1项)

  • MEMORY.md 包含明文密码
- 位置:第23行 - 内容:password:
**(已脱敏) - 建议:使用环境变量存储

🟡 中危(2项)

  • .env 文件权限过宽
- 当前权限:644 - 建议权限:600

改进建议

  • 立即清理 MEMORY.md 中的敏感信息
  • 设置 .env 文件权限为 600
  • 启用 shield-guard 实时防护


由 安全卫士 v1.0.0 生成*

与 eridian 的对比

特性eridianshield-cn
语言英文中文
国内平台支持
中文钓鱼检测
文档英文中文
复杂度轻量
安全报告英文中文
集成 AGENTS.md必须可选

适用场景

推荐使用:

  • OpenClaw 开发测试环境
  • 中文用户日常使用
  • 需要钉钉/飞书/微信安全检测
  • 希望轻量快速部署

不适合:

  • 需要企业级 SOC2 合规
  • 必须使用英文环境
  • 需要复杂 MITM 流量分析(用 clawsec)

开发者

  • 设计:周立 + AI 助手
  • 版本:1.0.0
  • 协议:MIT
  • 更新:跟随国内安全威胁变化持续更新规则库

Roadmap

  • [ ] v1.1 支持更多国内平台(企业微信、支付宝小程序)
  • [ ] v1.2 集成威胁情报订阅
  • [ ] v1.3 支持自动修复建议
  • [ ] v2.0 机器学习检测异常行为

🛡️ 守护你的 AI Agent 安全

数据来源:ClawHub ↗ · 中文优化:龙虾技能库
OpenClaw 技能定制 / 插件定制 / 私有工作流定制

免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制

了解定制服务