GitHub user vanzin opened a pull request:

    https://github.com/apache/spark/pull/16978

    [SPARK-19652][UI] Do auth checks for REST API access.

    The REST API has a security filter that performs auth checks
    based on the UI root's security manager. That works fine when
    the UI root is the app's UI, but not when it's the history server.
    
    In the SHS case, all users would be allowed to see all applications
    through the REST API, even if the UI itself wouldn't be available
    to them.
    
    This change adds auth checks for each app access through the API
    too, so that only authorized users can see the app's data.
    
    The change also modifies the existing security filter to use
    `HttpServletRequest.getRemoteUser()`, which is used in other
    places. That is not necessarily the same as the principal's
    name; for example, when using Hadoop's SPNEGO auth filter,
    the remote user strips the realm information, which then matches
    the user name registered as the owner of the application.
    
    I also renamed the UIRootFromServletContext trait to a more generic
    name since I'm using it to store more context information now.
    
    Tested manually with an authorization filter enabled.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/vanzin/spark SPARK-19652

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/16978.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #16978
    
----
commit d036e07cc2e9f8e6637e887628b428a8f4cf3ed3
Author: Marcelo Vanzin <[email protected]>
Date:   2017-02-18T00:13:29Z

    [SPARK-19652][UI] Do auth checks for REST API access.
    
    The REST API has a security filter that performs auth checks
    based on the UI root's security manager. That works fine when
    the UI root is the app's UI, but not when it's the history server.
    
    In the SHS case, all users would be allowed to see all applications
    through the REST API, even if the UI itself wouldn't be available
    to them.
    
    This change adds auth checks for each app access through the API
    too, so that only authorized users can see the app's data.
    
    The change also modifies the existing security filter to use
    `HttpServletRequest.getRemoteUser()`, which is used in other
    places. That is not necessarily the same as the principal's
    name; for example, when using Hadoop's SPNEGO auth filter,
    the remote user strips the realm information, which then matches
    the user name registered as the owner of the application.
    
    I also renamed the UIRootFromServletContext trait to a more generic
    name since I'm using it to store more context information now.
    
    Tested manually with an authorization filter enabled.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to