[ZEPPELIN-6171] Resolve nested LDAP groups on FreeIPA via memberOf #5505
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.48) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 510 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.373
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #5505"
general
weight: 0.35
tbonelee
What is this PR for?
LdapRealmresolves a user's groups in one of two ways today: the Active DirectoryLDAP_MATCHING_RULE_IN_CHAINoperator, or a group search over thememberattribute. Neither works for nested groups on FreeIPA / 389 Directory Server — the AD matching rule isn't supported there, and the plainmembersearch only sees direct members. So if a user is indevanddevis a member ofeng, the user'sengmembership (and any role mapped to it) silently disappears.This adds a third path. When
ldapRealm.groupSearchEnableMemberOf = true, the realm reads the user entry's ownmemberOfattribute instead of walking the group tree. FreeIPA/389 DS already flattens direct and nested membership ontomemberOf, so a single lookup of the user entry gives you the full set, nested groups included.While adding it I split
rolesFor()into three small per-strategy methods (matching-rule / group-membership / memberOf) so each path is readable on its own. The two existing paths are moved as-is, no behavior change.New settings:
A few decisions worth calling out:
groupSearchEnableMatchingRuleInChainandgroupSearchEnableMemberOfare both set, the matching-rule path wins and we log a one-time warning, rather than refusing to start. This keeps existing AD setups behaving exactly as before; the cost is that a contradictory config isn't hard-rejected, just warned.memberOfvalue is a full group DN, and we take the group name from its leaf RDN without scanning ancestors. On FreeIPA a container on the path (cn=groups,cn=accounts,...) has the samecn=type as the group itself, so scanning would pick the wrong one. A malformed DN is skipped (and logged) instead of failing the login.One prerequisite (documented in
shiro_authentication.md):memberOfis only returned to an authenticated bind, which Zeppelin already does viasystemUsername/systemPassword. Deployments that split groups and members across separate backends may also need server-side memberOf scope configuration.What type of PR is it?
Improvement
Todos
[x] memberOf-based group resolution path
[x] split
rolesFor()into per-strategy methods[x] unit tests
[x] docs
What is the Jira issue?
ZEPPELIN-6171
How should this be tested?
LdapRealmTest(11 tests, mock-based) covers the memberOf path: nested resolution, matching-rule precedence, leaf-RDN fallback, and the empty / missingmemberOfcases. The existing tests pass unchanged, which is what pins down that the two old paths still behave the same.I also ran it end-to-end against a real 389 Directory Server (FreeIPA's LDAP engine) with a nested setup —
alice∈dev, anddev∈eng:So the nested group is recovered only with the new flag on.
Questions:
Does the license files need to update? No
Is there breaking changes for older versions? No
docs/setup/security/shiro_authentication.mdis updated.