Guides
8 min

I Wasted 3 Weekends Hardening OpenClaw

Three weekends of Docker configs, reverse proxies, TLS certs, and egress controls. The full story of hardening OpenClaw by hand, and why I'd skip it today.

Clawctl Team

Product & Engineering

I Wasted 3 Weekends Hardening OpenClaw. Here's What I'd Do Instead.

I pulled up the OpenClaw docs on a Friday night. "Quick weekend project," I told myself. Three weekends later, I was still at it.

Not building anything useful. Not shipping features. Just hardening.

Here's every rabbit hole I fell into. And what I'd do differently if I started today.

Weekend 1: Docker and Network Isolation

The default docker-compose.yml ships wide open. Port 3000, bound to 0.0.0.0, no auth. Anyone who finds your IP gets full access. This isn't hypothetical. A Shodan scan found 42,665 exposed OpenClaw instances sitting on the public internet. Sixty-three percent had no authentication at all.

So I started fixing things.

First, bind the gateway to 127.0.0.1 so it only listens on localhost. Then set up Nginx as a reverse proxy. Then realize Nginx needs rate limiting. Then realize the WebSocket connections need special proxy headers. Then realize the sandbox container has its own network exposure.

Four hours in, I had a reverse proxy that mostly worked. "Mostly" because the Control UI WebSocket kept dropping.

What Clawctl does instead: Every instance deploys behind an authenticated reverse proxy with WebSocket support, rate limiting, and DDoS protection. Zero config. Takes about 60 seconds.

Weekend 1 (Still): TLS Certificates

Let's Encrypt is free. Setting it up is not.

Certbot needs a DNS challenge or HTTP challenge. HTTP challenges need port 80 open temporarily. DNS challenges need API access to your DNS provider. Auto-renewal needs a cron job that actually works. And you need to handle the edge case where the cert expires because the renewal failed silently three weeks ago.

I went with DNS challenge through Cloudflare. Took 90 minutes to get the API token scoped correctly.

What Clawctl does instead: TLS is automatic. Provision, done. Renewed before expiry, every time. No cron jobs to babysit.

Weekend 2: Credential Encryption and Rotation

OpenClaw stores API keys in plain text by default. Your OpenAI key, your Anthropic key — sitting in a JSON file on disk.

So I set up encrypted-at-rest storage. Wrote a wrapper script to encrypt credentials with age. Then realized I needed a key rotation strategy. Then realized the gateway needs the decrypted keys at runtime. Then realized I'd built a bad version of Vault.

This took an entire Saturday.

Then I read about the 824 malicious skills on ClawHub and realized credential theft was the primary attack vector. My encryption didn't matter if a malicious skill could read environment variables at runtime.

That sent me down the egress control rabbit hole.

What Clawctl does instead: All credentials are encrypted with AES-256 at rest and in transit. Key rotation is built in. Skills run in sandboxed environments with no access to raw API keys.

Weekend 2 (Still): Egress Controls

Egress controls prevent your agent from calling home to an attacker's server. Without them, a malicious skill can exfiltrate your data to any URL on the internet.

I tried iptables first. Wrote rules to block all outbound traffic except approved domains. Broke DNS resolution. Fixed that. Broke the agent's ability to call LLM APIs. Fixed that. Broke webhook integrations. Gave up on iptables.

Switched to Squid proxy. Three hours of config tuning. Got it working. Then realized every OpenClaw update could break the proxy configuration.

What Clawctl does instead: Network-level egress controls enforce allowlists per agent. No iptables. No Squid proxy. No breakage on updates.

Weekend 3: Audit Logging

By now I'd read about the EU AI Act enforcement coming August 2026. Every AI agent needs audit logging. Not "nice to have" — legally required.

OpenClaw logs to stdout by default. No structured format. No retention policy. No search.

I set up Loki with Grafana for log aggregation. Then realized I needed to capture which agent did what, when, and why. OpenClaw doesn't emit structured audit events out of the box. So I wrote a middleware layer to intercept API calls and log them.

Another full Saturday. And the logs still wouldn't pass a compliance audit because they lacked tamper-proof integrity verification.

What Clawctl does instead: Every agent action is logged with structured audit events. Who did what, when, which tool, which model, what the output was. Tamper-evident. Searchable. Compliance-ready from day one.

Weekend 3 (Still): The Kill Switch

What happens when your agent goes rogue? Not "if." When. You need a kill switch.

I built a basic one. A webhook that sends a docker stop command. Then realized it needs to work when the agent has consumed all available CPU. Then realized I needed a dead man's switch for when I'm not watching. Then realized the kill switch itself needs auth so attackers can't use it.

At this point I stopped and did the math.

The Math That Changed My Mind

Three weekends. Call it 40 hours.

Even at a modest $75/hour, that's $3,000 in engineering time. For a setup that still had gaps. Still needed ongoing maintenance. Still broke every time OpenClaw pushed an update — and they shipped 9 CVEs in 4 days in early 2026.

Nine CVEs. Each one needs review, patching, and testing against your custom hardening. That's not a weekend project. That's a part-time job.

Meanwhile, $49/month gets you everything I spent 40 hours building. Plus the things I never got to: proper security controls, automated patching, container isolation, and a team that does this full-time.

The annual cost of Clawctl: $588. The cost of my three weekends: $3,000. The cost of the next CVE I don't patch in time: unknown, but probably more than both.

What I'd Do Differently

If I started over today, I wouldn't start at all. Not the hardening part.

I'd spend those three weekends building the thing my agent actually does. The product. The automations. The value.

Security is table stakes, not a competitive advantage. You don't get points for rolling your own TLS. You don't get customers because your iptables rules are elegant.

You get customers because your agent does something useful. And every hour you spend on infrastructure is an hour you don't spend on that.

The Shortcut

Clawctl handles all 23 hardening steps from the OpenClaw hardening guide. Docker isolation, TLS, credential encryption, egress controls, audit logging, kill switch, automated patching. All of it.

See how it compares to other options. Or just skip the comparison and start building.

Deploy Securely — $49/mo →

Your weekends are worth more than $49.

This content is for informational purposes only and does not constitute financial, legal, medical, tax, or other professional advice. Individual results vary. See our Terms of Service for important disclaimers.

Ready to deploy your OpenClaw securely?

Get your OpenClaw running in production with Clawctl's enterprise-grade security.