Add two-tier RBAC: permission/role groups, access policies, hierarchical group claim #7
Reference in New Issue
Block a user
Delete Branch "benvin/rbac-groups"
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?
Why
Establishes a user → role → [permissions] model to manage app access and roles from Authentik, per the akR-/akP- convention.
What it adds
akP-<app>-<access>(config/permissions/): atomic units, each names the application it grants access to. 6 groups (grafana/argocd/rancher × admin/user).akR-<role>(config/roles/): what you assign users to; each nests permission groups viaparents.akR-global-admin→ all*-admin;akR-standard-user→ all*-user. (Separateauthentik_groupresource so roles can reference permission ids without the self-reference error.)groupsscope mapping: walksuser.ak_groupsup through.parentsso the OIDC claim includes inherited permission groups (works around goauthentik/authentik#15579). Inert until a provider requests thegroupsscope, so existing apps are unaffected until they opt in.How membership works
Assign a user to one role (e.g.
akR-global-admin) → they inherit every permission it nests → access to every app + the mapped admin/user role.Validation
tofu validatepasses (all resource types/attributes confirmed against the provider). Liveplanwill run in CI.⚠️ Rollout / lockout note
The policy bindings gate all three apps on apply — only members of the akP groups (incl. via roles) can SSO in. The groups are created empty, so add yourself to
akR-global-adminin the Authentik UI right after apply (each app still has its local-admin fallback, so this is recoverable, not a hard lockout).Required follow-ups (roles don't fully take effect until these)
For inherited roles to reach each app, each app must request the
groupsscope and key its RBAC off theakP-*names:requestedScopesaddgroups; argocd-rbac-cm mapakP-argocd-admin→role:admin (replacesargocd-admins).groupsscope;role_attribute_path→akP-grafana-admin.akP-rancher-*principals.argocd-adminsgroup.bc6b88418dto805ea48a36