-
Notifications
You must be signed in to change notification settings - Fork 275
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
Implement resource permission evaluation in security #4638
Implement resource permission evaluation in security #4638
Conversation
Signed-off-by: Stephen Crawford <steecraw@amazon.com>
Signed-off-by: Stephen Crawford <steecraw@amazon.com>
Signed-off-by: Stephen Crawford <steecraw@amazon.com>
Signed-off-by: Stephen Crawford <steecraw@amazon.com>
Signed-off-by: Stephen Crawford <steecraw@amazon.com>
Signed-off-by: Stephen Crawford <steecraw@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.
Good first steps, thanks for putting this out there.
src/main/java/org/opensearch/security/privileges/ResourceAccessEvaluator.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/security/privileges/ResourceAccessEvaluator.java
Show resolved
Hide resolved
@@ -29,6 +29,7 @@ | |||
|
|||
import java.util.ArrayList; | |||
import java.util.Collections; | |||
import java.util.Date; |
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.
- This is a first in this class, is this a version of [FEATURE] Security plugin config entries should have a
created_at
andupdated_at
timestamp #3079 that you wanted to include for the new type?
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.
To be honest, I just thought it seemed like it may be a nice thing to have since we were adding the new class. I can also remove it though and don't feel strongly about its inclusion.
src/main/java/org/opensearch/security/privileges/ResourceAccessEvaluator.java
Outdated
Show resolved
Hide resolved
FYI I have been exploring the idea I posted about here on my fork here. Ultimately, I think the resource owner needs to be empowered to determine how they want to share the resource with others without going through the admin of the cluster. In order for ml-commons to adopt the new scheme that security will provide, how will the |
Signed-off-by: Stephen Crawford <steecraw@amazon.com>
HI @cwperks, thanks for your thoughtful comments. I tried to address your thoughts below.
I think most patterns we follow force users to rely on the cluster operator/administrator in some ways. I understand you would like to model resources as registered fields in a per-resource indices which any user can create. This is quite different than how roles work and seems better suited outside of the roles system. Perhaps, you discussed things elsewhere, but based off #4500 (comment) it seemed like this discussion was being tabled.
I would expect the ML-commons plugin to override ActionRequests for their plugin and add the associated resources to the new method being added (in core):
From there, I would expect there to be a role i.e. @DarshitChanpura @cwperks It seems like there is still decisions to be made around the design of the feature. I would describe DC's intention as more of "adding resource controls to role based access controls" while Craig seems to be more interested in adding an independent access system for resources. I suggest we reach consensus on this before moving forward. It is probably best to carry this on over at #4500 |
Description
[Describe what this change achieves]
This change adds resource permission evaluation into the Security plugin framework. This is accomplished by adding a new class ResourcePrivilegesEvaluator and expanding the RoleV7 definition to account for the new Resource class.
This PR is dependent on the related change in core: opensearch-project/OpenSearch#15230
Issues Resolved
#4562
Testing
[Please provide details of testing done: unit testing, integration testing and manual testing]
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.