KNOX-2831 - Make Hadoop impersonation work across topologies and roles with different proxyuser configs#660
Merged
smolnar82 merged 1 commit intoapache:masterfrom Oct 28, 2022
Merged
Conversation
…s with different proxyuser configs
stoty
pushed a commit
to stoty/knox
that referenced
this pull request
May 14, 2024
…es and roles with different proxyuser configs (apache#660) Change-Id: I66ea36da03e6a65b1dd04a1c93283eabad90c5b1
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.
What changes were proposed in this pull request?
Prior to my changes, both Knox's
HadoopAuthFilterandTokenResourceclasses used Hadoop'sProxyUsersclass that maintains a staticImpersonationProviderinstance and invokes delegation methods on that. SubsequentProxyUsers.refreshSuperUserGroupsConfigurationcalls overwrite this impersonation provider. This causes a problem in the following cases:KNOXTOKENserviceHadoopAuthfilter enabled and configured) and theKNOXTOKENservice with impersonation enabled with another proxuyser configurationThe solution is to eliminate the need for this static
ProxyUsersfactory and have theImpersonationProviderinstances created and stored in a map on topology/role level.How was this patch tested?
After deploying Knox with y changes, I duplicated the the
homepagetopology and re-configured the proxyuser settings:admincan impersonate anyoneguestcan impersonate anyoneThen I generated impersonated tokens for
user1anduser2on behalf of theadminuser using thehomepagetopology and on behalf of theguestuser using thehomepage_2topology. All tokens were generated successfully (as opposed to what I experienced before my changes; see the KNOX-2831):