-
Notifications
You must be signed in to change notification settings - Fork 293
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
Use SystemIndexRegistry from core to determine if request contains system indices #4471
Use SystemIndexRegistry from core to determine if request contains system indices #4471
Conversation
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
src/main/java/org/opensearch/security/privileges/SystemIndexAccessEvaluator.java
Outdated
Show resolved
Hide resolved
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>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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>
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.