Skip to content

Security hardening skill for Clawdbot VPS installations. Fresh Ubuntu → locked-down private AI server.

Notifications You must be signed in to change notification settings

dennisonbertram/clawdbot-safe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

🦞 Clawdbot Safe

Harden your Clawdbot VPS from exposed nightmare to private AI fortress.

A comprehensive security hardening skill for Clawdbot installations on VPS servers. Takes you from fresh Ubuntu to locked-down private AI server.

Why This Exists

Running Clawdbot on a VPS without proper hardening is a security nightmare:

  • Hundreds of exposed gateways leaving API keys and private chats vulnerable
  • Infostealers actively targeting Clawdbot - RedLine, Lumma, and Vidar now sweep ~/.clawdbot/ directories
  • Gateway token theft = RCE - One leaked token gives attackers shell access to your machine
  • Open DM policies let strangers control your AI and inject malicious prompts

What This Skill Does

Implements defense-in-depth across four layers:

┌─────────────────────────────────────────────────────────────┐
│  Phase 1: OS Security                                       │
│  └── SSH hardening, UFW firewall, Fail2ban                  │
├─────────────────────────────────────────────────────────────┤
│  Phase 2: Network Isolation                                 │
│  └── Tailscale VPN, port restrictions, no public exposure   │
├─────────────────────────────────────────────────────────────┤
│  Phase 3: Clawdbot Security                                 │
│  └── DM allowlists, file permissions, sandboxing            │
├─────────────────────────────────────────────────────────────┤
│  Phase 4: Verification                                      │
│  └── Security audit, status checks, compliance validation   │
└─────────────────────────────────────────────────────────────┘

Quick Start

Option 1: Automated Hardening

# Download and run the hardening script
curl -fsSL https://raw.githubusercontent.com/dennisonbertram/clawdbot-safe/main/clawdbot-safe/scripts/harden.sh -o harden.sh
chmod +x harden.sh

# Run with your Telegram ID
./harden.sh --telegram-id YOUR_TELEGRAM_ID

Option 2: Use as Claude Code Skill

  1. Download the skill:

    curl -LO https://github.com/dennisonbertram/clawdbot-safe/releases/latest/download/clawdbot-safe.zip
  2. Install in Claude Code:

    unzip clawdbot-safe.zip -d ~/.claude/skills/
  3. Invoke the skill:

    /clawdbot-safe
    

Option 3: Manual Hardening

Follow the step-by-step guide in SKILL.md.

What Gets Hardened

OS Level

  • ✅ SSH: Key-only authentication, no root login
  • ✅ Firewall: Default-deny incoming with UFW
  • ✅ Brute-force protection: Fail2ban auto-bans attackers

Network Level

  • ✅ Tailscale VPN: Private mesh network for access
  • ✅ No public SSH: Only accessible via Tailscale
  • ✅ No public web ports: Gateway only via Tailscale
  • ✅ Optional IPv6 disable: Reduced attack surface

Clawdbot Level

  • ✅ DM Policy: Allowlist mode (only you can message the bot)
  • ✅ Group Policy: Allowlist with mention gating
  • ✅ File Permissions: 600/700 on all sensitive files
  • ✅ Gateway Auth: Token-based authentication
  • ✅ Tool Sandboxing: Isolated execution environment
  • ✅ Sensitive Logging: Redaction enabled

Included Scripts

Script Purpose
harden.sh Full automated hardening for fresh Ubuntu VPS
verify.sh Post-hardening verification (checks all security controls)
audit.sh Quick security status check

Final State Checklist

After hardening, your setup should have:

  • No public SSH (only via Tailscale 100.64.0.0/10)
  • No public web ports (only via Tailscale)
  • Server only reachable via Tailscale VPN
  • Bot responds only to allowlisted user IDs
  • All credential files have 600/700 permissions
  • clawdbot security audit --deep passes

Threat Model

This skill protects against:

Threat Attack Vector Protection
Credential Theft Infostealers targeting ~/.clawdbot/ File permissions, encryption at rest
Unauthorized Access Open DM policies, exposed ports Allowlists, Tailscale isolation
Network Attacks Public SSH/web exposure UFW + Tailscale, Fail2ban
Prompt Injection Malicious content in URLs/files Sandboxing, model selection

See threat_model.md for detailed analysis.

Recovery

Locked out of SSH?

  1. Access via VPS provider's console/VNC
  2. Re-enable password auth:
    sudo sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config
    sudo systemctl reload ssh
  3. Fix SSH keys, then re-harden

Suspected Compromise?

# 1. Stop gateway immediately
pkill -f clawdbot

# 2. Lock down network
sudo ufw default deny incoming && sudo ufw reload

# 3. Rotate ALL credentials
# See SKILL.md for full incident response

References

Contributing

Issues and PRs welcome. Security issues should be reported privately.

License

MIT


"You buckle your seatbelts before you step on the gas."

About

Security hardening skill for Clawdbot VPS installations. Fresh Ubuntu → locked-down private AI server.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages