Skip to content

legendaryabhi/openclaw-security-scan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🦀 OpenClaw Security Scan

Production-grade security audits for OpenClaw AI agent runtimes.

workflow

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]
Loading

Features

  • 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.

Install

Quick scan (no install):

curl -sL https://raw.githubusercontent.com/legendaryabhi/openclaw-security-scan/main/scan.sh | bash

Install 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

Usage

# 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

Security Checks (12)

# 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.

Fix Command

The fix command (./scan.sh fix) automatically remediates the following critical issues:

  1. Rebinds Gateway: Changes host: 0.0.0.0 to 127.0.0.1.
  2. Fixes Permissions: Sets config file permissions to 600 (read/write by owner only).
  3. Adds Allowlist: Injects a safe default safeBins list (ls, grep, cat, etc.) if missing.
  4. Enables Auth: Disables authBypass flags for the Control UI.

Note: A timestamped backup of your config is created in ~/.scan-backup/ before any changes are made.

Contributing

Contributions are welcome!

Read the CONTRIBUTING.md for details.

License

MIT — see LICENSE.


Maintained by Abhinav Sharma

About

A CLI security scanner for OpenClaw AI agents that finds risky configurations and helps lock down agent runtimes before production.

Resources

License

Contributing

Stars

5 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages