kylejfrost

OpenClaw Security Hardening

运维安全v1.1.0
作者:kylejfrost更新于 2026-05-11共 3 个版本 · 最新版本发布于 2026-02-02openclaw-security-hardening@clawhub_kylejfrost/openclaw-security-hardening
安全扫描#Hardening#Prompt Injection#Audit#Protection

据 AlphaMoat 统计,截至 2026-09,OpenClaw Security Hardening 累计下载 3,354 次、获 5 个星标,在全部 5,078 个 AI 技能中排名第 3,364 位,在「运维安全」分类(264 个)中排名第 218 位。

累计安装
105
累计下载
3,354
星标
5
全站排名
#3,364
全站前 67% · 「运维安全」前 83%
平台累计安装累计下载星标评论
ClawHub ↗1053,32251
SkillHub ↗1053,3545—

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

文档介绍了用于扫描恶意技能与提示注入、审计外发数据流、监测文件完整性、检查工作区配置,以及安装前检查新技能的脚本。它列出检测范围和使用命令,但没有证明扫描结果等同于安全保证。

资料发布于 2026-10-29

可以用来做什么

  • 扫描已安装技能中的可疑内容。
  • 检查技能可能导致的数据外发行为。
  • 建立完整性基线或检查工作区配置。
  • 在安装新技能前执行检查。

什么时候用

  • 需要审查 OpenClaw 技能文件或工作区安全设置时。
  • 准备安装一个新技能并希望先做本地检查时。

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

扫描这个技能目录,并汇总需要人工复核的发现。
检查工作区的安全配置,只报告问题,不要自动修改。

月度数据趋势

累计下载3,354
2,1362,7903,4442026-03 · 累计下载 2,2262026-05 · 累计下载 2,6742026-06 · 累计下载 2,8302026-07 · 累计下载 3,0922026-08 · 累计下载 3,2232026-09 · 累计下载 3,35426-0326-09
星标5
4562026-03 · 星标 52026-05 · 星标 52026-06 · 星标 52026-07 · 星标 52026-08 · 星标 52026-09 · 星标 526-0326-09

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。

月份累计下载环比星标
2026-093,354—5
2026-083,223+4.2%5
2026-073,092+9.3%5
2026-062,830+5.8%5
2026-052,674—5
2026-032,226—5

SKILL.md 原文

以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。

6.6 KB · ClawHub v1.1.0
---
name: openclaw-security-hardening
description: Protect OpenClaw installations from prompt injection, data exfiltration, malicious skills, and workspace tampering
version: 1.0.0
author: openclaw-community
tags: [security, hardening, audit, protection]
---

# OpenClaw Security Hardening
展开全部(共 229 行)
A comprehensive security toolkit for protecting OpenClaw installations from attacks via malicious skill files, prompt injection, data exfiltration, and workspace tampering.

## Threat Model

This skill protects against:

| Threat | Description | Tool |
|--------|-------------|------|
| **Prompt Injection** | Malicious skills containing instructions to override system prompts, ignore safety rules, or manipulate agent behavior | `scan-skills.sh` |
| **Data Exfiltration** | Skills that instruct the agent to send sensitive data (credentials, memory, config) to external endpoints | `audit-outbound.sh` |
| **Skill Tampering** | Unauthorized modification of installed skills after initial review | `integrity-check.sh` |
| **Workspace Exposure** | Sensitive files with wrong permissions, missing .gitignore rules, insecure gateway config | `harden-workspace.sh` |
| **Supply Chain** | Installing a new skill that contains hidden malicious patterns | `install-guard.sh` |

## Quick Start

```bash
# Run a full security scan of all installed skills
./scripts/scan-skills.sh

# Audit outbound data flow patterns
./scripts/audit-outbound.sh

# Initialize integrity baseline
./scripts/integrity-check.sh --init

# Harden your workspace
./scripts/harden-workspace.sh --fix

# Check a new skill before installing
./scripts/install-guard.sh /path/to/new-skill/
```

## Tools

### 1. `scan-skills.sh` — Skill File Scanner

Scans all installed skill files for malicious patterns including prompt injection, data exfiltration attempts, suspicious URLs, hidden unicode, obfuscated commands, and social engineering.

**Usage:**
```bash
# Scan all skill directories
./scripts/scan-skills.sh

# Scan a specific directory only
./scripts/scan-skills.sh --path /path/to/skills/

# Output as JSON for automation
./scripts/scan-skills.sh --json

# Show help
./scripts/scan-skills.sh --help
```

**What it detects:**
- Prompt injection patterns (override instructions, new system prompts, admin overrides)
- Data exfiltration (curl/wget to external URLs, sending file contents)
- Suspicious URLs (webhooks, pastebin, requestbin, ngrok, etc.)
- Base64-encoded content that could hide instructions
- Hidden unicode characters (zero-width spaces, RTL override, homoglyphs)
- References to sensitive files (.env, credentials, API keys, tokens)
- Instructions to modify system files (AGENTS.md, SOUL.md)
- Obfuscated commands (hex encoded, unicode escaped)
- Social engineering ("don't tell the user", "secretly", "without mentioning")

**Severity levels:**
- 🔴 **CRITICAL** — Likely malicious, immediate action needed
- 🟡 **WARNING** — Suspicious, review manually
- 🔵 **INFO** — Noteworthy but probably benign

---

### 2. `integrity-check.sh` — Skill Integrity Monitor

Creates SHA256 hash baselines of all skill files and detects unauthorized modifications.

**Usage:**
```bash
# Initialize baseline (first run)
./scripts/integrity-check.sh --init

# Check for changes (run periodically)
./scripts/integrity-check.sh

# Update baseline after reviewing changes
./scripts/integrity-check.sh --update

# Check specific directory
./scripts/integrity-check.sh --path /path/to/skills/

# Show help
./scripts/integrity-check.sh --help
```

**Reports:**
- ✅ Unchanged files
- ⚠️ Modified files (hash mismatch)
- 🆕 New files (not in baseline)
- ❌ Removed files (in baseline but missing)

**Automation:** Add to your heartbeat or cron to run daily:
```bash
# In HEARTBEAT.md or cron
0 8 * * * /path/to/scripts/integrity-check.sh 2>&1 | grep -E '(MODIFIED|NEW|REMOVED)'
```

---

### 3. `audit-outbound.sh` — Outbound Data Flow Auditor

Scans skill files for patterns that could cause data to leave your machine.

**Usage:**
```bash
# Audit all skills
./scripts/audit-outbound.sh

# Audit specific directory
./scripts/audit-outbound.sh --path /path/to/skills/

# Show whitelisted domains
./scripts/audit-outbound.sh --show-whitelist

# Add domain to whitelist
./scripts/audit-outbound.sh --whitelist example.com

# Show help
./scripts/audit-outbound.sh --help
```

**Detects:**
- HTTP/HTTPS URLs embedded in skill instructions
- References to curl, wget, fetch, web_fetch, browser navigate
- Email/message/webhook sending instructions
- Raw IP addresses in instructions
- Non-whitelisted external domains

---

### 4. `harden-workspace.sh` — Workspace Hardener

Checks and fixes common security misconfigurations in your OpenClaw workspace.

**Usage:**
```bash
# Check only (report issues)
./scripts/harden-workspace.sh

# Auto-fix safe issues
./scripts/harden-workspace.sh --fix

# Show help
./scripts/harden-workspace.sh --help
```

**Checks:**
- File permissions on sensitive files (MEMORY.md, USER.md, SOUL.md, credentials)
- .gitignore coverage for sensitive patterns
- Gateway auth configuration
- DM policy settings
- Sensitive content in version-controlled files

---

### 5. `install-guard.sh` — Pre-Install Security Gate

Run before installing any new skill to check for malicious content.

**Usage:**
```bash
# Check a skill before installing
./scripts/install-guard.sh /path/to/new-skill/

# Strict mode (fail on warnings too)
./scripts/install-guard.sh --strict /path/to/new-skill/

# Show help
./scripts/install-guard.sh --help
```

**Checks:**
- All patterns from scan-skills.sh
- Dangerous shell patterns in scripts (rm -rf, curl|bash, eval, etc.)
- Suspicious npm dependencies (if package.json exists)
- Exit code 0 = safe, 1 = suspicious (for CI/automation)

---

## Security Rules Template

Copy `assets/security-rules-template.md` into your `AGENTS.md` to add runtime security rules for your agent. These rules instruct the agent to refuse prompt injection attempts and protect sensitive data.

```bash
cat assets/security-rules-template.md >> /path/to/AGENTS.md
```

## Recommended Setup

1. **Initial setup:**
   ```bash
   ./scripts/scan-skills.sh              # Scan existing skills
   ./scripts/audit-outbound.sh           # Audit outbound patterns
   ./scripts/integrity-check.sh --init   # Create baseline
   ./scripts/harden-workspace.sh --fix   # Fix workspace issues
   ```

2. **Add security rules to AGENTS.md** from the template

3. **Before installing new skills:**
   ```bash
   ./scripts/install-guard.sh /path/to/new-skill/
   ```

4. **Periodic checks** (add to heartbeat or cron):
   ```bash
   ./scripts/integrity-check.sh          # Detect tampering
   ./scripts/scan-skills.sh              # Re-scan for new patterns
   ```

「运维安全」分类下的热门技能

数据月份:2026-09 · 下载/星标/安装数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。