--- agent: host-operator slug: ufw-admin-allowlist title: UFW k3s API admin allowlist version: 0.1.0 last_updated: "2026-07-16" --- # UFW admin allowlist (k3s API / port 6443) ## Purpose After world-open `6443/tcp` is removed, remote `kubectl` / k3s API access works only from **explicitly allowlisted public IPs**. This procedure adds, lists, and removes admin IPs safely. **Access class:** `firewall_change` — requires recorded human approval on production. ## When to use - New admin laptop / office / mobile network needs direct API access to the node - Admin public IP changed (ISP / travel) - CI or jump host must hit public `:6443` (prefer SSH tunnel when possible) ## When not needed - SSH into the host and run `sudo k3s kubectl …` locally - Access only via SSH tunnel / ops-bridge (SSH already open) - IP is already listed in `ufw status` ## Preconditions - SSH access to the host as an operator with passwordless or approved sudo - Approver recorded for `firewall_change` on production hosts - Target public IP known (see Discover IP) ## Discover IP (from the admin machine) ```bash curl -4 -s ifconfig.me; echo # or curl -4 -s https://api.ipify.org; echo ``` Use the **public IPv4**, not a private LAN address (unless that is how the host sees you). ## List current rules ```bash ssh 'sudo ufw status numbered verbose' ``` Note OpenSSH should remain `Anywhere` (or your org policy). k3s API lines look like: ```text 6443/tcp ALLOW IN # k3s-api-admin-