Skip to content

[FEATURE] New reserved roles are not sourced to security index on an upgrade #2316

@cwperks

Description

@cwperks

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:

Index .opendistro_security already contains doc with id roles, skipping update

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:

  1. Ran a backup of the security index using security admin: https://opensearch.org/docs/latest/security-plugin/configuration/security-admin/#a-word-of-caution
  2. Reconcile the exported roles.yml with new reserved roles in the repo's roles.yml: https://github.com/opensearch-project/security/blob/main/config/roles.yml
  3. Run securityadmin.sh with the coalesced exported roles.yml with custom roles and the repo's roles.yml of the corresponding version of opensearch

This is not an idea process and there can be a better solution to source new reserved roles during an upgrade

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requesttriagedIssues labeled as 'Triaged' have been reviewed and are deemed actionable.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions