Skip to content

fix(argocd): match both bare and full-path group names in RBAC policy#385

Open
dcmcand wants to merge 1 commit into
mainfrom
fix/argocd-rbac-full-path-groups
Open

fix(argocd): match both bare and full-path group names in RBAC policy#385
dcmcand wants to merge 1 commit into
mainfrom
fix/argocd-rbac-full-path-groups

Conversation

@dcmcand

@dcmcand dcmcand commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Fixes #384

Problem

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). Tokens then carry groups: ["/argocd-admins"] instead of ["argocd-admins"], the RBAC policy installed by ConfigWithOIDC stops matching, and with policy.default empty 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:

g, argocd-admins, role:admin
g, /argocd-admins, role:admin
g, argocd-viewers, role:readonly
g, /argocd-viewers, role:readonly

ArgoCD's casbin g subject matching is exact, so the extra entries cannot over-match; whichever form is absent from the token is simply unused.

Testing

  • go test -short ./... passes
  • go vet ./... and gofmt clean
  • Verified on the mystic.openteams.ai cluster: patching argocd-rbac-cm with these four lines restored app visibility for a user in argocd-admins with the mapper at full.path=true

Note for existing installations

Per the comment on the Config struct, 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 of argocd-rbac-cm (the mystic cluster is already patched).

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ArgoCD group RBAC stops matching after data-science-pack sets the groups mapper to full.path=true

1 participant