|
|
@@ -612,7 +612,7 @@ public class ReservedRolesStoreTests extends ESTestCase {
|
|
|
});
|
|
|
|
|
|
// read-only indices for APM telemetry
|
|
|
- Arrays.asList("apm-*").forEach((index) -> {
|
|
|
+ Arrays.asList("apm-" + randomAlphaOfLength(randomIntBetween(0, 13))).forEach((index) -> {
|
|
|
assertThat(kibanaRole.indices().allowedIndicesMatcher("indices:foo").test(mockIndexAbstraction(index)), is(false));
|
|
|
assertThat(kibanaRole.indices().allowedIndicesMatcher("indices:bar").test(mockIndexAbstraction(index)), is(false));
|
|
|
assertThat(kibanaRole.indices().allowedIndicesMatcher(DeleteIndexAction.NAME).test(mockIndexAbstraction(index)), is(false));
|
|
|
@@ -627,6 +627,25 @@ public class ReservedRolesStoreTests extends ESTestCase {
|
|
|
assertThat(kibanaRole.indices().allowedIndicesMatcher(READ_CROSS_CLUSTER_NAME).test(mockIndexAbstraction(index)), is(true));
|
|
|
});
|
|
|
|
|
|
+ // read-only indices for APM telemetry under Fleet
|
|
|
+ Arrays.asList(
|
|
|
+ "traces-apm-" + randomAlphaOfLength(randomIntBetween(0, 13)),
|
|
|
+ "traces-apm." + randomAlphaOfLength(randomIntBetween(0, 13)),
|
|
|
+ "logs-apm." + randomAlphaOfLength(randomIntBetween(0, 13)),
|
|
|
+ "metrics-apm." + randomAlphaOfLength(randomIntBetween(0, 13))
|
|
|
+ ).forEach((index) -> {
|
|
|
+ assertThat(kibanaRole.indices().allowedIndicesMatcher("indices:foo").test(mockIndexAbstraction(index)), is(false));
|
|
|
+ assertThat(kibanaRole.indices().allowedIndicesMatcher("indices:bar").test(mockIndexAbstraction(index)), is(false));
|
|
|
+ assertThat(kibanaRole.indices().allowedIndicesMatcher(GetIndexAction.NAME).test(mockIndexAbstraction(index)), is(true));
|
|
|
+ assertThat(kibanaRole.indices().allowedIndicesMatcher(CreateIndexAction.NAME).test(mockIndexAbstraction(index)), is(false));
|
|
|
+ assertThat(kibanaRole.indices().allowedIndicesMatcher(IndexAction.NAME).test(mockIndexAbstraction(index)), is(false));
|
|
|
+ assertThat(kibanaRole.indices().allowedIndicesMatcher(DeleteAction.NAME).test(mockIndexAbstraction(index)), is(false));
|
|
|
+ assertThat(kibanaRole.indices().allowedIndicesMatcher(SearchAction.NAME).test(mockIndexAbstraction(index)), is(true));
|
|
|
+ assertThat(kibanaRole.indices().allowedIndicesMatcher(MultiSearchAction.NAME).test(mockIndexAbstraction(index)), is(true));
|
|
|
+ assertThat(kibanaRole.indices().allowedIndicesMatcher(GetAction.NAME).test(mockIndexAbstraction(index)), is(true));
|
|
|
+ assertThat(kibanaRole.indices().allowedIndicesMatcher(READ_CROSS_CLUSTER_NAME).test(mockIndexAbstraction(index)), is(true));
|
|
|
+ });
|
|
|
+
|
|
|
// read-only indices for Endpoint diagnostic information
|
|
|
Arrays.asList(".logs-endpoint.diagnostic.collection-" + randomAlphaOfLength(randomIntBetween(0, 13))).forEach((index) -> {
|
|
|
assertThat(kibanaRole.indices().allowedIndicesMatcher("indices:foo").test(mockIndexAbstraction(index)), is(false));
|