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

[BUG] Console autocomplete does not work if a user only has access to some indices #6180

Open
bladerail opened this issue Mar 18, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@bladerail
Copy link

bladerail commented Mar 18, 2024

Describe the bug
In the Dev Tools Console, a User with restricted indices permissions will not get autocomplete.

I created a new Opensearch and Opensearch Dashboards instance, used the admin user to create 3 indices: abc, abc_123 and def.

I created a new role named my_role and granted it no cluster permissions, but with index permissions indices_all to index pattern ["abc*"].

I created a new user named dev and assigned it to the role my_role.

Expected behavior
Autocomplete should appear for abc, abc_123 but not for def.
expected

Actual behavior
I get no autocomplete at all.
actual

OpenSearch Version
2.11.1

Dashboards Version
2.11.1

Plugins
Nil

Screenshots
Configured permissions for the role my_role.
index_permissions

403

Logs show that the dev user is trying to get mapping for all indices (*)
Problem log

Host/Environment (please complete the following information):

  • OS: Opensearch and Opensearch-Dashboards docker images in a Windows Host running Docker Desktop
  • Browser and version Chrome version 122.0.6261.71

Additional context
If I replace abc* with just *, autocomplete works. If I put every single index from _cat/indices into that list, it works. If I remove def, autocomplete no longer works.

From my preliminary investigation, the autocomplete is derived from doing a GET _mappings API call, which returns the mappings for all indices. This API call returns 403 as long as the user does not have indices:admin/mappings/get for a single index.

I'm not sure if this should be fixed by Opensearch or Opensearch-Dashboards.

@bladerail bladerail added bug Something isn't working untriaged labels Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants