[7.x] Add read privileges for annotations for apm_user (#58530) (#58781)

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
Dario Gieselaar 2020-07-01 09:04:57 +02:00 committed by GitHub
parent 3d49e62960
commit 417f7062c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -180,7 +180,9 @@ public class ReservedRolesStore implements BiConsumer<Set<String>, ActionListene
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[] {

View File

@ -1148,6 +1148,8 @@ public class ReservedRolesStoreTests extends ESTestCase {
assertOnlyReadAllowed(role, "apm-" + randomIntBetween(0, 5));
assertOnlyReadAllowed(role, AnomalyDetectorsIndexFields.RESULTS_INDEX_PREFIX + AnomalyDetectorsIndexFields.RESULTS_INDEX_DEFAULT);
assertOnlyReadAllowed(role, "observability-annotations");
}
public void testMachineLearningAdminRole() {