Skip to content

Commit efa0963

Browse files
committed
removed unnecessary priviledges on .ml-anomalies-* for the kibana_system reserved role
1 parent a0ee239 commit efa0963

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,10 @@ private static Map<String, RoleDescriptor> initializeReservedRoles() {
130130
// APM custom link index creation
131131
RoleDescriptor.IndicesPrivileges.builder()
132132
.indices(".apm-custom-link").privileges("all").build(),
133-
// APM telemetry queries APM & ML anomalies indices in kibana task runner
133+
// APM telemetry queries APM indices in kibana task runner
134134
RoleDescriptor.IndicesPrivileges.builder()
135135
.indices("apm-*")
136-
.privileges("read", "read_cross_cluster", "view_index_metadata").build(),
137-
RoleDescriptor.IndicesPrivileges.builder()
138-
.indices(".ml-anomalies-*")
139-
.privileges("read", "read_cross_cluster", "view_index_metadata").build(),
136+
.privileges("read", "read_cross_cluster").build(),
140137
},
141138
null,
142139
new ConfigurableClusterPrivilege[] { new ManageApplicationPrivileges(Collections.singleton("kibana-*")) },

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStoreTests.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -397,14 +397,11 @@ public void testKibanaSystemRole() {
397397
});
398398

399399
// read-only indices for APM telemetry
400-
Arrays.asList(
401-
"apm-*",
402-
".ml-anomalies-*"
403-
).forEach((index) -> {
400+
Arrays.asList("apm-*").forEach((index) -> {
404401
assertThat(kibanaRole.indices().allowedIndicesMatcher("indices:foo").test(index), is(false));
405402
assertThat(kibanaRole.indices().allowedIndicesMatcher("indices:bar").test(index), is(false));
406403
assertThat(kibanaRole.indices().allowedIndicesMatcher(DeleteIndexAction.NAME).test(index), is(false));
407-
assertThat(kibanaRole.indices().allowedIndicesMatcher(GetIndexAction.NAME).test(index), is(true));
404+
assertThat(kibanaRole.indices().allowedIndicesMatcher(GetIndexAction.NAME).test(index), is(false));
408405
assertThat(kibanaRole.indices().allowedIndicesMatcher(CreateIndexAction.NAME).test(index), is(false));
409406
assertThat(kibanaRole.indices().allowedIndicesMatcher(IndexAction.NAME).test(index), is(false));
410407
assertThat(kibanaRole.indices().allowedIndicesMatcher(DeleteAction.NAME).test(index), is(false));

0 commit comments

Comments
 (0)