opensearch-project / opensearch-project/security
[BUG] Inconsistent behaviour of msearch operation when feature "do_not_fail_on_forbidden" is enabled or disabled
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 252
- Forks
- 395
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 76
Description
What is the bug?
Various set of permissions is required to perform msearch operation when the feature "do_not_fail_on_forbidden" is enabled or disabled
How can one reproduce the bug?
Steps to reproduce the behavior:
- Create and index
marvelous_songs - Add some documents to index
marvelous_songs - Disable feature do_not_fail_on_forbidden in security plugin configuration
- Create a role
limited-rolewith cluster permissionindices:data/read/msearchand index permissionindices:data/read/searchassigned to marvelous_songs index - Create a user with the assigned role limited-role
- Perform msearch operation to find some documents from
marvelous_songsindex. The operation works correctly and returns documents which match to search criteria - Enable the feature do_not_fail_on_forbidden
- Perform again search operation described in point 6. The operation fails with 403 response code
To perform msearch operation when do_not_fail_on_forbidden feature is enabled an additional index permission indices:data/read/msearch is required.
What is the expected behavior?
The same set of cluster and index permissions is required to perform msearch operation when the feature "do_not_fail_on_forbidden" is enabled or disabled
What is your host/environment?
- OS: Ubuntu Linux 20.04 LTS
- Version 2.4.0-SNAPSHOT
- Plugins security plugin
Do you have any screenshots?
No
Do you have any additional context?
The problem was noticed during writing integration tests for do_not_fail_on_forbidden feature.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the integration tests for the do_not_fail_on_forbidden feature and trace the permission checks used by msearch. Reproduce the two configurations with the limited-role permissions described in the issue; done means both configurations require the same cluster and index permissions and return the expected search results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- authorization, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100