fix(argocd): match both bare and full-path group names in RBAC policy#385
Open
dcmcand wants to merge 1 commit into
Open
fix(argocd): match both bare and full-path group names in RBAC policy#385dcmcand wants to merge 1 commit into
dcmcand wants to merge 1 commit into
Conversation
The data-science-pack rbac-bootstrap job reconciles the Keycloak group-membership mapper to full.path=true on every sync (JupyterHub needs full group paths for /shared/<group> mounts), which changes the token groups claim from "argocd-admins" to "/argocd-admins". With policy.default empty, the existing RBAC policy stops matching and users lose all visibility in ArgoCD. Map both forms for each group so access works regardless of whether the realm-setup job (full.path=false) or the ds-pack bootstrap job (full.path=true) ran last. Fixes #384
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #384
Problem
The data-science-pack rbac-bootstrap job reconciles the Keycloak group-membership mapper to
full.path=trueon every sync (JupyterHub needs full group paths for/shared/<group>mounts). Tokens then carrygroups: ["/argocd-admins"]instead of["argocd-admins"], the RBAC policy installed byConfigWithOIDCstops matching, and withpolicy.defaultempty users lose all visibility in ArgoCD. See #384 for the full investigation.Change
Map both the bare and slash-prefixed form of each group in
policy.csv, so access works whether the realm-setup job (full.path=false) or the ds-pack bootstrap job (full.path=true) ran last:ArgoCD's casbin
gsubject matching is exact, so the extra entries cannot over-match; whichever form is absent from the token is simply unused.Testing
go test -short ./...passesgo vet ./...andgofmtcleanargocd-rbac-cmwith these four lines restored app visibility for a user inargocd-adminswith the mapper atfull.path=trueNote for existing installations
Per the comment on the
Configstruct, upgrade-skip logic only compares chart versions, so this Values-only change will not reach already-bootstrapped clusters on its own. Existing clusters need either a chart version bump or a manual patch ofargocd-rbac-cm(the mystic cluster is already patched).