simple-openclaw provides a multi-layered security system to protect your deployment:
- File permission enforcement
- Secret leak detection and redaction
- API key validation
- Network binding audit
- Plugin policy governance
- Plugin source code scanning
- Config integrity verification
- Process security checks
Run a full security audit:
./bin/simple-openclaw security auditThis checks 8 categories and produces a report saved to ~/.simple-openclaw/reports/security/.
| Category | Details |
|---|---|
| File Permissions | Config/state/backup dirs should be 700; secrets/env/policy files should be 600; also checks ~/.openclaw/.env and openclaw.json |
| Secret Leak Scan | Scans all log files and config files for plain-text API keys from secrets.json |
| API Key Validation | Checks key length (min 10 chars), detects placeholder values like test-key, your-xxx, changeme |
| Network Binding | Detects if the gateway is listening on 0.0.0.0 (all interfaces) instead of 127.0.0.1 |
| Plugin Policy | Checks allowlist for wildcards, version pinning policy, unpinned plugins, unapproved plugins |
| Plugin Security Scan | Static analysis of installed plugin code (see below) |
| Config Integrity | Validates JSON format of secrets.json, policy.json, openclaw.json; scans env file for embedded secrets |
| Process Security | Warns if the gateway process is running as root |
Each audit run produces a summary:
status=PASS-- no issues foundstatus=WARN-- warnings found (non-critical)status=FAIL-- critical issues found, action required
Fix detected security issues automatically:
./bin/simple-openclaw security hardenWhat it fixes:
- Sets directory permissions to 700 (config, state, backups, snapshots)
- Sets file permissions to 600 (env, secrets.json, policy.json,
~/.openclaw/.env) - Redacts leaked API keys found in log files
- Tightens world-readable config files containing API keys
Scan installed plugins for dangerous code patterns before trusting them:
# Scan all installed plugins
./bin/simple-openclaw plugin scan
# Scan a specific plugin
./bin/simple-openclaw plugin scan @openclaw/feishu1. Package Metadata
Checks package.json for:
preinstall/postinstallhooks that download from the network (curl,wget,http)preinstall/postinstallhooks with suspicious commands (eval,rm -rf,chmod 777)- Inline code execution in hooks (
node -e,python -c,bash -c) - Package name mismatches (declared name differs from expected -- identity spoofing)
- Typosquatting dependency names (e.g.
crossenvinstead ofcross-env) - Excessive dependency count (> 50)
2. Source Code Analysis
Scans all .js files (up to 200 files, depth 4) for:
| Pattern | Risk Level | Description |
|---|---|---|
eval() / new Function() |
RISK | Dynamic code execution |
child_process / exec / spawn |
WARN | System command execution |
| Hardcoded IP network requests | WARN | Requests to IP addresses instead of domains |
| System path writes | RISK | writeFileSync to /etc, /usr, /bin |
| Crypto mining indicators | RISK | stratum+tcp, coinhive, xmrig, mining pool |
| Environment exfiltration | RISK | JSON.stringify(process.env) combined with send/post |
| Code obfuscation | WARN | Hex/unicode escape sequences, base64 decoding |
3. Permissions & Binaries
- Native binary modules (
.node,.so,.dylib,.dll) - Unexpected executable files outside
bin/ - setuid/setgid files (critical security risk)
Each plugin receives one of three verdicts:
- CLEAN -- no risks or warnings found
- REVIEW_RECOMMENDED -- warnings found, manual review advised
- DANGEROUS -- critical risks found, do not enable without investigation
The policy file at ~/.simple-openclaw/config/policy.json controls:
{
"plugins": {
"allow": ["@openclaw/feishu", "qqbot"],
"pinVersions": true
}
}allow-- whitelist of permitted plugin packages (no wildcards)pinVersions-- require all plugins to be pinned to specific versions
Check compliance with:
./bin/simple-openclaw plugin audit- Always run
security auditafter initial setup - Run
security hardento auto-fix permission issues - Run
plugin scanbefore enabling any new plugin - Keep
pinVersions: truein your policy - Never add
"*"to the plugin allowlist - Review
plugin scanoutput for any RISK findings before enabling a plugin - Avoid running the gateway as root
- Bind the gateway to
127.0.0.1instead of0.0.0.0unless external access is required