Use SystemIndexRegistry from core to determine if request contains system indices#4471
Merged
willyborankin merged 13 commits intoopensearch-project:mainfrom Jul 11, 2024
Merged
Conversation
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
shikharj05
reviewed
Jun 19, 2024
src/main/java/org/opensearch/security/privileges/SystemIndexAccessEvaluator.java
Outdated
Show resolved
Hide resolved
willyborankin
previously approved these changes
Jun 20, 2024
Member
Author
|
Setting this to Draft until Core PR is finalized and all associated PRs are merged. |
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Member
DarshitChanpura
left a comment
There was a problem hiding this comment.
Changes look good to me. Left some comments. Will wait for CI to be green before re-reviewing
src/integrationTest/java/org/opensearch/security/SystemIndexTests.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/security/privileges/SystemIndexAccessEvaluator.java
Show resolved
Hide resolved
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4471 +/- ##
=======================================
Coverage 64.99% 64.99%
=======================================
Files 314 314
Lines 22111 22112 +1
Branches 3566 3566
=======================================
+ Hits 14370 14371 +1
Misses 5955 5955
Partials 1786 1786
|
src/main/java/org/opensearch/security/privileges/SystemIndexAccessEvaluator.java
Show resolved
Hide resolved
src/integrationTest/java/org/opensearch/security/SystemIndexTests.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Member
DarshitChanpura
left a comment
There was a problem hiding this comment.
one comment, lgtm otherwise.
src/integrationTest/java/org/opensearch/security/http/ExampleSystemIndexPlugin.java
Show resolved
Hide resolved
Signed-off-by: Craig Perkins <cwperx@amazon.com>
DarshitChanpura
approved these changes
Jul 11, 2024
willyborankin
approved these changes
Jul 11, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The security plugin currently tracks system indices through an OpenSearch Setting. This PR keeps the behavior of the existing setting and also updates the SystemIndexAccessEvaluator to check if the request contains system indices using the new SystemIndexRegistry class from core.
Registered System Index - A registered system index is an index pattern that has been reserved by a plugin via the SystemIndexPlugin.getSystemIndexDescriptors extension point. Conventionally, system indices begin with a dot (
.).This PR adds an IT that demonstrates how the security plugin will determine if a request matches any system indices using the SystemIndexRegistry from core.
This is a step towards a solution for #4439, but more work needs to be done in core to convey which plugin has stashes the ThreadContext so the security plugin can properly authorize interactions with system indices.
Enhancement
Issues Resolved
Related to #4439
Check List
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.