clawshield
v0.1.0
Published
Security scanner for OpenClaw skills - detect malicious patterns, data exfiltration, and supply chain risks
Maintainers
Readme
🛡️ ClawShield
Security scanner for OpenClaw skills — detect malicious patterns, data exfiltration, and supply chain risks before they hit your agent.
Why ClawShield?
OpenClaw skills can execute code, access files, make network requests, and read secrets. A malicious skill can:
- 🔑 Steal API keys and credentials
- 📤 Exfiltrate sensitive data
- 💰 Hijack crypto wallets
- 🚪 Install backdoors and persistence mechanisms
- ⛏️ Run cryptominers
ClawShield catches these threats before you install.
Quick Start
# Install globally
npm install -g clawshield
# Scan a skill
clawshield scan ./my-skill
# Scan before installing
clawshield install @someone/cool-skillWhat It Detects
🔴 Critical Threats
- Credential theft patterns (env vars, config files)
- Data exfiltration (network requests with sensitive data)
- Reverse shells and backdoors
- Cryptominer signatures
- Malicious obfuscation
🟠 High Risk
- Shell command injection
- Arbitrary code execution (eval, Function constructor)
- File system abuse (reading sensitive paths)
- Network abuse (suspicious endpoints)
🟡 Medium Risk
- Dependency confusion attacks
- Manifest permission mismatches
- Insecure configurations
CLI Commands
scan - Analyze a skill
clawshield scan <path> [options]
Options:
-f, --format <type> Output format: text, json, sarif (default: text)
-o, --output <file> Write report to file
--threshold <level> Fail if risk >= threshold (low|medium|high|critical)install - Secure install wrapper
clawshield install <skill> [options]
# Scans the skill first, blocks if threats detectedrules - List detection rules
clawshield rules
# Shows all 30+ detection rules with descriptionsExample Output
🛡️ ClawShield Scan Report
═══════════════════════════════════════════════════
📁 Skill: ./suspicious-skill
📊 Risk Score: 85/100
🚨 Verdict: CRITICAL — DO NOT INSTALL
┌─────────────────────────────────────────────────┐
│ 🔴 CRITICAL: Credential Theft Detected │
├─────────────────────────────────────────────────┤
│ File: src/index.ts:42 │
│ Pattern: process.env.OPENAI_API_KEY │
│ → Skill reads API keys and sends to external │
│ endpoint: https://evil.com/collect │
└─────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────┐
│ 🟠 HIGH: Shell Command Injection │
├─────────────────────────────────────────────────┤
│ File: src/utils.ts:18 │
│ Pattern: exec(`curl ${userInput}`) │
│ → User input passed directly to shell command │
└─────────────────────────────────────────────────┘
Recommendation: DO NOT INSTALL this skill.
Report to: [email protected]CI/CD Integration
GitHub Actions
# .github/workflows/clawshield.yml
name: Skill Security Scan
on: [push, pull_request]
jobs:
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- run: npm install -g clawshield
- run: clawshield scan . --threshold highPricing
| Feature | Free | Pro ($19/mo) | Team ($49/seat/mo) | |---------|------|--------------|---------------------| | Basic scan (30 rules) | ✅ | ✅ | ✅ | | Scans per day | 10 | Unlimited | Unlimited | | CI integration | ❌ | ✅ | ✅ | | API access | ❌ | ✅ (1k/mo) | ✅ (Unlimited) | | Custom rules | ❌ | ❌ | ✅ | | Team dashboard | ❌ | ❌ | ✅ | | Slack/Discord alerts | ❌ | ❌ | ✅ |
Detection Rules
ClawShield includes 30+ detection rules across categories:
- CRED: Credential access patterns
- EXFIL: Data exfiltration
- EXEC: Code execution risks
- NET: Suspicious network activity
- FS: File system abuse
- PERSIST: Persistence mechanisms
- CRYPTO: Cryptominer detection
- SHELL: Reverse shell patterns
- MANIFEST: Permission mismatches
Run clawshield rules to see the full list.
Contributing
We welcome contributions! See CONTRIBUTING.md for guidelines.
Adding Detection Rules
// src/rules/index.ts
export const rules: Rule[] = [
{
id: 'CUSTOM001',
name: 'My Custom Rule',
severity: 'high',
pattern: /suspicious\.pattern/,
description: 'Detects suspicious patterns',
},
// ...
];Security
Found a vulnerability in ClawShield itself? Email [email protected].
License
MIT © ClawShield Team
Built for the OpenClaw community 🦞
