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 33d06a90121c0..cb2573b15c1df 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 @@ -265,6 +267,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 52fe69c949a4b..83d9ecacb1f38 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 @@ -52,6 +52,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 9136a34c44b8a..a220402434e83 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 @@ -434,6 +434,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)); @@ -609,6 +613,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)),