Skip to content

On-host security monitoring for OpenClaw AI agents. File scanning, URL checking, skill auditing, host audit, agent behavior monitoring.

License

Notifications You must be signed in to change notification settings

silentcool/crusty-security

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Crusty Security πŸ›‘οΈ

On-host security monitoring for OpenClaw AI agents. Scans files and skills for malware. Monitors agent behavior for compromise indicators. Audits host security posture.

ClawHub License: MIT


Why Your Agent Needs This

AI agents download files, install skills, and execute code β€” all with your system privileges. A single prompt injection can lead to:

  • 🦠 Malware execution via downloaded files or malicious skill scripts
  • πŸ”— Data exfiltration through hidden webhook calls or reverse shells
  • 🧬 Supply chain attacks from compromised ClawHub skills
  • πŸ”‘ Credential theft from exposed .env files and API keys
  • 🧠 Agent hijacking via modified SOUL.md, AGENTS.md, or MEMORY.md

Crusty Security is the first security skill built specifically for the OpenClaw agent threat model.

Features

Feature Description
File Scanning ClamAV local scan with up-to-date signatures
Skill Auditing Static analysis for reverse shells, crypto miners, data exfiltration, obfuscation
Host Audit Cron jobs, open ports, SSH keys, file permissions, posture scoring (0-100)
Agent Monitoring Detects modified config files, suspicious processes, unexpected outbound connections
ClawHub Sync Tracks installed skill versions against ClawHub catalog, blocklist checking
Quarantine Isolate threats with manifest tracking, never auto-deletes
Reports Markdown security posture reports with recommendations

Quick Start

1. Install

clawhub install crusty-security

That's it. ClamAV is auto-installed on first scan if it's not already present. No separate setup step needed.

2. Start Scanning

# Scan a file
bash scripts/scan_file.sh /path/to/suspicious-file.pdf

# Scan your entire workspace
bash scripts/scan_file.sh -r /data/workspace

# Audit a skill before installing
bash scripts/audit_skill.sh /path/to/skill/

# Full host security audit
bash scripts/host_audit.sh

That's it. Crusty Security works immediately with ClamAV β€” no API keys required.

How It Works: Skill + Dashboard

Crusty Security has two parts that work together β€” but the skill works great on its own too.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   YOUR OPENCLAW AGENT       β”‚         β”‚   CRUSTY SECURITY DASHBOARD  β”‚
β”‚   (your machine / VPS)      β”‚         β”‚   (crustysecurity.com)       β”‚
β”‚                             β”‚  HTTPS  β”‚                              β”‚
β”‚  Crusty Security Skill      β”‚ ──────► β”‚  Web Dashboard               β”‚
β”‚  βœ“ Scans files locally      β”‚  POST   β”‚  βœ“ View all scan results     β”‚
β”‚  βœ“ Audits skills            β”‚         β”‚  βœ“ Manage alerts & threats   β”‚
β”‚  βœ“ Monitors agent behavior  β”‚         β”‚  βœ“ Track agent health        β”‚
β”‚  βœ“ Checks host security     β”‚         β”‚  βœ“ Multi-agent fleet view    β”‚
β”‚                             β”‚         β”‚  βœ“ Email/Slack notifications β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
        runs on YOUR machine               runs at crustysecurity.com

Key concepts:

  • The skill does all the actual security work β€” scanning, auditing, monitoring. It runs on your OpenClaw agent's machine.
  • The dashboard is a web app where you view results, manage alerts, and monitor multiple agents from one place.
  • Data flows one way only: skill β†’ dashboard. The dashboard never connects to your agent. Works behind firewalls, NATs, VPNs β€” no port forwarding needed.
  • The skill is fully functional without the dashboard. The dashboard is optional for users who want centralized visibility.

Connecting Your Agent to the Dashboard (3 steps, 2 minutes)

Step 1: Sign up at crustysecurity.com, go to Agents β†’ + Add Agent. Your API key is generated automatically β€” copy it.

Step 2: The Agents page shows a full copy-pasteable instruction block. Paste it to your OpenClaw agent, or manually set:

export CRUSTY_API_KEY="cg_live_xxxxxxxxxxxxxxxxxxxx"
export CRUSTY_DASHBOARD_URL="https://crustysecurity.com"

Step 3: Restart your OpenClaw agent. It appears in the dashboard within 5 minutes.

What works without the dashboard

Feature Without Dashboard With Dashboard
File scanning (ClamAV) βœ… βœ… + history
Skill auditing βœ… βœ… + tracking
Host security audit βœ… βœ… + trends
Agent monitoring βœ… βœ… + alerts
Quarantine βœ… βœ… + remote view
Email/Slack alerts ❌ βœ…
Multi-agent fleet view ❌ βœ…
Scan scheduling from web ❌ βœ…
Security posture score Local only βœ… aggregated

For OpenClaw agents (reading this as SKILL.md)

If you're an OpenClaw agent and your human has configured CRUSTY_API_KEY, you should:

  1. Include --push when running scans to send results to the dashboard
  2. The heartbeat runs automatically every 5 minutes when the key is set
  3. Use python3 scripts/clawhub_sync.py --push to sync skill inventory to dashboard

All Commands

Command Description
bash scripts/install_clamav.sh Install and configure ClamAV
bash scripts/scan_file.sh <path> Scan a file with ClamAV
bash scripts/scan_file.sh -r <dir> Recursive directory scan
bash scripts/scan_file.sh --incremental -r <dir> Skip unchanged files
bash scripts/scan_file.sh --quarantine <path> Quarantine a file
bash scripts/audit_skill.sh <dir> Audit a skill for threats
bash scripts/host_audit.sh Host security audit
bash scripts/host_audit.sh --deep Deep host audit (includes file modifications)
bash scripts/monitor_agent.sh Agent behavior integrity check
bash scripts/generate_report.sh Generate security posture report
python3 scripts/clawhub_sync.py Sync installed skills against ClawHub catalog

All commands output JSON. All support --help.

Scanning Stack

                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   File arrives β†’   β”‚  ClamAV (local)  β”‚  ← Free, instant, signature-based detection
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

ClamAV handles zip, rar, 7z, tar, gz archives natively. Encrypted archives are flagged as "unscanned."

Skill Auditing β€” What It Catches

Static analysis specifically tuned for the OpenClaw threat model:

Severity Pattern
πŸ”΄ Critical curl | sh, reverse shell patterns, crypto mining indicators
🟠 High eval/exec with dynamic input, base64 decode chains, webhook.site/ngrok exfil, credential harvesting, binaries in skill dirs
🟑 Medium Hidden files, system file access, hardcoded IPs, obfuscated code, persistence mechanisms (cron, systemd)
πŸ”΅ Info Large skill size, credential references in docs

Host Audit Scoring

The host audit produces a posture score from 0-100:

Score Rating Meaning
90-100 🟒 Excellent Minimal risk
70-89 🟑 Good Minor issues to address
50-69 🟠 Fair Several findings, take action
0-49 πŸ”΄ Poor Significant security issues

Deductions: Critical (-25), High (-15), Medium (-10), Low (-5).

Agent Behavior Monitoring

Detects indicators of agent compromise:

  • Modified AGENTS.md, SOUL.md, MEMORY.md, TOOLS.md (config tampering)
  • Unexpected cron jobs or scheduled tasks
  • Suspicious outbound connections (IRC, Tor, backdoor ports)
  • Files created outside workspace (/tmp executables, home directory changes)
  • Suspicious processes (crypto miners, netcat listeners, tunneling tools)
  • Exposed credentials (world-readable .env files, SSH keys)

ClawHub Supply Chain Monitoring

The clawhub_sync.py script protects against malicious or compromised skills:

  • Fetches the full ClawHub catalog (400+ skills)
  • Compares installed skill versions against latest
  • Checks against a blocklist of known-bad skills
  • Flags skills not found on ClawHub (potential forks or custom builds)
  • Detects version drift across multiple agents
  • Pushes results to the dashboard (if configured)
# One-time sync
python3 scripts/clawhub_sync.py

# JSON output (for automation)
python3 scripts/clawhub_sync.py --json

# With dashboard push
python3 scripts/clawhub_sync.py --push

Automatic Scan Schedule

Crusty Security automatically configures recurring scans when your OpenClaw agent first uses the skill. No manual setup needed. The agent sets up:

Frequency What runs Requires Dashboard?
Every 5 min Dashboard heartbeat (agent status) βœ…
Daily 3am Incremental workspace scan + agent integrity check ❌
Weekly Sunday 3am Full workspace scan + host audit + all skills audit + security report ❌
Every 12 hours ClawHub skill inventory sync βœ…
Monthly 1st Deep host security audit ❌

You can adjust schedules by asking your agent to modify the cron jobs.

Requirements

  • OS: Linux (tested on Debian/Ubuntu, works in Docker)
  • Python: 3.8+
  • ClamAV: Installed via install_clamav.sh or manually
  • Disk: ~300MB for ClamAV signatures

Raspberry Pi / Low Memory

  • <2GB RAM: Runs in on-demand mode (no ClamAV daemon)
  • <1GB RAM: Use skill auditing + agent monitoring (lightweight shell/Python scripts)

Environment Variables

Variable Default Required Description
CRUSTY_API_KEY β€” No Dashboard API key (from crustysecurity.com)
CRUSTY_DASHBOARD_URL β€” No Dashboard URL
CLAWGUARD_QUARANTINE /tmp/clawguard_quarantine No Quarantine directory
CLAWGUARD_LOG_DIR /tmp/clawguard_logs No Scan log directory
CLAWGUARD_MAX_FILE_SIZE 200M No Max file size for scanning
CLAWGUARD_WORKSPACE /data/workspace No Agent workspace path

File Structure

clawguard/
β”œβ”€β”€ SKILL.md              # Agent instructions (OpenClaw reads this)
β”œβ”€β”€ README.md             # Human documentation (you're reading it)
β”œβ”€β”€ LICENSE.txt           # MIT License
β”œβ”€β”€ CHANGELOG.md          # Version history
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ install_clamav.sh     # ClamAV installer
β”‚   β”œβ”€β”€ scan_file.sh          # File/directory scanner
β”‚   β”œβ”€β”€ audit_skill.sh        # Skill static analysis
β”‚   β”œβ”€β”€ host_audit.sh         # Host security audit
β”‚   β”œβ”€β”€ monitor_agent.sh      # Agent behavior monitoring
β”‚   β”œβ”€β”€ generate_report.sh    # Security report generator
β”‚   β”œβ”€β”€ clawhub_sync.py       # ClawHub catalog sync
β”‚   └── dashboard.sh          # Dashboard integration library
└── references/
    β”œβ”€β”€ setup.md              # Detailed setup guide
    β”œβ”€β”€ threat-patterns.md    # Threat pattern database
    └── remediation.md        # Incident response procedures

Offline Mode

Crusty Security works fully offline with reduced capability:

Feature Offline Online
ClamAV file scanning βœ… (local signatures) βœ… (fresh signatures)
Skill auditing βœ… (static analysis) βœ…
Host auditing βœ… βœ…
Agent monitoring βœ… βœ…
ClawHub sync ❌ βœ…

Contributing

Issues and PRs welcome at github.com/silentcool/crusty-security.

License

MIT β€” see LICENSE.txt.

Links

About

On-host security monitoring for OpenClaw AI agents. File scanning, URL checking, skill auditing, host audit, agent behavior monitoring.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published