T14: Vault Kubernetes auth backend + per-app VSO roles #29
Labels
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lab/iac#29
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
T14: Vault Kubernetes auth backend + per-app VSO roles
Implements the next step of the ADR-0004 read path: Vault's Kubernetes auth method mounted per cluster, with per-app
VaultAuthroles so the Vault Secrets Operator can authenticate as each app's own ServiceAccount.Deliverables
vault/kubernetes-auth.tf— avault_auth_backend(type=kubernetes, pathkubernetes/<cluster>) +vault_kubernetes_auth_backend_configper cluster invar.kubernetes_auth. The singletoken_reviewer_jwtis thevaultKanidm SA API token (from #35; sensitive, viavar.kubernetes_token_reviewer_jwts/varsFrom — never code);kubernetes_hostpoints at the k8s-hub apiserver route (T13 #28,https://<cluster>.k8s.animeteamspeak.moe). The route terminates with a Let's Encrypt cert (public CA, system trust), sokubernetes_ca_certis optional. Defaults empty, so the vault-config auto-apply on mini is a no-op until bootstrapped.vault/modules/app_secretsfor every configured cluster backend:<app>-vso→ token policy<app>_reader, bound to SA<app>-vsoin the app namespace (VSO read path)<app>-esopush→ token policy<app>_generated-secret-manager, bound to SA<app>-esopushinflux-system(ESO PushSecret, generated tier)<app>-break-glass→ token policy<app>_root, bound to SA<app>-break-glassinflux-system(emergency admin)<app>_readerpolicy — read/list over the app's owngenerated/+manual/paths (ADR-0004A-reader); the app's runtime read path through VSO.k8s/modules/tenant:<app>-vsoin the app namespace;<app>-esopushand<app>-break-glassinflux-system.vault/modules/app_secretsidentity groups referenced policy names with a trailing-policythat don't exist (policies are${app}_${capability}). Dropped the suffix.Bootstrap (prerequisites before enabling)
Vault calls each cluster's TokenReview API as a Kanidm principal through the gateway (Golden Path, #38):
vaultKanidm SA and grant its groups thegroups_namescope map on the per-cluster OAuth2 clients (minicluster/portablecluster).groups_nameclaim) authenticates.vaultSA's capability group tosystem:auth-delegator(tokenreviews.create) — one ClusterRoleBinding keyed by the group, not a per-cluster SA.kubernetes_host=https://<cluster>.k8s.animeteamspeak.moe(k8s-hub route),kubernetes_ca_cert= optional (Let's Encrypt, public trust),token_reviewer_jwt= thevaultSA API token — the same token for every cluster, exchanged per request by the authz-bridge.There is no per-cluster
vault-authSA and no 'omit for the in-cluster case' — the path is uniform even for the cluster Vault runs on. Vault stays decoupled from its host cluster: the connection config is per target cluster, not per deployment location.Bootstrap values for mini
kubernetes_host:https://mini.k8s.animeteamspeak.moe(k8s-hub apiserver route, T13 #28)kubernetes_ca_cert: not required — the k8s-hub route terminates with a Let's Encrypt cert (public trust); mini's apiserver CA is not needed eithertoken_reviewer_jwt: thevaultKanidm SA API token (#35) — same value for mini, portable, remoteOut of scope
lab/clustersPR #1525)VaultAuth/VaultStaticSecretCRs in the app repostofu-controllersync for thek8s/root (T10, #25)