FGAP v2: allow delegated admins to access users who also belong to groups delegated to other admins (parity with v1) by vramik · Pull Request #55622 · keycloak/keycloak · GitHub
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
FGAP v2: allow delegated admins to access users who also belong to groups delegated to other admins (parity with v1) - #55622
This PR brings fine-grained admin permissions v2 closer to v1 by allowing independent delegations to grant access to users shared across groups, while retaining explicit-denial protections.
Changes:
Distinguishes unmatched grants from explicit denials across runtime checks, query filtering, and group inheritance.
Exposes member-scope decisions through the evaluation API and Admin UI.
Adds regression coverage and updates administration and upgrade guidance.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Critical partial-evaluation flaws in negative aggregates, UNANIMOUS permissions, and Group conditions can cause user search and count to expose protected users despite direct authorization denying access.
If the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR.
org.jboss.arquillian.graphene.enricher.exception.PageObjectInitializationException:
Can not instantiate Page Object
class org.keycloak.testsuite.adapter.page.SalesPostClockSkewServlet
declared in:
org.keycloak.testsuite.adapter.servlet.SAMLClockSkewAdapterTest
...
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Partial evaluation diverges from runtime authorization for type-level permissions and aggregate policies, allowing search/count to expose denied users or omit authorized users.
This guard misses an unsupported negative child because explicitDenial is only set for children with partial evaluators. For a positive UNANIMOUS aggregate containing a matching User policy and a matching negative Time policy, partial evaluation returns DENY, which becomes NO_GRANT and allows an independent group's grant; runtime instead propagates the Time child's explicit denial and forbids access. Preserve an indeterminate outcome for unresolved children that could introduce an explicit denial, including through nested aggregates.
Align runtime admin permission checks with type-level semantics
With separate all-users VIEW permissions for admins A and B, this branch now lets A list/count every user, but direct lookup still denies: FGAPEvaluation.isDenied() treats B's failed Users permission as a denial, and DecisionPermissionCollector retains that denial. Please implement the matching type-level semantics in runtime evaluation as well and extend testOtherAdminTypeLevelPermissionDoesNotDenyCurrentAdmin with a direct GET assertion so queries cannot expose users that runtime authorization rejects.
Apply aggregate strategy before forcing indeterminate results
For a positive AFFIRMATIVE aggregate containing a matching allow, a matching negative deny, and an unsupported Time policy, this returns FORCE_DENY even though the allow guarantees a grant regardless of Time. This hides authorized members from search/count while direct access succeeds; apply the decision strategy before forcing an indeterminate result, including when CONSENSUS already has a guaranteed majority.
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
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.
Closes #54405