-
Notifications
You must be signed in to change notification settings - Fork 286
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
[FEATURE] New reserved roles are not sourced to security index on an upgrade #2316
Comments
@opensearch-project/security-analytics This scenario might be impacting y'all, it might be worthwhile to invest in this scenario. Here is where I believe there is a lot of overlap, after upgrading a cluster that does not have the new roles needed for the security-analytics plugin when it is 'upgraded-in' on at a later time. |
[Triage] In the short-term this can be a documentation fix. @peternied to follow-up on this issue. |
One possible solution: This would remove some of the static-ness from our design and solve the problem for upgrading domains getting the latest roles and permissions from yml file without user action/documentation. |
This is observed on a cluster where the cluster was upgrade from 1.3 to 2.3 and missing CCR perms and roles. This does not resolve after redeploy. |
This is the expected behavior, the security plugin does not alter the security configuration on established clusters. Cluster administrators can add this functionality via the security admin tool https://opensearch.org/docs/latest/security/configuration/security-admin This feature request is about adding this functionality which some administrators might be comfortable with, whereas others might not want this behavior. Its a complex scenario based on the expectations of the administrator, we would be open for pull requests around this space. |
Got it, it would be nice if it can prompt a windows to let me know Without this, I was fairly confused for half a day trying to figure out is my cluster have enough permission to run ccr, with multiple b/g and upgrade to latest version, without using the Thanks. |
@peterzhuamazon Roger that - must have been frustrating. Good idea about the warning. |
Proposal - Check/Upgrade reserved roles from configOpenSearch's security defaults are controlled by the Updated eligible check on startupOn the security plugin start - for only the master node, read the Upgrade eligible check via APICreate an API "GET /_plugins/_security/api/_reserved/_upgrade_check" that can be used by tools to determine the upgrade state with the following responses.
Upgrade action via APICreate an API "POST /_plugins/_security/api/_reserved/_upgrade_apply" that triggers an upgrade, overrides all permissions on reserved roles and replaces them with what is found in the
Security admin toolAdd additional options to the security admin tool to include options to check this API and perform the upgrade. |
@peternied This approach looks good to me. I think it makes sense to create an API where you can check to see if your current security config has the latest version of all reserved rolls. I know there is no current mapping between role -> plugin, but if its possible, it would also be interesting to take into account whether a specific plugin is installed and that the roles associated with the plugins exist in the security index. |
FYI @cwperks draft PR willyborankin#1 |
…4102) ### Description This adds a new API that allows for checking and updating configurations from the default configurations on disk. Initial feature supports only Roles. #### Response when no upgrade is available ``` GET _plugins/_security/api/_upgrade_check 200 { "status": "ok", "upgradeAvailable" : false } ``` #### Response when a new role is available ``` GET _plugins/_security/api/_upgrade_check 200 { "status": "ok", "upgradeAvailable" : true, "upgradeActions" : { "roles" : { "add" : [ "flow_framework_full_access" ] } } } ``` #### Response when a new role + existing role were updated ``` GET _plugins/_security/api/_upgrade_check 200 { "status": "ok", "upgradeAvailable" : true, "upgradeActions" : { "roles" : { "add" : [ "flow_framework_full_access" ], "modify" : [ "flow_framework_read_access" ] } } } ``` #### Perform an upgrade ``` POST _plugins/_security/api/_upgrade_perform 200 { "status" : "OK", "upgrades" : { "roles" : { "add" : [ "flow_framework_full_access" ], "modify" : [ "flow_framework_read_access" ] } } } ``` #### Perform an upgrade when unneeded ``` POST _plugins/_security/api/_upgrade_perform 400 { "status": "BAD_REQUEST", "message": "Unable to upgrade, no differences found in 'roles' config" } ``` ### Issues Resolved - #2316 ### Testing New unit test and integration test cases ### Check List - [X] New functionality includes testing - [ ] New functionality has been documented - [X] Commits are signed per the DCO using --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](https://github.com/opensearch-project/OpenSearch/blob/main/CONTRIBUTING.md#developer-certificate-of-origin). --------- Signed-off-by: Peter Nied <[email protected]> Signed-off-by: Andrey Pleskach <[email protected]> Signed-off-by: Peter Nied <[email protected]>
…pensearch-project#4102) This adds a new API that allows for checking and updating configurations from the default configurations on disk. Initial feature supports only Roles. ``` GET _plugins/_security/api/_upgrade_check 200 { "status": "ok", "upgradeAvailable" : false } ``` ``` GET _plugins/_security/api/_upgrade_check 200 { "status": "ok", "upgradeAvailable" : true, "upgradeActions" : { "roles" : { "add" : [ "flow_framework_full_access" ] } } } ``` ``` GET _plugins/_security/api/_upgrade_check 200 { "status": "ok", "upgradeAvailable" : true, "upgradeActions" : { "roles" : { "add" : [ "flow_framework_full_access" ], "modify" : [ "flow_framework_read_access" ] } } } ``` ``` POST _plugins/_security/api/_upgrade_perform 200 { "status" : "OK", "upgrades" : { "roles" : { "add" : [ "flow_framework_full_access" ], "modify" : [ "flow_framework_read_access" ] } } } ``` ``` POST _plugins/_security/api/_upgrade_perform 400 { "status": "BAD_REQUEST", "message": "Unable to upgrade, no differences found in 'roles' config" } ``` - opensearch-project#2316 New unit test and integration test cases - [X] New functionality includes testing - [ ] New functionality has been documented - [X] Commits are signed per the DCO using --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](https://github.com/opensearch-project/OpenSearch/blob/main/CONTRIBUTING.md#developer-certificate-of-origin). --------- Signed-off-by: Peter Nied <[email protected]> Signed-off-by: Andrey Pleskach <[email protected]> Signed-off-by: Peter Nied <[email protected]> (cherry picked from commit fa877ba)
…pensearch-project#4102) ### Description This adds a new API that allows for checking and updating configurations from the default configurations on disk. Initial feature supports only Roles. #### Response when no upgrade is available ``` GET _plugins/_security/api/_upgrade_check 200 { "status": "ok", "upgradeAvailable" : false } ``` #### Response when a new role is available ``` GET _plugins/_security/api/_upgrade_check 200 { "status": "ok", "upgradeAvailable" : true, "upgradeActions" : { "roles" : { "add" : [ "flow_framework_full_access" ] } } } ``` #### Response when a new role + existing role were updated ``` GET _plugins/_security/api/_upgrade_check 200 { "status": "ok", "upgradeAvailable" : true, "upgradeActions" : { "roles" : { "add" : [ "flow_framework_full_access" ], "modify" : [ "flow_framework_read_access" ] } } } ``` #### Perform an upgrade ``` POST _plugins/_security/api/_upgrade_perform 200 { "status" : "OK", "upgrades" : { "roles" : { "add" : [ "flow_framework_full_access" ], "modify" : [ "flow_framework_read_access" ] } } } ``` #### Perform an upgrade when unneeded ``` POST _plugins/_security/api/_upgrade_perform 400 { "status": "BAD_REQUEST", "message": "Unable to upgrade, no differences found in 'roles' config" } ``` ### Issues Resolved - opensearch-project#2316 ### Testing New unit test and integration test cases ### Check List - [X] New functionality includes testing - [ ] New functionality has been documented - [X] Commits are signed per the DCO using --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](https://github.com/opensearch-project/OpenSearch/blob/main/CONTRIBUTING.md#developer-certificate-of-origin). --------- Signed-off-by: Peter Nied <[email protected]> Signed-off-by: Andrey Pleskach <[email protected]> Signed-off-by: Peter Nied <[email protected]>
|
Is your feature request related to a problem?
New reserved roles are often added between releases when a new plug-in is released and associated roles are created to provision access to features of the new plugin. Reserved roles are added to the security repo
roles.yml
like is done in this PR: #2192 which introduces 3 new reserved roles between 2.3.0 and 2.4.0.When starting up a cluster with the upgraded version of OpenSearch I receive the following line:
indicating that the new reserved roles in
roles.yml
will need to be manually added either via the API by an admin or via securityadmin tool connecting via clientcert as a super admin.This becomes additionally complicated when users of OpenSearch add custom roles or modify the security index in any way via the OSD UI or API as it is destructive to run
securityadmin.sh
because it can delete custom configuration. In order to get around this I have:roles.yml
with new reserved roles in the repo'sroles.yml
: https://github.com/opensearch-project/security/blob/main/config/roles.ymlroles.yml
with custom roles and the repo'sroles.yml
of the corresponding version of opensearchThis is not an idea process and there can be a better solution to source new reserved roles during an upgrade
The text was updated successfully, but these errors were encountered: