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.
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
Deprecate opendistro_security_roles and add opensearch_security_roles #5113
base: main
Are you sure you want to change the base?
Deprecate opendistro_security_roles and add opensearch_security_roles #5113
Changes from 1 commit
8c6601b
54c72fa
ab26317
4b27f5c
afe19d8
cb3e1cd
879f575
23b5916
47d755a
ba574b6
20768b0
736dc78
7e0fcc9
5f10ad6
9e28622
0674469
5b85ba6
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
One high-level remark:
IMHO, config property names should be as self-descriptive as possible. However, neither
opendistro_security_roles
noropensearch_security_roles
are really self-descriptive.The function of this property is as follows: Roles which are specified via
role
property first go through role-mapping so that they are mapped onto the effective roles of the user at runtime. Roles specified viaopendistro_security_roles
do not go through role mapping, but get effective immediately.Can we find a property name that is (kind of) self-descriptive?
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.
what do you think about
opensearch_security_inline_roles
/opensearch_security_static_roles
/opensearch_security_direct_roles
or any other name :) ?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 do not think the
opensearch_security
prefix is necessary, as the other attribute is also just calledroles
.So, that would be
inline_roles
orstatic_roles
ordirect_roles
. I would not recommendstatic_roles
, as this could be confused with the static role configuration in https://github.com/opensearch-project/security/blob/main/src/main/resources/static_config/static_roles.yml .I could also imagine
directly_effective_roles
, that would be most telling.@cwperks @DarshitChanpura @derek-ho wdyt?
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.
Personally, I think we should consider removing this attribute from the InternalUser object and only do roles mappings with RolesMappings.
What is the advantage of having multiple ways to map roles to usernames?
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 would consider these roles as default permissions that a user has when you create such an user. Also, it's simpler to setup for small number of users.
Using role mappings is better for more centralized and flexible management, better for managing similar users, etc.
I think it should be okay to keep this feature for it's simplicity (single API setup/configuration) - also, maybe it will prove helpful with service/system accounts feature in the plugin - i.e. using inline_roles or such directly_effective_roles for accounts.
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 would agree with @shikharj05 that one advantage is simplicity. On simple clusters without any external auth systems, this can improve the first user experience - under one constraint: It must be clear to the user which option has which purpose. If it is not clear to the user, this possibility actually makes first user experience worse, as this will cause confusion.
To make things even more complicated: There's also another config option
plugins.security.roles_mapping_resolution
which can be used to use theroles
property of the internal users database without roles mapping.My gist from this is: IMHO, on medium term, the property should be kept with a telling name and a crystal clear documentation. On long term, one might need to re-think the whole role mapping concept to address its larger issues.
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 have renamed the property to
direct_security_roles
- let me know your thoughts @nibix @cwperks .@cwperks should we create an issue to track the long-term re-evaluation of role mappings.
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.
Sounds like we are going to keep supporting inline roles based on this conversation. I think we can add an issue for migration assistance here. In past versions, there was a Migrate API to help migrating the security config so should we start implementing one to account for these upcoming changes as well?