Prototype KubeClaw is a learning project exploring what a secure, scalable Kubernetes environment for AI agents looks like. It is not production ready and not beta. Expect breaking changes and unreviewed assumptions. Read the project status.

Security

What the setup protects against, what to monitor, and the exact SSH hardening applied.

Security Summary

LayerProtection
Network (Hetzner)Firewall blocks all inbound; IPv6-only, no public IPv4
Network (K8s)Cilium egress whitelist per namespace/app (FQDN-based)
AccessCloudflare Tunnel (outbound-only connection, no open ports)
AuthenticationCloudflare Access policies + SSH key-only auth
ContainerNon-root user, dropped capabilities, resource limits
SSHKey-only auth, fail2ban, no TCP forwarding on workers
StorageIsolated PVCs per workload

What this setup protects against

  • Direct server attacks – no public IPs, no open inbound ports
  • Unauthorized access – Cloudflare Access + SSH key-only auth
  • Data exfiltration – FQDN-based egress whitelist per application
  • Lateral movement – namespace isolation, per-pod network policies
  • Resource abuse – container resource limits

What to monitor

  • API key and token compromise – rotate regularly
  • Cloudflare Tunnel health – monitor via Zero Trust dashboard
  • Node resource utilization – watch for memory pressure on small instances

Security notes

  • Passwords in cloud-init are visible in cloud-init logs. Change them after first login.
  • SSH keys should be different for each server role.
  • Root password is only intended for emergency access via Hetzner Web Console.
  • Terraform state contains sensitive data (private keys when auto-generated). Protect state files.
  • UFW rules for HTTP/HTTPS on worker nodes can be removed after initial setup:
    sudo ufw delete allow out to any port 80 proto tcp
    sudo ufw delete allow out to any port 443 proto tcp
    

OpenClaw-specific security

When running OpenClaw:

ConcernMitigation
Anthropic API key compromiseRotate regularly, monitor usage
Telegram bot token leakMonitor bot activity
Claude providing incorrect informationHuman review of responses

SSH hardening details

All nodes are configured with:

  • PermitRootLogin no
  • PasswordAuthentication no
  • KbdInteractiveAuthentication no
  • MaxAuthTries 3
  • X11Forwarding no
  • AllowAgentForwarding no
  • AllowUsers kubernetes-admin
  • ClientAliveInterval 300
  • ClientAliveCountMax 2

Control nodes additionally allow AllowTcpForwarding yes (needed for ProxyJump and tunnel). Worker nodes set AllowTcpForwarding no.