opensearch-project / opensearch-project/security

[BUG] Inconsistent behaviour of msearch operation when feature "do_not_fail_on_forbidden" is enabled or disabled

Open
#2,113 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug help wanted triaged
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:

  1. Create and index marvelous_songs
  2. Add some documents to index marvelous_songs
  3. Disable feature do_not_fail_on_forbidden in security plugin configuration
  4. Create a role limited-role with cluster permission indices:data/read/msearch and index permission indices:data/read/search assigned to marvelous_songs index
  5. Create a user with the assigned role limited-role
  6. Perform msearch operation to find some documents from marvelous_songs index. The operation works correctly and returns documents which match to search criteria
  7. Enable the feature do_not_fail_on_forbidden
  8. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.