Epic: SSH certificate access — kanidm identity + OpenBao zone CAs, no FreeIPA #19

Open
opened 2026-11-08 00:15:21 +00:00 by ginjiruu · 1 comment
Owner

SSH certificate access architecture. Decided in the 2026-11-07 design session (research in session record lab/session-2026-11-07-openbao-pki-fleet.md follow-up).

FreeIPA was evaluated as the host-authz store and rejected: 2.5-3.5 GB idle RSS with mandatory Dogtag, realm-must-match-DNS-domain prerequisites, a dead k8s operator ecosystem, and nixpkgs ships the server only as a client stub (--disable-server). kanidm will not close the gap: its HBAC/sudo request (kanidm#2517) is label blocked behind the domain-join epic (#2495, zero activity since 2024). The already-live stack covers the whole design: kanidm = who-you-are + zone membership, OpenBao = credential mint + audit, Nix = sudo content.

Decisions

  • No password auth, anywhere, ever. Pubkey/certificate only; PasswordAuthentication no stays the fleet default and the OTP mode of the SSH engine is never mounted.
  • kanidm owns identity and zones. Per-zone posix groups (ssh-*); group membership is the entire user-to-machine matrix. The zone split starts as a single fleet zone and grows only on real need.
  • OpenBao owns the credentials. One SSH signer mount per trust zone, its own CA key. Hosts trust only their zone CA via TrustedUserCAKeys, so the CA boundary is the access enforcement: a cert minted for zone A cannot authenticate to zone B.
  • Login to OpenBao with the kanidm OIDC session. JWT/OIDC auth role per zone with bound_claims on the kanidm groups claim (custom claim via kanidm system oauth2 update-claim-map if the stock claim shape needs it). Zone group membership gates the sign policy.
  • Self-pinned certs. SSH sign roles: allowed_users_template = {{identity.entity.aliases.<jwt-mount-accessor>.name}}, TTL ~15-30m, extensions permit-pty only. A mint can only carry the caller's own principal.
  • Certificate-only sshd. Drop AuthorizedKeysFile so bare pubkeys cannot authenticate; AuthorizedKeysCommand (kanidm key distribution, #17) remains for service accounts and break-glass only.
  • Host identity. ssh-host-signer mount signs host keys; HostCertificate on hosts, @cert-authority on clients. TOFU is dead.
  • sudo content stays in Nix. Command rules live in machine-configs per host, keyed on groups the kanidm people are in (map_group for wheel, zone admin groups for profiles). No IdP stores them.
  • Audit is the SSH engine's log. Every sign is an OpenBao audit event (who, role, principals, time) into the Victoria stack. Better forensics than IPA's sssd logs.

Gotchas

  • SSH CAs do not chain. TrustedUserCAKeys is a flat key list, unrelated to the x509 pki-infra chain from #9. SSH CA rotation = replace the public key on every host and wait out TTLs.
  • The cert principal must equal exactly what getent passwd reports for a kanidm user (spn form). Verify on one think before templating roles.
  • pam_allowed_login_groups gates certificate logins too: enforcement is at the PAM account phase (source-verified: acct_mgmt -> PamAccountAllowed -> group intersect), and an empty list fails closed.
  • Revocation = TTL. Group removal lands at next auth attempt plus unixd cache; live sessions are never killed.
  • Break-glass admin never depends on kanidmd or OpenBao. Cert private keys live in the raft store, covered by the existing openbao-snapshot CronJob.

Children

  • lab/iac#49 — OpenBao SSH CAs: signer mounts, host CA, JWT auth bound to kanidm groups, sign policies
  • lab/machine-configs#18 — sshd certificate auth: per-zone TrustedUserCAKeys, host certs, cert-only mode, sudo via map_group
  • lab/machine-configs#17 — Kanidm unix client (prereq: NSS/PAM, login gate, per-person keys)
  • lab/iac#48 — Kanidm unix groundwork (prereq: posix groups, SSH keys, claim path)

Builds on the security module epic #7. Sequence: #17/#48 land first (login gate exists), then server-side mounts/auth roles, then cert-only sshd host by host starting at the vm:e2e harness.

SSH certificate access architecture. Decided in the 2026-11-07 design session (research in session record `lab/session-2026-11-07-openbao-pki-fleet.md` follow-up). FreeIPA was evaluated as the host-authz store and rejected: 2.5-3.5 GB idle RSS with mandatory Dogtag, realm-must-match-DNS-domain prerequisites, a dead k8s operator ecosystem, and nixpkgs ships the server only as a client stub (`--disable-server`). kanidm will not close the gap: its HBAC/sudo request (kanidm#2517) is label `blocked` behind the domain-join epic (#2495, zero activity since 2024). The already-live stack covers the whole design: kanidm = who-you-are + zone membership, OpenBao = credential mint + audit, Nix = sudo content. ## Decisions - **No password auth, anywhere, ever.** Pubkey/certificate only; `PasswordAuthentication no` stays the fleet default and the OTP mode of the SSH engine is never mounted. - **kanidm owns identity and zones.** Per-zone posix groups (`ssh-*`); group membership is the entire user-to-machine matrix. The zone split starts as a single fleet zone and grows only on real need. - **OpenBao owns the credentials.** One SSH signer mount per trust zone, its own CA key. Hosts trust only their zone CA via `TrustedUserCAKeys`, so the CA boundary *is* the access enforcement: a cert minted for zone A cannot authenticate to zone B. - **Login to OpenBao with the kanidm OIDC session.** JWT/OIDC auth role per zone with `bound_claims` on the kanidm `groups` claim (custom claim via `kanidm system oauth2 update-claim-map` if the stock claim shape needs it). Zone group membership gates the sign policy. - **Self-pinned certs.** SSH sign roles: `allowed_users_template = {{identity.entity.aliases.<jwt-mount-accessor>.name}}`, TTL ~15-30m, extensions `permit-pty` only. A mint can only carry the caller's own principal. - **Certificate-only sshd.** Drop `AuthorizedKeysFile` so bare pubkeys cannot authenticate; `AuthorizedKeysCommand` (kanidm key distribution, #17) remains for service accounts and break-glass only. - **Host identity.** `ssh-host-signer` mount signs host keys; `HostCertificate` on hosts, `@cert-authority` on clients. TOFU is dead. - **sudo content stays in Nix.** Command rules live in machine-configs per host, keyed on groups the kanidm people are in (`map_group` for `wheel`, zone admin groups for profiles). No IdP stores them. - **Audit is the SSH engine's log.** Every sign is an OpenBao audit event (who, role, principals, time) into the Victoria stack. Better forensics than IPA's sssd logs. ## Gotchas - SSH CAs do not chain. `TrustedUserCAKeys` is a flat key list, unrelated to the x509 `pki-infra` chain from #9. SSH CA rotation = replace the public key on every host and wait out TTLs. - The cert principal must equal exactly what `getent passwd` reports for a kanidm user (spn form). Verify on one think before templating roles. - `pam_allowed_login_groups` gates certificate logins too: enforcement is at the PAM **account** phase (source-verified: `acct_mgmt` -> `PamAccountAllowed` -> group intersect), and an empty list fails closed. - Revocation = TTL. Group removal lands at next auth attempt plus unixd cache; live sessions are never killed. - Break-glass `admin` never depends on kanidmd or OpenBao. Cert private keys live in the raft store, covered by the existing openbao-snapshot CronJob. ## Children - [ ] lab/iac#49 — OpenBao SSH CAs: signer mounts, host CA, JWT auth bound to kanidm groups, sign policies - [ ] lab/machine-configs#18 — sshd certificate auth: per-zone TrustedUserCAKeys, host certs, cert-only mode, sudo via map_group - [ ] lab/machine-configs#17 — Kanidm unix client (prereq: NSS/PAM, login gate, per-person keys) - [ ] lab/iac#48 — Kanidm unix groundwork (prereq: posix groups, SSH keys, claim path) Builds on the security module epic #7. Sequence: #17/#48 land first (login gate exists), then server-side mounts/auth roles, then cert-only sshd host by host starting at the vm:e2e harness.
Author
Owner

Added child: machine-configs#41 — known_hosts for RouterOS (harvest host keys over REST, distribute fleet-wide). RouterOS can do neither host certs nor CA-trusted logins (RouterOS 7.26 manual: /ip/ssh host-key export/import only, /user/ssh-keys per user, /ip/ssh/known-hosts raw ed25519/RSA lines; cert support is an open vendor feature request). The @cert-authority line in #18 kills TOFU for OpenSSH hosts; #41 is what makes the three rb5009/crs309 boxes prompt-free and strict-host-key-checking safe, including re-harvest after netinstall re-images.

Added child: machine-configs#41 — known_hosts for RouterOS (harvest host keys over REST, distribute fleet-wide). RouterOS can do neither host certs nor CA-trusted logins (RouterOS 7.26 manual: /ip/ssh host-key export/import only, /user/ssh-keys per user, /ip/ssh/known-hosts raw ed25519/RSA lines; cert support is an open vendor feature request). The @cert-authority line in #18 kills TOFU for OpenSSH hosts; #41 is what makes the three rb5009/crs309 boxes prompt-free and strict-host-key-checking safe, including re-harvest after netinstall re-images.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lab/machine-configs#19
No description provided.