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

Auth v2 Model #10571

Closed
wants to merge 15 commits into from
Closed

Auth v2 Model #10571

wants to merge 15 commits into from

Conversation

pjain1
Copy link
Member

@pjain1 pjain1 commented Nov 10, 2020

Fixes #9380.

Description

This PR changes the auth model to support user personas like admin, viewer etc. in an easy manner. Details about new Resource types, names and the endpoints that they protect can be found on auth-model.md page.

All the changes are backwards compatible and support rolling update, details can be found on auth-model.md page.


This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • been tested in a test Druid cluster.

Key changed/added classes in this PR
  • *Resource classes
  • *ResourceFilter* classes
  • Authorizer class

@pjain1
Copy link
Member Author

pjain1 commented Nov 15, 2020

Checks are green @jon-wei can you have a look, thanks !

@jon-wei
Copy link
Contributor

jon-wei commented Nov 17, 2020

@pjain1 Thanks! I'll take a look this week

@pjain1
Copy link
Member Author

pjain1 commented Nov 30, 2020

@jon-wei can you please take a look

Copy link
Contributor

@a2l007 a2l007 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! This is super useful and I'm looking forward to integrating this with our internal security extensions as well.
It would be interesting to look at how certain fine grained security setups would work with the web console.

authenticationResult,
AuthorizationUtils.authorizeAllResourceActions(
authenticationResult,
baseQuery.getDataSource() instanceof LookupDataSource ?
Copy link
Contributor

Choose a reason for hiding this comment

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

Would this work for lookups specified in DimensionSpecs or extraction functions?

));

// if its a reindex task from druid, make sure the user has read permissions on the source druid datasource
if (authorizerMapper.getAuthVersion().equals(AuthConfig.AUTH_VERSION_2) && task instanceof IndexTask
Copy link
Contributor

Choose a reason for hiding this comment

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

This wouldn't work for hadoop indexing tasks would it?

));
// We're filtering, so having access to none of the objects isn't an authorization failure (in terms of whether
// to send an error response or not.)
request.setAttribute(AuthConfig.DRUID_AUTHORIZATION_CHECKED, true);
Copy link
Contributor

Choose a reason for hiding this comment

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

Some level of logging would be useful here in case certain lookups are filtered out here and the cluster operator is unaware as to why it got filtered out.

|`GET /druid/indexer/v1/tasks`|overlord|
|`DELETE /druid/indexer/v1/pendingSegments/{dataSource}`|overlord|
|`GET /druid/indexer/v1/task/{taskid}/log`|overlord|
|`GET /druid/indexer/v1/task/{taskid}/reports`|overlord|
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add /druid/indexer/v1/supervisor and /druid/v2/ here?

@@ -541,6 +629,7 @@ LookupStatus getLookupStatus(
@GET
@Produces({MediaType.APPLICATION_JSON})
@Path("/nodeStatus")
@ResourceFilters({ ConfigResourceFilter.class, ServerServerResourceFilter.class })
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be under SERVER STATUS ?

@github-actions
Copy link

github-actions bot commented Oct 2, 2023

This pull request has been marked as stale due to 60 days of inactivity.
It will be closed in 4 weeks if no further activity occurs. If you think
that's incorrect or this pull request should instead be reviewed, please simply
write any comment. Even if closed, you can still revive the PR at any time or
discuss it on the dev@druid.apache.org list.
Thank you for your contributions.

@github-actions github-actions bot added the stale label Oct 2, 2023
@github-actions
Copy link

This pull request/issue has been closed due to lack of activity. If you think that
is incorrect, or the pull request requires review, you can revive the PR at any time.

@github-actions github-actions bot closed this Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fine grained config and state resources
4 participants