Move production SSH behind Tailscale and close public port 22

Open
#137 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
52/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
ansible, github-actions

Research direction

Start by reading group_vars/production/main.yml and the deploy.yml workflow, then locate the production inventory and the DigitalOcean firewall and UFW configuration. Follow the rollout order in the issue, verifying SSH and Ansible access over Tailscale before removing public port 22. Done means production deploys work over Tailscale and port 22 is no longer publicly reachable.

Written by the indexing model from the issue text.

Description

The DigitalOcean firewall (wp-packages) limits TCP 80/443 to Cloudflare (#135), but TCP 22 is still open to the internet. SSH is key-only with fail2ban, so this is hardening rather than urgent, but closing it would leave no TCP port directly reachable on the droplet. That matters for kernel TCP bugs like CVE-2026-98432, which can be reached through any open port.

Setup

  • Create a tailnet and invite everyone in users (group_vars/production/main.yml): swalkinshaw, log1x, qwp6t
  • Write an ACL policy: admins → tag:wp-packages-prod:22, tag:ci → tag:wp-packages-prod:22
  • Create a tagged auth key for the server and an OAuth client for CI (tag:ci, ephemeral nodes)

Changes

  • Ansible: install Tailscale from its apt repo and join with the auth key (stored in the vault), tagged tag:wp-packages-prod
  • Keep OpenSSH and the existing authorized_keys; UFW allows 22 on tailscale0 only
  • deploy.yml workflow: add the tailscale/github-action step before Ansible runs (pin to a commit SHA)
  • Point ansible_host at the Tailscale MagicDNS name in the local inventory and the PROD_INVENTORY_YML_B64 secret

Rollout order (to avoid a lockout)

  1. Join the server to the tailnet with public 22 still open
  2. Verify SSH and Ansible over Tailscale from an admin's machine
  3. Run a deploy from GitHub Actions over Tailscale
  4. Only then delete the TCP 22 rule from the DigitalOcean firewall and the public ufw allow 22

Tailscale only makes outbound connections, so no inbound rule is needed for it. If Tailscale ever breaks, the fallback is DigitalOcean's web console for the droplet.

Dominant language
Go
Stars
146
Forks
9
Avg merge
5d 18h
Merged PRs (30d)
4

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from roots/wp-packages

All issues in roots/wp-packages

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.