← 返回
未分类

Clawhub Publish Security

Automated pre-publish scanner that detects and blocks sensitive data like credentials, tokens, emails, and personal paths in ClawHub skills.
自动化预发布扫描器,检测并阻止 ClawHub 技能中的敏感数据(如凭证、令牌、邮箱和个人路径)。
vilda007
未分类 clawhub v1.0.1 1 版本 100000 Key: 无需
★ 0
Stars
📥 312
下载
💾 1
安装
1
版本
#latest

概述

ClawHub Publish Security Skill 🔒

Description

Mandatory security scanner for ClawHub skill publication. Automatically detects and prevents accidental exposure of sensitive information in skills before publication.

When to Use This Skill

ALWAYS run before clawhub publish:

  • Publishing your first skill
  • Updating existing skills
  • Any skill that contains configuration examples
  • Scripts that handle credentials or paths

Installation

# Install via ClawHub
clawhub install clawhub-publish-security

# The skill installs:
# - security-scan.py (automated scanner)
# - README.md (complete security guide)
# - SKILL.md (this file)

Usage

Quick Scan

# Scan a skill before publication
python skills/clawhub-publish-security/security-scan.py skills/your-skill

# Or from skill directory
cd skills/your-skill
python ../clawhub-publish-security/security-scan.py .

Pre-Publish Workflow

# 1. Create your skill
cd skills/my-awesome-skill

# 2. Run security scan
python ../clawhub-publish-security/security-scan.py .

# 3. Fix any issues found

# 4. Re-run scan until clean
python ../clawhub-publish-security/security-scan.py .

# 5. Publish only when scan passes
clawhub publish . --slug my-awesome-skill

What It Checks

❌ Blocked Patterns (Will Fail Scan)

TypePatternExample (❌ BAD)Fix (✅ GOOD)
-----------------------------------------------
Phone Numbers+420..., +1...+420XXXXXXXXX
Personal PathsUsers\name\C:\COMFYUIC:\ComfyUI
API Keysapi_key=XXXapi_key=sk-XXXos.environ.get("API_KEY")
Tokenstoken=XXXtoken=ghp_XXX
EmailsXXX@XXX.complaceholder@placeholder.com
Passwordspassword=XXXpassword=XXX
Secretssecret=XXXsecret=XXX

✅ Allowed Patterns (Safe)

TypeExampleStatus
-----------------------
Placeholders✅ Safe
Env varsos.environ.get("API_KEY")✅ Safe
Generic pathsC:\ComfyUI, ~/.openclaw✅ Safe
Author name"author": "Name (user)"✅ Safe
Public URLshttps://github.com/...✅ Safe

Output Examples

Clean Scan ✅

============================================================
[LOCK] ClawHub Publish Security Scanner
============================================================

[DIR] Scanning: C:\Users\vilda\.openclaw\workspace\skills\your-skill

[OK] Phone Numbers:     CLEAN (0 found)
[OK] Personal Paths:    CLEAN (0 found)
[OK] API Keys:          CLEAN (0 found)
[OK] Tokens:            CLEAN (0 found)
[OK] Emails:            CLEAN (0 found)
[OK] Passwords:         CLEAN (0 found)
[OK] Secrets:           CLEAN (0 found)

[PASS] ALL CHECKS PASSED - Ready for publication!

[OK] You can now safely run: clawhub publish

Failed Scan ❌

============================================================
[LOCK] ClawHub Publish Security Scanner
============================================================

[DIR] Scanning: C:\Users\vilda\.openclaw\workspace\skills\your-skill

[FAIL] Phone Numbers:     FOUND (1 issue)
   - config.json:15: "+420XXXXXXXXX"

[OK] Personal Paths:    CLEAN (0 found)
[OK] API Keys:          CLEAN (0 found)
...

============================================================
[FAIL] SECURITY ISSUES FOUND - Do NOT publish!
   Total issues: 1
============================================================

[INFO] How to fix:
   - Phone numbers: Replace with <YOUR_PHONE_NUMBER>

[FAIL] After fixing, re-run: python security-scan.py /path/to/skill
[OK] Only publish when ALL checks pass!

Files to Scan

Always Scan These:

FileRisk LevelCommon Issues
---------------------------------
.py, .js🔴 HighHardcoded credentials
config.json🔴 HighAPI keys, tokens
.sh, .ps1🔴 HighPersonal paths
README.md🟡 MediumExample values
SKILL.md🟡 MediumConfig examples

Safe to Skip:

FileReason
--------------
*.md (docs only)Low risk, but still scanned
LICENSENo credentials
.gitignoreNo credentials

Integration

OpenClaw Pre-Publish Hook

Add to your workflow:

# Before every publish
alias clawhub-publish="python skills/clawhub-publish-security/security-scan.py . && clawhub publish"

# Usage
clawhub-publish . --slug my-skill

CI/CD Pipeline

# GitHub Actions example
- name: Security Scan
  run: python skills/clawhub-publish-security/security-scan.py ./skills/my-skill

- name: Publish to ClawHub
  if: success()
  run: clawhub publish ./skills/my-skill

Best Practices

DO ✅

# Environment variables
api_key = os.environ.get("API_KEY")

# Generic paths
comfyui_path = r"C:\ComfyUI"

# Placeholders in docs
"target": "<YOUR_PHONE_NUMBER>"

# Author attribution
"author": "Name (username)"

DON'T ❌

# Hardcoded credentials
api_key = "sk-XXX"

# Personal paths
comfyui_path = r"C:\<name>\ComfyUI"

# Real values in examples
"target": "+420XXXXXXXXX"

Troubleshooting

False Positive: Email in Author Field

Problem: Scanner flags email in author attribution

Solution: This is intentional - emails should not be in published skills. Use:

"author": "Name (username)"

False Positive: Generic Path

Problem: C:\Program Files flagged

Solution: This is a system path, should be safe. If flagged, report as bug.

Scan Hangs

Problem: Scan takes too long

Solution: Check for large files or binary files. Add to .gitignore.

Related Skills

  • clawhub-smart-updater - Safe skill updates
  • openclaw-safe-audit - Security audit for OpenClaw
  • edgeone-clawscan - Tencent security scanner

License

MIT-0 - Free to use, modify, and redistribute without attribution.

Author

Klepeto 🦞 (vilda)

Created: 2026-05-07

Purpose: Prevent security incidents in published ClawHub skills

Changelog

1.0.0 (2026-05-07)

  • Initial release
  • Automated security scanning
  • Pattern detection for 7 sensitive data types
  • Pre-publish checklist
  • CI/CD integration support

版本历史

共 1 个版本

  • v1.0.1 当前
    2026-05-08 13:22 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Clawhub Smart Updater

vilda007
每周智能更新ClawHub技能,检测本地变更、自动备份、安全更新自动合并,并用详细报告标记冲突。
★ 0 📥 347

ComfyUI DirectML AMD

vilda007
在 Windows 系统上为 AMD GPU 配置并优化 ComfyUI,使用 DirectML,包括修复方案、兼容模型、基准测试和自动化配置工具。
★ 0 📥 312

OpenSCAD Automation

vilda007
为 OpenClaw 提供 OpenSCAD 脚本与渲染自动化,支持通过 CLI 创建、渲染和导出 3D 模型
★ 0 📥 255