Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LIVY-868] ACL on livy session listing #329

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

alexanghh
Copy link

Checks if requester is session owner or has rights to view session before returning the session.

What changes were proposed in this pull request?
Filter sessions listing (in get('/")) returned by SessionServlet based on ownership and access granted.

https://issues.apache.org/jira/browse/LIVY-868

How was this patch tested?
Changes tested manually in kerberized environment.
Only able to see own sessions in UI page unless view and able permission granted.

Checks if requester is session owner or has rights to view session before returning the session.
@@ -72,7 +72,10 @@ abstract class SessionServlet[S <: Session, R <: RecoveryMetadata](
val from = params.get("from").map(_.toInt).getOrElse(0)
val size = params.get("size").map(_.toInt).getOrElse(100)

val sessions = sessionManager.all()
val sessions = sessionManager.all().filter(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is incomplete, what about access from /sessionId ?

Copy link
Author

@alexanghh alexanghh Dec 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zinking I have update the code and changed the withUnprotectedSession to withViewAccessSession to protect access from /sessionId.

Change withUnprotectedSession to withViewAccessSession for get("/:id") and get("/:id/state") to check if the requester is session owner or has rights to view session before returning the session.
@yantzu
Copy link
Contributor

yantzu commented Nov 9, 2022

Retrigger the test.

@yantzu yantzu closed this Nov 9, 2022
@yantzu yantzu reopened this Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants