Skip to content

Commit

Permalink
[7.8] Add read privileges for annotations for apm_user (#58530) (#58782)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgieselaar authored Jul 1, 2020
1 parent 8b8a61f commit 4e297ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,9 @@ private static Map<String, RoleDescriptor> initializeReservedRoles() {
RoleDescriptor.IndicesPrivileges.builder().indices("apm-*")
.privileges("read", "view_index_metadata").build(),
RoleDescriptor.IndicesPrivileges.builder().indices(".ml-anomalies*")
.privileges("view_index_metadata", "read").build(),
.privileges("read", "view_index_metadata").build(),
RoleDescriptor.IndicesPrivileges.builder().indices("observability-annotations")
.privileges("read", "view_index_metadata").build()
}, null, MetadataUtils.DEFAULT_RESERVED_METADATA))
.put("machine_learning_user", new RoleDescriptor("machine_learning_user", new String[] { "monitor_ml" },
new RoleDescriptor.IndicesPrivileges[] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1091,6 +1091,8 @@ public void testAPMUserRole() {

assertOnlyReadAllowed(role, "apm-" + randomIntBetween(0, 5));
assertOnlyReadAllowed(role, AnomalyDetectorsIndexFields.RESULTS_INDEX_PREFIX + AnomalyDetectorsIndexFields.RESULTS_INDEX_DEFAULT);

assertOnlyReadAllowed(role, "observability-annotations");
}

public void testMachineLearningAdminRole() {
Expand Down

0 comments on commit 4e297ae

Please sign in to comment.