[ 
https://issues.apache.org/jira/browse/HADOOP-15922?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16688467#comment-16688467
 ] 

Eric Yang commented on HADOOP-15922:
------------------------------------

[~hexiaoqiao] Thank you for the patch.  A few comments:

# Using foo/localhost is a good touch to show case that '/' character must be 
decoded to ensure the username is foo/localhost instead of foo%2Flocalhost.  
# Proxyuser wildcard is same as no security and setting bad example for others 
that follows it.  In the unit test, can we use non-wildcard proxyuser settings? 
 hadoop.kms.proxyuser.client.users=foo/[email protected] and 
hadoop.kms.proxyuser.client.hosts=localhost,host are more accurate to 
illustrate the test.
# Client principal should have hostname for correctness as a service principal. 
 It looks like proxyuser credential isn't validating hostname with 
hadoop.kms.proxyuser.client.hosts.  Something is still broken in validating 
service principal outside the scope of this JIRA.
# Test case method generally starts with test prefix.  Recommend to rename 
doGetDelegationTokenByProxyUser to testGetDelegationTokenByProxyUser.

> DelegationTokenAuthenticationFilter get wrong doAsUser since it does not 
> decode URL
> -----------------------------------------------------------------------------------
>
>                 Key: HADOOP-15922
>                 URL: https://issues.apache.org/jira/browse/HADOOP-15922
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: common, kms
>            Reporter: He Xiaoqiao
>            Assignee: He Xiaoqiao
>            Priority: Major
>         Attachments: HADOOP-15922.001.patch, HADOOP-15922.002.patch
>
>
> DelegationTokenAuthenticationFilter get wrong doAsUser when proxy user from 
> client is complete kerberos name (e.g., user/[email protected], actually it 
> is acceptable), because DelegationTokenAuthenticationFilter does not decode 
> DOAS parameter in URL which is encoded by {{URLEncoder}} at client.
> e.g. KMS as example:
> a. KMSClientProvider creates connection to KMS Server using 
> DelegationTokenAuthenticatedURL#openConnection.
> b. If KMSClientProvider is a doAsUser, KMSClientProvider will put {{doas}} 
> with url encoded user as one parameter of http request. 
> {code:java}
>     // proxyuser
>     if (doAs != null) {
>       extraParams.put(DO_AS, URLEncoder.encode(doAs, "UTF-8"));
>     }
> {code}
> c. when KMS server receives the request, it does not decode the proxy user.
> As result, KMS Server will get the wrong proxy user if this proxy user is 
> complete Kerberos Name or it includes some special character. Some other 
> authentication and authorization exception will throws next to it.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to