Skip to content

Conversation

@droberts195
Copy link

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:

* 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.)
@elasticmachine
Copy link
Collaborator

Pinging @elastic/ml-core

@lcawl
Copy link
Contributor

lcawl commented Mar 4, 2019

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

Copy link

@hendrikmuhs hendrikmuhs left a 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();

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\","

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

@droberts195 droberts195 merged commit 6cf7558 into elastic:master Mar 5, 2019
@droberts195 droberts195 deleted the security_roles_for_data_frames branch March 5, 2019 14:05
droberts195 pushed a commit that referenced this pull request Mar 5, 2019
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.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants