kanidm (Fix): DNS cutover audit - media-admin and vault callbacks, opencloud-groups boundary visible again #179
No reviewers
Labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
lab/iac!179
Loading…
Reference in a new issue
No description provided.
Delete branch "dns-cutover-audit"
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?
Audit of the 2026-11-20 internal DNS cutover (#173 to #178). The handoff called the work done. Two OIDC clients still point at names that don't exist, and the opencloud fix hides the group that bounds what opencloud's bind account can read.
Companion PR: lab/clusters#1769 (same audit, cluster side). Merge this one first. kanidm has to accept the new media-admin callback before the clusters PR switches the app to it.
What this changes
1. privatemedia and vault callbacks (kanidm/oauth2.tf)
https://admin.media.apps.caosh.int.animeteamspeak.moe/oauth2/callbackhttps://media-admin.apps.caosh.int.animeteamspeak.moe/oauth2/callbackadmin.media.apps.caosh.inthas no route, cert or record. The live routemedia/media-admin-internal, its Certificate and the pdns record all usemedia-admin. Today media-admin answers 403 to everyone, and authz-bridge logsNo App resolved for the Host.https://vault.animeteamspeak.moe/ui/vault/auth/oidc/oidc/callbackhttps://vault.apps.caosh.int.animeteamspeak.moe/ui/vault/auth/oidc/oidc/callbackThe launcher
originanddisplaynameof the internal-only apps (actual, workflows, games, grafana, harbor, keep, cloud, ai, paper, privatemedia, vault) now point at their*.apps.caosh.intnames. This is cosmetic: kanidm validates againstredirect_uris, so origin only changes the app-launcher tile link. Public apps are untouched.vault-clikeeps its origin because it is the CLI client for the c1 OpenBao, not the mini UI.2. opencloud-groups declares its members (kanidm/groups.tf)
#176/#177 left
entry_managed_by = "opencloud-admin"pluslifecycle { ignore_changes = [members] }. The comment said the members are "kanidm-internal OAUTH CLIENT accounts". They are not. Live and in tfstate, the members are:opencloud-admin,opencloud-guest,opencloud-space-admin,opencloud-useropencloud-bind, an entry the runner's idm_group_admins token can't read under any class (most likely the LDAP bind service account). It was never renamed to opencloud-web, so the #174 claim is false too.opencloud-groupsis the boundary of what opencloud's bind account may pull, as you described ("Opencloud is only allowed to pull things that are part of the groups"). Withignore_changes, adding any group to it in kanidm,idm_adminsfor example, would never show up in a plan. This PR dropsignore_changesand declares the five members: the fourkanidm_group.opencloud_*.idreferences plus the literal SPNopencloud-bind@auth.animeteamspeak.moe.Why it should converge: provider 0.1.10's resolver (
normalizeMemberIdentifiers) keeps an unresolvable identifier as a raw string on both the plan and state side, and state already holds exactly that string. Withmembersset, the value is known at plan time, so the #176 "known after apply" abort can't happen.Branch plan verified (
kanidm-config-pr-179, decoded with tofu 1.12.1):kanidm_group.opencloud_groupsis a no-op, so the declared members match state exactly. The only changes are 11kanidm_oauth2_*updates: origin/displayname on actual, argoworkflows, drop, grafana, harbor, karakeep, openwebui, paperless and opencloud_web, plus origin+redirect on privatemedia and vault. No creates, no deletes.openbao-config-pr-179: no changes.entry_managed_by = opencloud-adminstays. It is a new write grant that #177 created: members of the opencloud-admin app role (today only you) can edit the boundary group, which also contains opencloud-admin itself. Provider 0.1.10 can't clear the attribute (it's the latest release on the registry). If you want no delegation, an idm_admin clears it once by hand with the kanidm CLI, then the line comes out of config. That's a decision for you, so I didn't do it.3. vault-login.py default and a doc reference
vault/scripts/vault-login.pyandvault-login.mddefaultedVAULT_ADDRto the retiredhttps://vault.animeteamspeak.moe. The default is nowhttps://10.30.20.21:8200, the address the global AGENTS.md credentials table already documents for human OpenBao logins.docs/routeros/rollback.mdnames the tf-runner image on the internal harbor host, matching lab/clusters#1770.Not changed here (your decision)
vault/main.tf:41: the c1 OpenBaodefaultOIDC role still allows onlyhttps://vault.animeteamspeak.moe/ui/vault/auth/oidc/oidc/callback. The c1 OpenBao UI isn't served atvault.apps.caosh.int(that name is mini's OpenBao 2.0.4), so I didn't want to guess. Pick the name the c1 UI should live at, and I'll add it here and to the kanidmvaultclient.vault.apps.caosh.int) has its ownoidc/role, and it isn't in this repo. Itsallowed_redirect_urismust also contain the new internal callback, or the kanidm side of change 1 alone won't make UI login work. This is a live write to OpenBao, so it needs your OK:bao write auth/oidc/role/<role> allowed_redirect_uris=https://vault.apps.caosh.int.animeteamspeak.moe/ui/vault/auth/oidc/oidc/callback(read the role first and keep its other URIs).Verified
tofu validatepasses on the kanidm root.tofu fmt -checkis clean on kanidm/ and vault/.0cba352("Plan no changes").After merge
kubectl --context mini -n flux-system get terraform kanidm-config. Expect an apply with only the privatemedia and vault redirect/origin changes and the cosmetic origin/displayname updates, then Ready.https://media-admin.apps.caosh.int.animeteamspeak.moe/should redirect to kanidm instead of answering 403.tf-controller plan output:
To apply this plan, please merge this pull request.
tf-controller plan output:
To apply this plan, please merge this pull request.