Skip to content
14. Break-glass login with client certificates

14. Break-glass login with client certificates

  • Status: Superseded by ADR 0015
  • Date: 2026-11

This record describes break-glass on a separate address, which was never released. ADR 0015 replaced it before release: client certificates are checked on every connection to the normal addresses when the gate is on, and break-glass is a button on the normal dashboard.

Context

Every login goes through the identity provider (Keycloak). When it is down, nobody can sign in, and the administrators who would repair the platform cannot reach their workspaces or the admin views. The gateway also used to exit at start-up when OIDC discovery failed, so a restart during an outage made things worse.

Administrators hold company client certificates, so a certificate can prove who they are without Keycloak. A certificate is only proof if the key was used, though: the certificate itself is public, and a copy of it passes every check of its contents. Whatever carries the identity to the gateway therefore has to be trusted not to forward a certificate nobody presented.

Decision

Break-glass is a second entry to the same dashboard, on its own hostname.

  • Separate hostname. Only breakGlass.host asks for a client certificate. The normal dashboard never does, so ordinary users see no change and no certificate dialog.
  • The ingress terminates TLS and verifies; the gateway verifies again. The ingress requires a certificate signed by the company CA and forwards the full certificate in a request header. The gateway checks the chain against the company CA, the validity dates and revocation (CRL), then matches the subject CN exactly against breakGlass.mapping. The mapping is also the allow-list.
  • The ingress authenticates to the gateway. The gateway reads the certificate header only on a dedicated listener (port 8444) that requires a client certificate issued by kornercode’s internal CA for the DNS name kornercode-ingress. A NetworkPolicy and an unconditional header strip at the ingress are further layers, not the foundation.
  • No L4 passthrough. Passing the TCP stream through to the gateway would let the gateway see the handshake itself, but the security team will not accept a layer-4 VIP, and the ingress would stop being the single place that terminates TLS. The authenticated ingress-to-gateway hop gives the gateway the assurance the handshake would have.
  • State changes come from the break-glass origin only. The client certificate is ambient authority: the browser presents it whatever page makes the request, including a user’s dev or test host, which is same-site, so SameSite cookies do not help. On the break-glass host, every method but GET, HEAD and OPTIONS needs an Origin equal to the break-glass origin and, when sent, Sec-Fetch-Site: same-origin; anything else is refused before the certificate is judged. Only a page load (a GET or HEAD outside /api/) opens a new session. The normal dashboard host is unchanged.
  • One header dialect, and no other. The gateway reads the configured dialect’s header and refuses a request carrying another dialect’s certificate header (certificate_header_ambiguous): if the ingress writes a different header than configured, the configured one is client-supplied.
  • Sessions are short and separate. A break-glass session lives at most eight hours, in its own host-only cookie. The normal dashboard host treats it as signed out, and the session store stays stateless.
  • The gateway starts without Keycloak. OIDC discovery is retried in the background; the normal login shows an “identity provider is unavailable” page that links to the break-glass address.
  • Off by default. When enabled, the chart refuses to render without the company CA Secret, a mapping and, for Traefik, the host’s certificate Secret.

Consequences

  • An administrator can sign in, use their workspace and every admin feature while Keycloak is down. Every login is audited with the certificate CN, serial and issuer.
  • Refusals are audited too, but de-duplicated: one entry per (CN, reason) per minute. This deliberately departs from “every refused attempt is audited”, so that a browser reloading a refusal page, or a client looping on a bad certificate, cannot flood the audit log. The first refusal of each kind in each minute is always written. Cross-origin refusals are not audited at all: the certificate was not judged, and the gateway logs a warning instead.
  • Trust moves to the ingress. A compromised ingress, or anyone who can obtain a kornercode-ingress client certificate from the internal CA issuer, can impersonate any mapped person. See Authentication.
  • Adding or removing a person is a chart change and a helm upgrade, not a Keycloak change.
  • A stolen key and certificate work until the certificate is revoked or its CN is removed from the mapping. Revocation and removal (once the gateway has rolled) apply to every new request on the break-glass host, but sessions bridged to the dev and test hosts are not re-verified there and keep their admin rights until they expire (at most 8 hours by default); rotating SESSION_SECRET ends them early.
  • Moving to another ingress (for example an F5 L7 virtual server) changes configuration, not design: the ingress must offer the same four guarantees (admin guide).