[
https://issues.apache.org/jira/browse/KNOX-3387?focusedWorklogId=1031479&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1031479
]
ASF GitHub Bot logged work on KNOX-3387:
----------------------------------------
Author: ASF GitHub Bot
Created on: 21/Jul/26 11:57
Start Date: 21/Jul/26 11:57
Worklog Time Spent: 10m
Work Description: github-actions[bot] commented on PR #1313:
URL: https://github.com/apache/knox/pull/1313#issuecomment-5033644069
## Test Results
36 tests 36 ✅ 5s ⏱️
3 suites 0 💤
3 files 0 ❌
Results for commit 45c4c559.
[test-results]:data:application/gzip;base64,H4sIAJ5eX2oC/12Myw7CIBBFf6Vh7YLQTin+jMGBSYhtMTxWjf8uomLr7p5zk7MxcrON7Nz1p47F7FIDk4NOzq8FoWA5Ur3GL1xiRvwzN3cvhjdB2s0HYUPw4WNCXlvxtQ/Bt/j1Ku9ylfc19MviUgE2AA4IoCZuJRdGEmpNw0SyF2TEdVQg0XIF7PEEQsMSUv8AAAA=
Issue Time Tracking
-------------------
Worklog Id: (was: 1031479)
Remaining Estimate: 0h
Time Spent: 10m
> HadoopGroupProvider returns no groups when the embedded LDAP proxy base DN
> differs from the remote base DN
> ----------------------------------------------------------------------------------------------------------
>
> Key: KNOX-3387
> URL: https://issues.apache.org/jira/browse/KNOX-3387
> Project: Apache Knox
> Issue Type: Task
> Components: Server
> Affects Versions: 3.0.0
> Reporter: Sandor Molnar
> Assignee: Sandor Molnar
> Priority: Major
> Fix For: 3.0.0
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> h2. Summary
> With the embedded Knox LDAP service ({{{}gateway.ldap.enabled=true{}}}) using
> an LDAP proxy backend, group lookups via {{HadoopGroupProvider}}
> ({{{}use.ldap.service=true{}}}) return an empty group list whenever the proxy
> base DN differs from the remote base DN.
> h2. Steps to Reproduce
> # Configure a proxy backend where {{gateway.ldap.base.dn}} !=
> {{{}remoteBaseDn{}}}, e.g. {{dc=proxy,dc=com}} vs {{{}dc=example,dc=com{}}}.
> # Authenticate as a user who belongs to a group on the remote server.
> # Send a request through a topology using {{HadoopGroupProvider}} with
> {{{}use.ldap.service=true{}}}.
> Expected: the user's remote groups are returned. Actual: empty list.
> {code:java}
> DEBUG services.ldap (UserSearchInterceptor.java:search(88)) - LDAP Search:
> dc=proxy,dc=com | (uid=admin)
> DEBUG knox.gateway (HadoopGroupProviderFilter.java:mapGroupPrincipals(115)) -
> Found groups for principal admin : []
> {code}
> h2. Root Cause
> {{KnoxLDAPServerManager.getUserGroups()}} searches under the proxy base DN.
> {{UserSearchInterceptor.search()}} only forwards to the backend when
> {{isUnderBackendBaseDn()}} passes, but that check compares the
> proxy-namespace search base against {{{}LdapProxyBackend.getBaseDn(){}}},
> which returns the remote base DN. So
> {{"dc=proxy,dc=com".endsWith("dc=example,dc=com")}} is {{{}false{}}}, the
> backend is never queried, and no {{memberOf}} values are found.
> This contradicts the backend's own contract: {{LdapProxyBackend.search()}}
> expects a proxy-namespace base and translates it internally.
> ({{{}FileBackend{}}} is unaffected — it has a single base DN.)
> h2. Workaround
> Set {{gateway.ldap.base.dn}} equal to {{{}remoteBaseDn{}}}. This makes
> translation a no-op and lets the guard pass, but disables namespace
> translation.
> h2. Proposed Fix
> Have {{isUnderBackendBaseDn()}} evaluate the search base against the proxy
> base DN (add {{getProxyBaseDn()}} to {{{}LdapBackend{}}}); accept a base
> under either the proxy or remote namespace, since both are registered as
> partitions. Add a test covering {{{}proxyBaseDn != remoteBaseDn{}}}.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)