diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/store/KibanaOwnedReservedRoleDescriptors.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/store/KibanaOwnedReservedRoleDescriptors.java index 2f44995671eb8..10b9b43ded62f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/store/KibanaOwnedReservedRoleDescriptors.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/store/KibanaOwnedReservedRoleDescriptors.java @@ -100,6 +100,8 @@ static RoleDescriptor kibanaSystem(String name) { // The symbolic constant for this one is in SecurityActionMapper, so not // accessible from X-Pack core "cluster:admin/analyze", + "cluster:admin/script/put", + "cluster:admin/script/get", // To facilitate using the file uploader functionality "monitor_text_structure", // To cancel tasks and delete async searches @@ -255,6 +257,9 @@ static RoleDescriptor kibanaSystem(String name) { // Observability, etc. // Kibana system user uses them to read / write alerts. RoleDescriptor.IndicesPrivileges.builder().indices(ReservedRolesStore.ALERTS_INDEX_ALIAS).privileges("all").build(), + // "Cases as data" analytics indexes and aliases + RoleDescriptor.IndicesPrivileges.builder().indices(ReservedRolesStore.CASES_ANALYTICS_INDEXES).privileges("all").build(), + RoleDescriptor.IndicesPrivileges.builder().indices(ReservedRolesStore.CASES_ANALYTICS_ALIASES).privileges("all").build(), // "Alerts as data" public index alias used in Security Solution // Kibana system user uses them to read / write alerts. RoleDescriptor.IndicesPrivileges.builder() diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStore.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStore.java index bb6c457f30095..ba4977a21181b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStore.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStore.java @@ -53,6 +53,10 @@ public class ReservedRolesStore implements BiConsumer, ActionListene /** Alerts, Rules, Cases (RAC) index used by multiple solutions */ public static final String ALERTS_INDEX_ALIAS = ".alerts*"; + /** Cases analytics indexes and aliases */ + public static final String CASES_ANALYTICS_INDEXES = ".internal.cases*"; + public static final String CASES_ANALYTICS_ALIASES = ".cases*"; + /** Alerts, Rules, Cases (RAC) preview index used by multiple solutions */ public static final String PREVIEW_ALERTS_INDEX_ALIAS = ".preview.alerts*"; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStoreTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStoreTests.java index d9d64be9d1d1b..2e0a6d63e470d 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStoreTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStoreTests.java @@ -436,6 +436,10 @@ public void testKibanaSystemRole() { assertThat(kibanaRole.cluster().check(ClusterUpdateSettingsAction.NAME, request, authentication), is(false)); assertThat(kibanaRole.cluster().check(MonitoringBulkAction.NAME, request, authentication), is(true)); + // Script + assertTrue(kibanaRole.cluster().check("cluster:admin/script/put", request, authentication)); + assertTrue(kibanaRole.cluster().check("cluster:admin/script/get", request, authentication)); + // Inference assertTrue(kibanaRole.cluster().check("cluster:admin/xpack/inference/get", request, authentication)); assertTrue(kibanaRole.cluster().check("cluster:admin/xpack/inference/put", request, authentication)); @@ -611,6 +615,8 @@ public void testKibanaSystemRole() { ".apm-agent-configuration", ".apm-custom-link", ".apm-source-map", + ReservedRolesStore.CASES_ANALYTICS_INDEXES + randomAlphaOfLength(randomIntBetween(0, 13)), + ReservedRolesStore.CASES_ANALYTICS_ALIASES + randomAlphaOfLength(randomIntBetween(0, 13)), ReservedRolesStore.ALERTS_LEGACY_INDEX + randomAlphaOfLength(randomIntBetween(0, 13)), ReservedRolesStore.ALERTS_LEGACY_INDEX_REINDEXED_V8 + randomAlphaOfLength(randomIntBetween(0, 13)), ReservedRolesStore.ALERTS_BACKING_INDEX + randomAlphaOfLength(randomIntBetween(0, 13)),