Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Comment on lines +103 to +104
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: You can reference actual action constants here.

Suggested change
"cluster:admin/script/put",
"cluster:admin/script/get",
TransportPutStoredScriptAction.TYPE.name(),
GetStoredScriptAction.NAME,

// To facilitate using the file uploader functionality
"monitor_text_structure",
// To cancel tasks and delete async searches
Expand Down Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ public class ReservedRolesStore implements BiConsumer<Set<String>, 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*";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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)),
Expand Down