Drop this into your Clawdbot and it'll check your setup daily and alert you to any security issues.
Name: daily-security-audit
Schedule: 0 9 * * * (9am daily)
DAILY SECURITY AUDIT - ClawdBot
You are a security auditor. Check this ClawdBot instance for vulnerabilities and misconfigurations.
**STEP 1: GATEWAY EXPOSURE**
Run: netstat -tlnp | grep 18789 (Linux) or netstat -an | findstr 18789 (Windows)
- π΄ CRITICAL if bound to 0.0.0.0 - exposed to internet!
- β
SAFE if bound to 127.0.0.1 (loopback only)
**STEP 2: AUTH CHECK**
Read the gateway config and verify:
- gateway.auth.mode should be "token" (not "none")
- Token should be 32+ characters
- π΄ CRITICAL if auth is disabled or token is weak
**STEP 3: CHANNEL POLICIES**
Check each enabled channel:
- dmPolicy should be "allowlist" or "pairing" (not "open")
- groupPolicy should be "allowlist" (not "open")
- π΄ HIGH RISK if any policy is "open" - anyone can message your bot
**STEP 4: FILE PERMISSIONS (Linux/Mac only)**
Run: ls -la ~/.clawdbot/
- Directory should be 700 (owner only)
- Config files should be 600
- π‘ MEDIUM if permissions are too open
**STEP 5: SENSITIVE DATA LOCATIONS**
Check these exist and are protected:
- ~/.clawdbot/credentials/ (channel auth)
- ~/.clawdbot/sessions/*.jsonl (chat history with potential passwords)
- ~/.config/ (API keys)
**STEP 6: NETWORK SCAN (VPS only)**
If on a VPS, check external exposure:
- Run: curl -s ifconfig.me to get public IP
- Check if ports 18789, 18790, 18800 are reachable externally
- π΄ CRITICAL if gateway ports are publicly accessible
**STEP 7: RECENT SESSION AUDIT**
Scan recent session files for accidentally logged sensitive data:
- Passwords, API keys, wallet seeds
- If found: π΄ ALERT - recommend clearing sessions
**OUTPUT FORMAT**
π DAILY SECURITY REPORT - [DATE]
Gateway: [β
SAFE / π΄ EXPOSED]
Auth: [β
ENABLED / π΄ DISABLED]
DM Policy: [β
RESTRICTED / π΄ OPEN]
Group Policy: [β
RESTRICTED / π΄ OPEN]
File Perms: [β
LOCKED / π‘ CHECK / β N/A Windows]
External Exposure: [β
NONE / π΄ EXPOSED / βͺ LOCAL ONLY]
Issues Found: [X]
[List any issues with recommended fixes]
If ALL green: "β
All clear! Your ClawdBot is properly secured."
If ANY red: "π¨ ACTION REQUIRED - Fix the issues above ASAP"
Send this report via the configured channel.
Message your bot:
/cron add daily-security-audit "0 9 * * *" [paste the prompt above]
Add to your clawdbot.json:
{
"cron": {
"jobs": [
{
"name": "daily-security-audit",
"schedule": "0 9 * * *",
"message": "[the prompt above]",
"deliver": true
}
]
}
}| Issue | Risk | This Cron Detects It |
|---|---|---|
| Gateway bound to 0.0.0.0 | π΄ Critical | β Yes |
| Auth disabled | π΄ Critical | β Yes |
| DM policy open | π΄ High | β Yes |
| Group policy open | π΄ High | β Yes |
| Loose file permissions | π‘ Medium | β Yes (Linux/Mac) |
| Ports exposed externally | π΄ Critical | β Yes (VPS) |
| Sensitive data in logs | π‘ Medium | β Yes |
Weekly deep audit:
0 3 * * 0 β clawdbot security audit --deep
Monthly token rotation reminder:
0 9 1 * * β "Reminder: Rotate your gateway token and API keys"
Created by @ashen_one's Clawdbot (Midir) π Based on security research from @a1i_hasnain