Production-grade security audits for OpenClaw AI agent runtimes.
graph LR
A[Start Scan] --> B{Discover Configs}
B -->|Found| C[Parse Configs]
B -->|None| D[System Checks Only]
C --> E[Run 12 Security Checks]
D --> E
E --> F[Generate Report]
F --> G{Critical Issues?}
G -->|Yes| H[Fail Build / Suggest Fix]
G -->|No| I[Pass]
- Zero Dependencies: Written in pure Bash (runs on Linux, macOS, WSL).
- Auto-Fix: Automatically remediates critical issues like exposed ports and missing allowlists.
- CI/CD Ready: Outputs JSON reports for pipeline integration.
- Smart Discovery: Automatically finds configurations in
.openclaw,.moltbot,.clawdbot, and environment variables.
Quick scan (no install):
curl -sL https://raw.githubusercontent.com/legendaryabhi/openclaw-security-scan/main/scan.sh | bashInstall locally (recommended — enables fix command):
curl -sL https://raw.githubusercontent.com/legendaryabhi/openclaw-security-scan/main/scan.sh -o scan.sh
chmod +x scan.sh
./scan.sh scan# Full security audit
./scan.sh scan
# JSON output (for CI/CD pipelines)
./scan.sh scan --json
# Auto-fix critical issues (interactive)
./scan.sh fix
# Auto-fix without confirmation (for scripts)
./scan.sh fix --yes| # | Check | Severity | What it detects |
|---|---|---|---|
| 1 | Gateway Binding | CRITICAL | Gateway listening on 0.0.0.0 (exposed to network) instead of 127.0.0.1. |
| 2 | API Keys Exposure | CRITICAL | Plaintext API keys (OpenAI, Anthropic, etc.) hardcoded in config files instead of .env. |
| 3 | File Permissions | CRITICAL | Config files readable by other users (should be 600). |
| 4 | HTTPS/TLS | WARNING | No TLS/HTTPS configuration detected for the gateway. |
| 5 | Shell Command Allowlist | CRITICAL | Missing tools.exec.safeBins — allows agent to run arbitrary system commands. |
| 6 | Sensitive Directories | WARNING | Agent has access to sensitive paths like ~/.ssh, ~/.gnupg, /etc/shadow. |
| 7 | Webhook Auth | WARNING | Webhook endpoints configured without authentication tokens. |
| 8 | Sandbox Isolation | WARNING | Agent not running inside a Docker container or sandbox environment. |
| 9 | Default/Weak Credentials | CRITICAL | Use of default tokens (changeme, admin) or undefined token bug. |
| 10 | Rate Limiting | WARNING | No rate limiting configured, leaving the agent open to DoS. |
| 11 | Node.js Version | CRITICAL | Vulnerable Node.js versions susceptible to CVE-2026-21636 (permission model bypass). |
| 12 | Control UI Auth | CRITICAL | Auth bypass flag enabled for the Control UI. |
The fix command (./scan.sh fix) automatically remediates the following critical issues:
- Rebinds Gateway: Changes
host: 0.0.0.0to127.0.0.1. - Fixes Permissions: Sets config file permissions to
600(read/write by owner only). - Adds Allowlist: Injects a safe default
safeBinslist (ls, grep, cat, etc.) if missing. - Enables Auth: Disables
authBypassflags for the Control UI.
Note: A timestamped backup of your config is created in ~/.scan-backup/ before any changes are made.
Contributions are welcome!
Read the CONTRIBUTING.md for details.
MIT — see LICENSE.
Maintained by Abhinav Sharma