[Resource Sharing] Adds a Resource Access Evaluator for standalone Resource access authorization#5408
Merged
cwperks merged 87 commits intoopensearch-project:mainfrom Aug 4, 2025
Conversation
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
…ource access Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
… framework Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
8c7eb57 to
f636120
Compare
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
…abled scenarios Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
70f09f1 to
bc312cc
Compare
cwperks
reviewed
Jul 31, 2025
cwperks
reviewed
Jul 31, 2025
src/main/java/org/opensearch/security/privileges/ResourceAccessEvaluator.java
Outdated
Show resolved
Hide resolved
cwperks
reviewed
Jul 31, 2025
src/main/java/org/opensearch/security/privileges/ResourceAccessEvaluator.java
Show resolved
Hide resolved
cwperks
reviewed
Jul 31, 2025
src/main/java/org/opensearch/security/resources/ResourceSharingIndexHandler.java
Outdated
Show resolved
Hide resolved
cwperks
reviewed
Jul 31, 2025
src/main/java/org/opensearch/security/resources/ResourceSharingIndexHandler.java
Outdated
Show resolved
Hide resolved
cwperks
reviewed
Jul 31, 2025
src/main/java/org/opensearch/security/resources/ResourceAccessHandler.java
Show resolved
Hide resolved
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
cwperks
reviewed
Aug 1, 2025
cwperks
previously approved these changes
Aug 1, 2025
nibix
reviewed
Aug 1, 2025
Collaborator
There was a problem hiding this comment.
The async handling for resource privilege evaluation looks good! 👍
I am a bit surprised by the additional ThreadContext header introduced in this PR. It feels a bit unrelated. This will be enabled independent of the feature flag, correct? As this will significantly increase the request size for each request, this is a bit critical, IMHO.
...ce-plugin/src/integrationTest/java/org/opensearch/sample/resource/SecurityDisabledTests.java
Outdated
Show resolved
Hide resolved
...ain/java/org/opensearch/sample/resource/actions/rest/revoke/RevokeResourceAccessRequest.java
Show resolved
Hide resolved
src/main/java/org/opensearch/security/resources/ResourceAccessHandler.java
Show resolved
Hide resolved
src/main/java/org/opensearch/security/transport/SecurityInterceptor.java
Show resolved
Hide resolved
… from user header Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
… sec filter Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
nibix
reviewed
Aug 4, 2025
src/main/java/org/opensearch/security/transport/SecurityRequestHandler.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
nibix
previously approved these changes
Aug 4, 2025
Collaborator
nibix
left a comment
There was a problem hiding this comment.
Thank you!
Approving. Still, I think we need to put a bit more thought into the serialization handling of the UserSubject; IMHO, it has quite a bit potential for inconsistencies at the moment:
But as this is not actually the central point of this PR, this can and should be handled separately.
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
nibix
approved these changes
Aug 4, 2025
cwperks
approved these changes
Aug 4, 2025
2 tasks
3 tasks
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
This PR adds a new privilege evaluator for evaluating access to a resource. #5281 introduced a way for plugin offload sharing and access evaluation to security plugin but that was done by requiring plugins to call verifyAccess method on their end. This leaves room for error. This new evaluator will filter all resource access requests through SecurityFilter class without requiring plugins to explicitly call verifyAccess method. It also adds support for access-levels instead of just the default one declared in the previous PR.
Notes:
verifyAccessfrom the client as plugin no longer have to explicitly call the method to check user access.Issues Resolved
Testing
Check List
- [ ] New Roles/Permissions have a corresponding security dashboards plugin PR- [ ] API changes companion pull request createdBy 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.