-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Add roles and cluster privileges for data frame transforms #39661
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 roles and cluster privileges for data frame transforms #39661
Conversation
This change adds two new cluster privileges: * manage_data_frame_transforms * monitor_data_frame_transforms And two new built-in roles: * data_frame_transforms_admin * data_frame_transforms_user These permit access to the data frame transform endpoints. (Index privileges are also required on the source and destination indices for each data frame transform, but since these indices are configurable they it is not appropriate to grant them via built-in roles.)
|
Pinging @elastic/ml-core |
|
In case it's not already on your to-do list, the new privileges also need to be added to Kibana: https://github.com/elastic/kibana/blob/master/x-pack/plugins/security/public/services/role_privileges.js |
hendrikmuhs
left a comment
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,
just 2 small suggestions, the test failure looks real: a mismatch in the number of roles
| } | ||
|
|
||
| protected void addAuthHeaderToRequest(final Request request, final String authHeader) { | ||
| RequestOptions.Builder options = request.getOptions().toBuilder(); |
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: I wonder if we can make this nicer, e.g.
protected Request createRequestWithAuth (final String method, final String endpoint, final String authHeader) {
...
}
| addAuthHeaderToRequest(createDataframeTransformRequest, BASIC_AUTH_VALUE_DATA_FRAME_ADMIN_WITH_SOME_DATA_ACCESS); | ||
|
|
||
| String config = "{" | ||
| + " \"source\": \"reviews\"," |
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: as you were creating the constant, could be REVIEWS_INDEX_NAME
This change adds two new cluster privileges: * manage_data_frame_transforms * monitor_data_frame_transforms And two new built-in roles: * data_frame_transforms_admin * data_frame_transforms_user These permit access to the data frame transform endpoints. (Index privileges are also required on the source and destination indices for each data frame transform, but since these indices are configurable they it is not appropriate to grant them via built-in roles.)
This change adds two new cluster privileges:
And two new built-in roles:
These permit access to the data frame transform endpoints.
(Index privileges are also required on the source and
destination indices for each data frame transform, but
since these indices are configurable they it is not
appropriate to grant them via built-in roles.)