-
Notifications
You must be signed in to change notification settings - Fork 159
Onboards to centralized resource access control mechanism for ml-model-group #3715
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
base: main
Are you sure you want to change the base?
Onboards to centralized resource access control mechanism for ml-model-group #3715
Conversation
…l-group Signed-off-by: Darshit Chanpura <[email protected]>
Apply spotless: |
Signed-off-by: Darshit Chanpura <[email protected]>
Signed-off-by: Darshit Chanpura <[email protected]>
Signed-off-by: Darshit Chanpura <[email protected]>
Signed-off-by: Darshit Chanpura <[email protected]>
Integ tests are failing. |
bd13cc6
to
b5f7efe
Compare
.getResourceSharingClient(); | ||
|
||
resourceSharingClient | ||
.share( |
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.
Once onboarded and ml access framework is deprecated, what happens to the already existing resources with access controls defined by ml-plugin
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.
2 things:
- This feature is currently for fresh 3.1 clusters only
2.We have a migration path (APIs) which will implement the migrate API to enable feature usage on existing clusters migrating to 3.1
Once the feature is enabled by default, ml-access framework can be safely deleted.
53177d2
to
6906ff0
Compare
@@ -76,13 +83,19 @@ private void preProcessRoleAndPerformSearch( | |||
User user, | |||
ActionListener<SearchResponse> listener | |||
) { | |||
boolean isResourceSharingFeatureEnabled = ML_COMMONS_MODEL_ACCESS_CONTROL_ENABLED.get(settings) |
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.
I've introduced this change to allow enabling feature only if ml's access-control feature flag is enabled. This allows for control of the resource-sharing feature, whether it should be enabled or disabled in ML regardless of whether feature is globally enabled. This will give some sense of familiarity to admins. Same suit is followed in AD plugin as well: https://github.com/opensearch-project/anomaly-detection/pull/1400/files#diff-cf370d40fdd2abc404283fa1e37768646f30ee1b8bfbb0b5c5302fc8a2a080fcR707
Signed-off-by: Darshit Chanpura <[email protected]>
3a80806
to
2d3b021
Compare
if (modelGroupId == null | ||
|| (!mlFeatureEnabledSetting.isMultiTenancyEnabled() | ||
&& (isAdmin(user) || !isSecurityEnabledAndModelAccessControlEnabled(user)))) { | ||
if (modelGroupId == null || (!mlFeatureEnabledSetting.isMultiTenancyEnabled())) { |
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.
The condition !mlFeatureEnabledSetting.isMultiTenancyEnabled()
has to be checked along with the ones removed actually. Please add it to line 199 and remove from here.
So with this PR, we are first going to check resource sharing permissions and then check for ml access control permissions? Or is it like if resource sharing is not enabled, only then we check for ml access control? |
|
||
// share with current user's backend-roles | ||
// TODO: check if resource should be shared with user's backend roles by default | ||
recipientMap.set(Map.of(Recipient.BACKEND_ROLES, Set.copyOf(user.getBackendRoles()))); |
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.
I am little confused here. Why are we taking all backend roles here. What if user had 3 backend and is sharing the resource only with one of his backend roles? In that case, shouldn't we use input.getBackendRoles()
? In the create model group request, user can give what backend roles to share with
Description
Implements resource-access-control for ML-Model-Group.
Feature Proposal: opensearch-project/security#4500
Related Issues
TBD
Check List
--signoff
.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.