- Notifications
You must be signed in to change notification settings - Fork 25.6k
Add "_storage" internal user #95694
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
Add "_storage" internal user #95694
Conversation
This commit adds a new internal user to security. The "_storage" user (`StorageInternalUser`) is used to perform refreshes (and, in the future, similar actions) that may not be permitted by the authenticated user.
| Pinging @elastic/es-security (Team:Security) |
| Hi @tvernum, I've created a changelog YAML for you. |
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.
LGTM
| public static final String APM_ROLE = "apm_system"; | ||
| public static final String ASYNC_SEARCH_NAME = "_async_search"; | ||
| public static final String ASYNC_SEARCH_ROLE = "_async_search"; | ||
| public static final String STORAGE_USER_NAME = "_storage"; |
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.
Nit: Is this name a bit too generic? I don't quite get what it should be used for by just looking at the name. Maybe it is just due to my lack of context. Feel free to ignore since naming discussion can rather subjective.
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 assume it will be a generic user for any actions that are needed in order to "write to the backing store"
We may have some existing actions that run as _system that ought to be switched over to this user.
I don't love the name, and would be happy with an alternative, but I don't think that's specifically because it's generic in the sense of "could mean many things", but because it's not a term that has an obvious meaning withini the ES code.
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.
Just to say that #95506 where we first intend to use this user is targeted for serverless. So another option (at least for now) could be to rename this to _serverless. But I do like the generality of _storage as well.
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 don't think we want to have internal users that only exist for serverless (even if the thing they do is currently only needed on serverless). It means we need to create a new user if we want to follow the same pattern on stateful code paths.
| | ||
| assertThat(role.cluster().privileges(), Matchers.hasSize(0)); | ||
| assertThat(role.runAs(), is(RunAsPermission.NONE)); | ||
| assertThat(role.application(), is(ApplicationPermission.NONE)); |
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.
Nit: we could also assert remote indices is None, i.e.
assertThat(role.remoteIndices(), is(RemoteIndicesPermission.NONE)); 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.
LGTM and works as well
| public static final String APM_ROLE = "apm_system"; | ||
| public static final String ASYNC_SEARCH_NAME = "_async_search"; | ||
| public static final String ASYNC_SEARCH_ROLE = "_async_search"; | ||
| public static final String STORAGE_USER_NAME = "_storage"; |
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.
Just to say that #95506 where we first intend to use this user is targeted for serverless. So another option (at least for now) could be to rename this to _serverless. But I do like the generality of _storage as well.
This commit adds a new internal user to security. The "_storage" user (
StorageInternalUser) is intended for use when performing automatic refreshes (and, in the future, similar actions) that may not be permitted by the authenticated user.Relates: #95506