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

Permissions issue for the resolve_index api #86977

Closed
shivindera opened this issue May 20, 2022 · 5 comments · Fixed by #87052
Closed

Permissions issue for the resolve_index api #86977

shivindera opened this issue May 20, 2022 · 5 comments · Fixed by #87052
Assignees
Labels
>bug :Data Management/Indices APIs APIs to create and manage indices and templates Team:Data Management Meta label for data/management team

Comments

@shivindera
Copy link

Elasticsearch Version

latest

Installed Plugins

No response

Java Version

18.0.1.1

OS Version

Linux 5.17.6-1-MANJARO

Problem Description

We created a hasData service which utilizes the resolve_index api to check whether ES data exists. When making a call to internal/index-pattern-management/resolve_index to query whether data exists or not, in certain scenarios it fails with a 500 Internal Server Error.

The ES error being -

security_exception: [security_exception] Reason: action [indices:admin/resolve/index] is unauthorized for user [test_user] with roles [test_dashboard_user,reporting_user], this
action is granted by the index privileges [view_index_metadata,manage,all]

The scenarios being:
Scenario one:

  1. There are 3 indices
  2. User has read access to 1 of the indices, but not to the other two
  3. The call fails with a 500 Internal Server Error. The user should be able to see the index they have access to.

Scenario two:

  1. This refers to a scenario where the user has read access to the index, but no view_index_metadata privileges.

Original issue ticket in Kibana for reference - #132478

Steps to Reproduce

The user has read access to the index, but no view_index_metadata privileges.
The api fails with a 500 due to the missing permissions.

Logs (if relevant)

security_exception: [security_exception] Reason: action [indices:admin/resolve/index] is unauthorized for user [test_user] with roles [test_dashboard_user,reporting_user], this
action is granted by the index privileges [view_index_metadata,manage,all]

@shivindera shivindera added >bug :Data Management/Indices APIs APIs to create and manage indices and templates needs:triage Requires assignment of a team area label labels May 20, 2022
@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label May 20, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@shivindera
Copy link
Author

This is already discussed this with the es-security team and they had agreed to add the action to the read privilege as well.

@shivindera
Copy link
Author

shivindera commented May 20, 2022

@javanna javanna removed the needs:triage Requires assignment of a team area label label May 20, 2022
@ywangd
Copy link
Member

ywangd commented May 23, 2022

The call fails with a 500 Internal Server Error. The user should be able to see the index they have access to.

Are you sure it is a 500 error? It should be 403. A 500 error for this failure seems to be a bug on its own.

@javanna
Copy link
Member

javanna commented May 23, 2022

based on previous discussion, it's the api at the ui level that returns a 500, ES returns 403.

dakrone added a commit to dakrone/elasticsearch that referenced this issue May 23, 2022
This commit allows the index "read" permission to also allow using the resolve index Action.

Resolves elastic#86977
elasticsearchmachine pushed a commit that referenced this issue May 26, 2022
This commit allows the index "read" permission to also allow using the
resolve index Action.

Resolves #86977
dakrone added a commit to dakrone/elasticsearch that referenced this issue May 26, 2022
…87052)

This commit allows the index "read" permission to also allow using the
resolve index Action.

Resolves elastic#86977
elasticsearchmachine pushed a commit that referenced this issue May 26, 2022
…87169)

This commit allows the index "read" permission to also allow using the
resolve index Action.

Resolves #86977
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Data Management/Indices APIs APIs to create and manage indices and templates Team:Data Management Meta label for data/management team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants