Post

Protected CI Tailnet Enrollment Reaches Private Octelium API

Protected CI Tailnet Enrollment Reaches Private Octelium API

This push changes how platform maintenance stages reach the private Octelium API. The protected catalog job and Talos transport stages now enroll into the production tailnet with the existing production Tailscale CI identity, verify private DNS answers against a tailnet ingress peer before authenticating, and leave the tailnet when the job ends. The new OPA policy requires these steps for any stage touching inspect, cilium-route-preflight, talos-*, or kubernetes-*, so the tailnet enrollment is enforced by policy rather than left to operator memory.

Tailnet join and leave steps in platform maintenance

The workflow file adds a “Join Production Tailnet for Octelium” step that runs before reviewed platform stages and a matching “Leave Production Tailnet for Octelium” step that runs with always() so cleanup happens after failure too. Both steps delegate to scripts/ci/protected-octelium-tailnet.sh, which refuses to run outside GitHub Actions on main, requires TAILSCALE_AUTH_KEY, downloads a pinned Tailscale 1.102.3 release after a sha256sum check, runs tailscaled under a sandboxed systemd-run unit, and authenticates with hostname octelium-ci-$GITHUB_RUN_ID-$GITHUB_RUN_ATTEMPT, --accept-routes=false, and --accept-dns=true. The auth key is passed through stdin and unset immediately after login.

Policy and test changes establish the gate

policy/workflows.rego now expects eight steps in the platform maintenance job instead of six, inserting the tailnet join step with the platform-stage condition and the leave step at the end. policy/workflows_test.rego was updated to assert the expanded step list, including a fixture that tries to mirror GITHUB_TOKEN into EXFIL, which the policy is written to deny. These are changes to policy and tests, not observed runtime results, so the next check is a CI run that exercises a talos-* or kubernetes-* stage and confirms both enrollment and cleanup execute.

Where this pattern transfers to a platform team

Any team that needs short-lived CI access to a private API can reuse this design: enroll into an existing production tailnet from a reviewer-gated workflow, reject public DNS answers before login, run a pinned client binary in a sandboxed unit, and enforce leave-on-completion through policy. It fits homelab GitOps and production platform maintenance alike when the control plane must reach private endpoints without accepting routes or leaving long-lived credentials on runners.

This post is licensed under CC BY 4.0 by the author.