Skip to content

Commit 499f84a

Browse files
authored
[ML] Retain built-in ML roles granting Kibana privileges (#80014)
The machine_learning_admin and machine_learning_user roles in Elasticsearch also grant access to the ML pages in Kibana. At one time it was intended that this should change in 8.0, so that ML privileges in Kibana would be completely separate. However, our thinking has now changed. An administrator cannot give a user the Elasticsearch backend roles and expect Kibana privileges alone to then stop that user from using ML - the user could just switch to curl or even Kibana dev console (which uses backend privileges rather than Kibana privileges). So it's clearer what is really being permitted if the backend roles continue to allow access to the ML UI as well as the ML backend endpoints. There's nothing the user can see in the ML UI that they couldn't find out by calling ML Elasticsearch endpoints directly and rendering the responses in a more graphical way.
1 parent 0d5cc32 commit 499f84a

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStore.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,13 @@ private static Map<String, RoleDescriptor> initializeReservedRoles() {
285285
.indices(".ml-annotations*")
286286
.privileges("view_index_metadata", "read", "write")
287287
.build() },
288-
// TODO: remove Kibana privileges from ML backend roles in 8.0.0
288+
// This role also grants Kibana privileges related to ML.
289+
// This makes it completely clear to UI administrators that
290+
// if they grant the Elasticsearch backend role to a user then
291+
// they cannot expect Kibana privileges to stop that user from
292+
// accessing ML functionality - the user could switch to curl
293+
// or even Kibana dev console and call the ES endpoints directly
294+
// bypassing the Kibana privileges layer entirely.
289295
new RoleDescriptor.ApplicationResourcePrivileges[] {
290296
RoleDescriptor.ApplicationResourcePrivileges.builder()
291297
.application("kibana-*")
@@ -313,7 +319,13 @@ private static Map<String, RoleDescriptor> initializeReservedRoles() {
313319
.indices(".ml-annotations*")
314320
.privileges("view_index_metadata", "read", "write")
315321
.build() },
316-
// TODO: remove Kibana privileges from ML backend roles in 8.0.0
322+
// This role also grants Kibana privileges related to ML.
323+
// This makes it completely clear to UI administrators that
324+
// if they grant the Elasticsearch backend role to a user then
325+
// they cannot expect Kibana privileges to stop that user from
326+
// accessing ML functionality - the user could switch to curl
327+
// or even Kibana dev console and call the ES endpoints directly
328+
// bypassing the Kibana privileges layer entirely.
317329
new RoleDescriptor.ApplicationResourcePrivileges[] {
318330
RoleDescriptor.ApplicationResourcePrivileges.builder()
319331
.application("kibana-*")

0 commit comments

Comments
 (0)