Skip to content
6 min read Updated

Migrating Atlantis to an LXC Accidentally Made It Fully Public

Moving Atlantis from Kubernetes to an LXC repointed the Cloudflare Tunnel past Traefik and Authelia. For about 18 hours the UI was open to anyone.


Disclosure: This post contains Amazon affiliate links (marked with *). As an Amazon Associate I earn from qualifying purchases. Buying through them costs you nothing extra.

SEC-008 was a finding from an earlier security audit: Atlantis was accessible without authentication. The fix was straightforward: an Authelia ForwardAuth middleware on the Traefik IngressRoute, gating the UI and every endpoint except the GitHub webhook path, which has its own HMAC-based authentication.

That fix held for months. An unrelated infrastructure migration that nobody checked against the auth model reopened it.

View the complete homelab infrastructure source on GitHub

The Migration That Reopened the Exposure

Atlantis moved from a Kubernetes deployment to a dedicated LXC container (ADR-012). The Kubernetes deployment had a Service, an IngressRoute and Traefik middleware handling the routing, including the Authelia gate. The LXC had none of that: a bare server running the Atlantis binary directly.

The Cloudflare Tunnel configuration for atlantis.woitzik.dev was updated to point at the LXC’s IP and port instead of the old Kubernetes Service. This was the only change anyone thought about. It worked: atlantis.woitzik.dev resolved and served the Atlantis UI.

The new path had no Traefik, so no Authelia middleware, so no authentication.

Old path:
Cloudflare Tunnel → Traefik (HTTPS, Authelia ForwardAuth) → Kubernetes Service → Atlantis pod

New path (broken):
Cloudflare Tunnel → LXC:4141 (direct, no auth)

Atlantis’s only built-in protection for the UI is optional HTTP basic auth (--web-basic-auth with --web-username/--web-password), and it is off by default. It wasn’t enabled here, because Authelia was supposed to do that job. Without the proxy, the UI was fully open.

What “Fully Open” Meant

The Atlantis UI at atlantis.woitzik.dev showed:

  • Full list of PR plans and apply history
  • Unlock controls for Terraform workspace locks, plus the global apply lock
  • Apply status for every pending plan
  • Enough context to infer the entire infrastructure topology

Worse: the GitHub webhook endpoint (/events) verifies an HMAC signature, so forged webhook calls would have been rejected, but the UI controls themselves (discarding locks, toggling the global apply lock) were unauthenticated. Plans and applies are still triggered through PR comments, but anyone who found the URL during that window could have interfered with in-flight Terraform operations.

I confirmed the exposure with an unauthenticated GET to the live URL from an external network: the full Atlantis UI with a 200 response. No credentials, no redirect to Authelia.

# Confirmed live during audit
curl -s -o /dev/null -w "%{http_code}" https://atlantis.woitzik.dev/
# → 200 (expected: 302 to auth.woitzik.dev)

The Fix: Restore the Traefik/Authelia Pattern

The right model already existed: the external-host routing pattern used for Proxmox (pve-final) and PBS (pbs-final), which also run outside Kubernetes but still need to be gated. An IngressRoute with the Authelia middleware, backed by a selector-less Service with a manual Endpoints object pointing at the LXC:

# kubernetes/system/apps-ingressroute.yml (excerpt)
apiVersion: v1
kind: Service
metadata:
  name: external-atlantis
  namespace: apps
spec:
  ports:
    - port: 4141
      targetPort: 4141
---
apiVersion: v1
kind: Endpoints
metadata:
  name: external-atlantis
  namespace: apps
subsets:
  - addresses:
      - ip: 10.0.20.250
    ports:
      - port: 4141
---
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
  name: atlantis-final
  namespace: apps
spec:
  entryPoints: [websecure]
  routes:
  # GitHub webhook - HMAC auth, no Authelia needed
  - match: Host(`atlantis.woitzik.dev`) && PathPrefix(`/events`)
    kind: Rule
    priority: 10
    services: [{name: external-atlantis, port: 4141}]
  # Everything else - Authelia gate required
  - match: Host(`atlantis.woitzik.dev`)
    kind: Rule
    priority: 1
    middlewares:
      - name: authelia
      - name: websockets
    services: [{name: external-atlantis, port: 4141}]
  tls: {secretName: wildcard-woitzik-dev-tls}

The Cloudflare Tunnel was repointed from the LXC’s direct IP back to Traefik’s HTTPS entrypoint, so the IngressRoute actually applies. After deployment, the same curl test returned a 302 redirect to Authelia.

The Migration Checklist Gap

What failed here was the migration checklist, not the Kubernetes config or the LXC setup. Moving a service between infrastructure layers (Kubernetes pod → LXC) carries implicit assumptions about what each layer provides. Traefik and Authelia do routing, and they are also security controls. Any migration that removes a service from the Kubernetes stack needs an explicit step: “identify what security controls the Kubernetes layer was providing and verify they’re replicated in the destination.”

For this homelab, that means:

  1. TLS termination (handled by Cloudflare Tunnel in the LXC case: OK)
  2. Authentication / SSO gate (was Traefik/Authelia: not replicated, missed)
  3. Network policy (not applicable here, no Kubernetes NetworkPolicy in use for this service)

The post-migration security audit found it, but an audit after the fact is a weaker control than a check during the migration. Several incidents in this homelab share the pattern (the original SEC-008, the ArgoCD selfHeal trap, the gitleaks baseline suppression): the security control worked until something unrelated changed, and nobody re-verified it afterward.

The habit worth building: after any infrastructure migration that touches routing, check whether the auth model survived.


The same failure mode applies directly to Azure. Migrating a workload from AKS to a VM (or from a VMSS behind an Application Gateway to a standalone VM) can silently remove WAF rules, identity-based authentication or Private Endpoint network restrictions that the original deployment layer provided. The migration succeeds, traffic flows, and the security controls are gone without an error anywhere. The right time to check is during the migration, not after a security review flags it.

This is the same class of failure The Phoenix Project* spends a lot of pages on: the handoff between teams is where invariants stop being true without anyone noticing.

Was this helpful?
Share
David Woitzik

David Woitzik

Hybrid Cloud Engineer

I work mostly with Azure, Terraform, and Zero-Trust network design, and publish the Terraform templates and write-ups I wanted when I was solving the same problems.

Keep Reading

More Like This in Your Inbox

New Terraform modules and articles by email. No spam.