You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(access-control): opt in to privileged roles #502
FOCA grants privileged roles (e.g. admin, via access_control.group_mapping or the admin groups) whenever the token's groups contain the matching entitlement. Users in an admin group therefore act as admins on every request, even for everyday tasks. That violates the principle of least privilege: mistakes made as a "user" have admin effect, and UIs can't offer a normal user view to admins.
What?
An option to make chosen roles opt-in (e.g. access_control.opt_in_roles: [admin]). Those roles only apply to requests that ask for them; all other roles and group memberships apply as usual.
A conventional, documented way for requests to ask, e.g. a request header (X-Request-Roles: admin or similar; check for an established convention first). Asking for a role the subject doesn't hold has no effect. Asking never grants anything the token doesn't already entitle.
Helpers that tell apps both which opt-in roles a subject may use and which are active on this request, so that /me-style endpoints can report both (e.g. admin_available and admin).
The default keeps today's behaviour (no opt-in roles), so existing apps are unaffected.
Acceptance criteria
With the option set, an admin's request without the opt-in gets regular-user permissions (plus their other group roles); with the opt-in, it gets admin permissions.
Apps can tell which opt-in roles are available and which are active.
Needed by elixir-cloud-aai/cloud-registry (admin mode) and its UI.
Activity
fix(access-control): refuse all opt-in role grants