✨

security-sweep

security-sweep · v1.0.2
可以安装,但有提示 HAS_SCRIPTS
安全 unknown 级 作者 rhombusmaximus 公开目录收录
533 下载 0 安装 2.3k 收藏 1 浏览

简介

security-sweep

原始描述

Security scanner for OpenClaw skills and plugins. Scans for hardcoded secrets, dangerous exec patterns, dependency vulnerabilities, and network egress. Use w...

通过你的 Agent 添加

安装目录:security-sweep/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/security-sweep/
Codex CLI~/.codex/skills/security-sweep/
DeepSeek Harness~/.agents/skills/security-sweep/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

技能正文


name: security-sweep description: Security scanner for OpenClaw skills and plugins. Scans for hardcoded secrets, dangerous exec patterns, dependency vulnerabilities, and network egress. When secrets are found, auto-encrypts them to Notion using the user's encrypted secrets store. Use when auditing skills/plugins, before publishing to ClawHub or GitHub, or when a user requests a security review. version: 1.0.1

Security Sweep — Skill & Plugin Auditor

Scans OpenClaw skills and plugins for:

  1. Hardcoded secrets — API keys, tokens, passwords in code
  2. Dangerous exec patterns — shell injection, eval, unsanitized child_process calls
  3. Dependency vulnerabilities — npm audit failures
  4. Network egress — unexpected outbound connections
  5. Input injection — unsanitized user input reaching exec/file/eval

When secrets are found, they are auto-encrypted to Notion using the user's encrypted secrets store — never stored in plain text.

Scan Scope

Built-in skills (read-only, bundled with OpenClaw CLI):

$(brew --prefix)/Cellar/openclaw-cli/<version>/libexec/lib/node_modules/openclaw/skills/

Workspace skills (user-installed):

~/.openclaw/workspace/skills/

Workflow

Full Sweep (recommended)

SKILLS_DIR="$(brew --prefix)/Cellar/openclaw-cli/<version>/libexec/lib/node_modules/openclaw/skills"
WS_DIR="$HOME/.openclaw/workspace/skills"
REPORT_DATE=$(date +%Y%m%d_%H%M%S)
REPORT_FILE="$HOME/.openclaw/security-sweep-${REPORT_DATE}.txt"

bash ~/.openclaw/workspace/skills/security-sweep/scripts/full-scan.sh \
  --builtin "$SKILLS_DIR" \
  --workspace "$WS_DIR" \
  --output "$REPORT_FILE"

Quick Scan (fast patterns only, no npm audit)

bash ~/.openclaw/workspace/skills/security-sweep/scripts/quick-scan.sh \
  --dir "$HOME/.openclaw/workspace/skills"

Single Skill Scan

bash ~/.openclaw/workspace/skills/security-sweep/scripts/skill-scan.sh \
  --skill /path/to/skill

When Secrets Are Found

⚠️ WARNING: --encrypt-found encrypts secrets to Notion before removal. This assumes your private skill directory is already secure. If your private skills already contain uncommitted real credentials, encrypting them to Notion does not retroactively protect those already-exposed secrets. Review findings manually before using this flag on an untrusted or already-compromised skillbase.

⚠️ CRITICAL: The master password is the only decryption key. Forget it and the secrets are permanently unrecoverable — AES-256-GCM with PBKDF2 (100k iterations) is intentionally slow and cannot be brute-forced. Store it in a password manager.

The scan detects potential secrets and can encrypt them to your Notion secrets store:

# Encrypt a found secret (when prompted by scan or manually)
node ~/.openclaw/scripts/notion-secrets.js put <label> "<secret>"

# List all stored secrets (blob names only, values never exposed)
node ~/.openclaw/scripts/notion-secrets.js list

# Decrypt a stored secret (interactive, requires master password)
node ~/.openclaw/scripts/notion-secrets.js decrypt "<blob>"

Encryption: AES-256-GCM with PBKDF2 key derivation (100k iterations). Notion stores only encrypted blobs — useless without the master password.

See references/notion-encryption.md for setup instructions.

Risk Categories

Level Finding Action
🔴 CRITICAL Hardcoded secret (api_key, token, password) Remove immediately, encrypt to Notion, rotate credential
🔴 CRITICAL eval() on untrusted input Replace with safe alternative
🟠 HIGH exec(), spawn() with string concatenation Use execFile with array args
🟠 HIGH Shell injection surface (bash -c, ${var} in shell) Sanitize or use execFile
🟡 MEDIUM npm audit findings (any severity) Review and update dependencies
🟡 MEDIUM Unexpected network egress Verify necessity, document purpose
🟢 LOW File permission too broad (0o777) Restrict to 0o644/0o755
🟢 INFO process.env leak in logs Ensure logs redact env vars

Before Publishing (GitHub / ClawHub)

  1. Run full sweep
  2. Fix all CRITICAL/HIGH findings
  3. Verify no secrets in any file
  4. Confirm npm audit passes with 0 vulnerabilities
  5. Document all required env vars in SKILL.md

Periodic Scanning

Schedule weekly sweeps via cron:

openclaw cron add \
  --name "security-sweep" \
  --every 604800 \
  --sessionTarget isolated \
  --payload '{"kind":"agentTurn","message":"Run security sweep on all skills. Report findings. Save report to ~/.openclaw/security-sweep-<date>.txt."}'

Notion Encryption Setup

If you want the auto-encrypt feature:

  1. Copy references/notion-encryption.md to understand the system
  2. Create a Notion page/database to store encrypted secrets
  3. Add your Notion API key to the secrets store:
    node ~/.openclaw/scripts/notion-secrets.js put notion_api_key "<your-key>"
    
  4. Use the encrypt-found script when secrets are detected

Sharing / Publishing

This skill is designed to be published to ClawHub or open-sourced on GitHub. Before publishing:

  • Run full sweep with zero CRITICAL/HIGH findings
  • All npm audits pass
  • No hardcoded secrets anywhere
  • README.md is complete and accurate
  • LICENSE is included (MIT)

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

没有标签

同类 Skill