Harden Stack
clawops_hardenApply security hardening to a deployed stack: SSH, firewall, fail2ban, unattended-upgrades, Docker socket, and per-cloud checks. Optionally join Tailscale for private access.
Instructions
Apply security hardening to a deployed stack: SSH, UFW, fail2ban, unattended-upgrades, the Docker socket, and per-cloud checks. Optionally join the stack to a Tailscale network and reach it there instead of over the public internet.
Use when: the user asks to harden, secure, or lock down a stack; asks what the hardening report says (with dryRun: true, which changes nothing); or asks to put a stack on their tailnet.
tailscale: true installs Tailscale, joins the tailnet as clawops-, and
then moves clawops onto that address — but only after opening an SSH session to
it, against host keys pinned over the connection already trusted. If that fails,
nothing is recorded and the public address stays in use. The auth key comes from
clawops secret set TAILSCALE_AUTH_KEY and is never passed through this tool
(R6).
tailscaleRevert: true takes the host back off the tailnet, over its public address. On a private-only stack it refuses and names the plan/apply commands that reopen SSH first — relay them rather than trying to work around it.
To close the public ports afterwards, plan with privateOnly: true and apply that plan; this tool does not change firewall rules.
Do NOT use when: the user wants to know whether a stack is healthy — that is clawops_doctor. Do NOT pass tailscale and tailscaleRevert together.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| yes | No | Skip elicitation; CI/scripted use only | |
| dryRun | No | Report the current state, change nothing | |
| options | No | Comma-separated module IDs; default is every defaultOn module for the provider | |
| stackName | No | Which stack to harden. Omitted = the default stack in ~/.clawops/config.json | |
| tailscale | No | Join the tailnet, verify this machine reaches the host there, then use that address | |
| tailscaleRevert | No | Leave the tailnet and go back to the public address |