Repository navigation
KNOX-3589: Rename remote LDAP attributes to proxy-facing names - #1528
Merged
smolnar82 merged 2 commits intoNov 19, 2026
Merged
Conversation
The LDAP proxy surfaces remote attributes under their own names. Add a
per-backend attributeMappings list of remoteName:proxyName pairs so a
remote attribute can be exposed under a different, standard name on the
proxy entry (e.g. Active Directory's whenChanged as the RFC-standard
modifyTimestamp), without the client needing to know an AD server is
behind the proxy.
The rename is bidirectional and applied in all three places so the proxy
name works end to end:
- on returned entries, the remote attribute is copied into the proxy
entry under the proxy name and the remote name is dropped;
- in the client's requested-attribute list, the proxy name is
forwarded to the remote server as the remote name (the only name it
knows);
- in search filters, a condition on the proxy name is rewritten to the
remote name before the search is sent.
Values are copied verbatim, so only syntax-compatible attributes should
be mapped (whenChanged and modifyTimestamp are both GeneralizedTime).
The target name must be resolvable in the schema; modifyTimestamp is a
standard operational attribute Knox already knows. Lookups are
case-insensitive and malformed pairs are skipped rather than failing the
backend. Credential-bearing attributes are still stripped before any
rename, so a mapping cannot surface secrets under a different name.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
smolnar82
requested changes
Nov 19, 2026
smolnar82
left a comment
Contributor
There was a problem hiding this comment.
Just a small possible NPE
…ons, log skips) Follow-up fixes to the attributeMappings feature: - Reject any mapping pair naming a credential-bearing attribute on either side. Renaming a sensitive attribute in would surface non-secret data under a credential name; renaming one out would let a filter on the proxy name be rewritten against the remote credential attribute (a guessing oracle). The strip of returned entries only covered the output path, not filters, so rejecting at config time closes both. - Translate client-supplied attribute names to remote names before the proxy appends its own required remote attributes (objectClass, memberOf, the user identifier), so a mapping whose proxy name collides with one of them can no longer rewrite the attribute the proxy adds for its own use and break group resolution. - Log a warning when a malformed attributeMappings entry is skipped (missing colon, empty side, or a stray second colon) instead of dropping it silently. - Document that the modifyTimestamp rename is unconditional: it is applied to whatever the remote returns, so any whenChanged in a result is surfaced as modifyTimestamp regardless of whether the proxy name was requested by name. modifyTimestamp remains operational. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Test Results 5 files 5 suites 1m 16s ⏱️ Results for commit 911fa70. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
KNOX-3589 - Rename remote LDAP attributes to proxy-facing names
What changes were proposed in this pull request?
The LDAP proxy surfaces remote attributes under their own names. Add a per-backend attributeMappings list of remoteName:proxyName pairs so a remote attribute can be exposed under a different, standard name on the proxy entry (e.g. Active Directory's whenChanged as the RFC-standard modifyTimestamp), without the client needing to know an AD server is behind the proxy.
Mappings that include a sensitive attribute name are rejected so that mapping cannot be used to surface sensitive values.
The rename is bidirectional and applied in all three places so the proxy name works end to end:
Values are copied verbatim, so only syntax-compatible attributes should be mapped (whenChanged and modifyTimestamp are both GeneralizedTime). The target name must be resolvable in the schema; modifyTimestamp is a standard operational attribute Knox already knows. Lookups are case-insensitive and malformed pairs are skipped rather than failing the backend. Credential-bearing attributes are still stripped before any rename, so a mapping cannot surface secrets under a different name.
How was this patch tested?
Added unit tests.
Ran manual tests against active directory by adding a mapping to the gateway-site.xml
then ran searches using
modifyTimestampand see that the search works to narrow the result set and thatmodifyTimestampis included in the returned entries. SincemodifyTimestampis an operational attribute in the proxy schema, it needs to be requested explicitly or throug+for all operational attributes.Integration Tests
No integration test were added because the test server has the same schema as the proxy server.
UI changes
No UI changes