One-command security audit + auto-fix for OpenClaw. Generates a score, finds vulnerabilities, fixes what it can.
bash
# Full audit — scan everything, show score + findings
python3 scripts/security-hardener.py audit
# Auto-fix all fixable issues (creates backup first)
python3 scripts/security-hardener.py fix
# Scan for exposed API keys only
python3 scripts/security-hardener.py keys
# Check auth configuration
python3 scripts/security-hardener.py auth
# Generate markdown report
python3 scripts/security-hardener.py report
audit — Full Security Audit#Runs all checks, produces a 0-100 security score:
Options: --json for machine-readable output, --verbose for detailed findings.
fix — Auto-Remediate#Creates a timestamped backup, then fixes:
Options: --dry-run to preview fixes without applying, --backup-dir <path>.
keys — API Key Scanner#Searches config files, memory files, SKILL.md files, .env files, shell history, and git history for exposed secrets. Pattern library covers 40+ key formats (AWS, OpenAI, Anthropic, Stripe, etc.).
auth — Auth Configuration Check#Verifies authentication is properly configured:
report — Markdown Report#Generates a security posture report suitable for compliance or auditing. Includes score, all findings, recommendations, and fix commands.
RangeRatingMeaning90-100🟢 ExcellentProduction-ready70-89🟡 GoodMinor issues, fix recommended50-69🟠 FairSignificant gaps, fix required0-49🔴 CriticalUnsafe for any exposure
Each finding has a severity (critical/high/medium/low) and a weight that affects the score.
Checks against known OpenClaw CVEs including:
See references/cve-database.md for full list and mitigation details.