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

Fix permissions issue with _update_by_query API that requires permission for indices:data/read/scroll/clear #17250

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

cwperks
Copy link
Member

@cwperks cwperks commented Feb 4, 2025

Description

I discovered an issue with the _update_by_query API where is requires a user to have permissions for indices:data/read/scroll/clear in order to call this API.

The reason for this is that it internally uses scroll to perform the update. Since these are internal calls, I think it would be better to wrap them in a system context which doesn't require authorization so that end users can be permitted to use _update_by_query by simply having the permission for indices:data/write/update/byquery

A test to replicate the permissions issue would be added in the security plugin.

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

…ion for indices:data/read/scroll/clear

Signed-off-by: Craig Perkins <[email protected]>
Copy link
Contributor

github-actions bot commented Feb 4, 2025

❌ Gradle check result for e4f58ca: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Signed-off-by: Craig Perkins <[email protected]>
Copy link
Contributor

github-actions bot commented Feb 5, 2025

✅ Gradle check result for 346dae6: SUCCESS

Copy link

codecov bot commented Feb 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.42%. Comparing base (865704b) to head (346dae6).

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #17250      +/-   ##
============================================
- Coverage     72.43%   72.42%   -0.01%     
- Complexity    65725    65752      +27     
============================================
  Files          5318     5318              
  Lines        305675   305678       +3     
  Branches      44350    44350              
============================================
- Hits         221408   221381      -27     
- Misses        66055    66131      +76     
+ Partials      18212    18166      -46     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

1 participant