Skip to content

RANGER-5863: update service-header to include service admin users and groups - #1347

Open
mneethiraj wants to merge 3 commits into
apache:masterfrom
mneethiraj:RANGER-5863
Open

mneethiraj wants to merge 3 commits into
apache:masterfrom
mneethiraj:RANGER-5863

Conversation

@mneethiraj

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

  • updated RangerServiceHeaderInfo to include admin users and groups
  • updated XXServiceDao. findServiceHeaders() to retrieve admin users and groups from service configuration

How was this patch tested?

  • verified via manual REST API calls that service-header includes admin users and group configured in service-configuration. The new fields are not returned for services that don't include admin users/groups configuration.

String adminGroups = (String) result[6];

if (StringUtils.isNotBlank(adminUsers)) {
svcHeader.setAdminUsers(Arrays.asList(adminUsers.split(",")));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Any logged-in user can now see who the admins are. getServiceHeaders keeps a header when hasAccess is true, and that lets any ROLE_USER read non-KMS service headers. Before this change, seeing a service's admin users and groups required config access. If this wider visibility is intended, the PR should say so. Otherwise the new fields should be gated.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point @vyommani. I will introduce service configurations service.account.users and service.account.groups, to register service account identities. These identities will have following privileges:

  1. Download policy details of the service for the enforcement plugin, including policies, tags, roles, user-store, gds info
  2. Call PDP APIs to authorize access to resources in the service on behalf of other users
  3. Publish access audits for the service to audit-ingestor

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You concern about exposing value of couple of service configurations remains same though - it will not be identities of service admin users/groups but instead it will be the service account identities. If this is unacceptable, we will have to create a new permission to restrict access to these fields and explicitly assign this permission to users. Let me know.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @mneethiraj . Service accounts can download policies, tags, roles, and the user-store, and call the PDP for other users, so I would not show those names to every ROLE_USER. service-headers is already returned to that caller, and service config is hidden from them. Could we fill these fields only when the caller can already read the service config, and leave them empty otherwise? That covers admin users without a new permission.

This branch has not been deployed

No deployments
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.

3 participants