|
@@ -1216,6 +1216,31 @@ public class ReservedRolesStoreTests extends ESTestCase {
|
|
|
);
|
|
|
});
|
|
|
|
|
|
+ // cloud_defend
|
|
|
+ // read-only datastream for cloud_defend indices (for usageCollection)
|
|
|
+ Arrays.asList(
|
|
|
+ "logs-cloud_defend.file-" + randomAlphaOfLength(randomIntBetween(0, 13)),
|
|
|
+ "logs-cloud_defend.process-" + randomAlphaOfLength(randomIntBetween(0, 13)),
|
|
|
+ "logs-cloud_defend.alerts-" + randomAlphaOfLength(randomIntBetween(0, 13)),
|
|
|
+ "metrics-cloud_defend.metrics-" + randomAlphaOfLength(randomIntBetween(0, 13))
|
|
|
+ ).forEach((indexName) -> {
|
|
|
+ final IndexAbstraction indexAbstraction = mockIndexAbstraction(indexName);
|
|
|
+ assertThat(kibanaRole.indices().allowedIndicesMatcher("indices:foo").test(indexAbstraction), is(false));
|
|
|
+ assertThat(kibanaRole.indices().allowedIndicesMatcher("indices:bar").test(indexAbstraction), is(false));
|
|
|
+ assertThat(kibanaRole.indices().allowedIndicesMatcher(DeleteIndexAction.NAME).test(indexAbstraction), is(false));
|
|
|
+ assertThat(kibanaRole.indices().allowedIndicesMatcher(GetIndexAction.NAME).test(indexAbstraction), is(true));
|
|
|
+ assertThat(kibanaRole.indices().allowedIndicesMatcher(CreateIndexAction.NAME).test(indexAbstraction), is(false));
|
|
|
+ assertThat(kibanaRole.indices().allowedIndicesMatcher(IndexAction.NAME).test(indexAbstraction), is(false));
|
|
|
+ assertThat(kibanaRole.indices().allowedIndicesMatcher(DeleteAction.NAME).test(indexAbstraction), is(false));
|
|
|
+ assertThat(kibanaRole.indices().allowedIndicesMatcher(SearchAction.NAME).test(indexAbstraction), is(true));
|
|
|
+ assertThat(kibanaRole.indices().allowedIndicesMatcher(MultiSearchAction.NAME).test(indexAbstraction), is(true));
|
|
|
+ assertThat(kibanaRole.indices().allowedIndicesMatcher(GetAction.NAME).test(indexAbstraction), is(true));
|
|
|
+ assertThat(kibanaRole.indices().allowedIndicesMatcher(READ_CROSS_CLUSTER_NAME).test(indexAbstraction), is(false));
|
|
|
+ assertThat(kibanaRole.indices().allowedIndicesMatcher(UpdateSettingsAction.NAME).test(indexAbstraction), is(true));
|
|
|
+ assertThat(kibanaRole.indices().allowedIndicesMatcher(PutMappingAction.NAME).test(indexAbstraction), is(true));
|
|
|
+ assertThat(kibanaRole.indices().allowedIndicesMatcher(RolloverAction.NAME).test(indexAbstraction), is(true));
|
|
|
+ });
|
|
|
+
|
|
|
// Ensure privileges necessary for ILM policies in APM & Endpoint packages
|
|
|
Arrays.asList(
|
|
|
".logs-endpoint.diagnostic.collection-" + randomAlphaOfLengthBetween(3, 8),
|