Skip to content

Commit

Permalink
[Security Solution] allows kibana_system user to manage .reindexed-v8…
Browse files Browse the repository at this point in the history
…-* Security Solution indices (#119054) (#119511)

* [Security Solution] allows kibana_system user to manage reindexed Security Solution indices

* fix code

* Update docs/changelog/119054.yaml
  • Loading branch information
vitaliidm authored Jan 3, 2025
1 parent 94fc833 commit 46ec08f
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 4 deletions.
6 changes: 6 additions & 0 deletions docs/changelog/119054.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 119054
summary: "[Security Solution] allows `kibana_system` user to manage .reindexed-v8-*\
\ Security Solution indices"
area: Authorization
type: enhancement
issues: []
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,19 @@ static RoleDescriptor kibanaSystem(String name) {
RoleDescriptor.IndicesPrivileges.builder().indices("logs-fleet_server*").privileges("read", "delete_index").build(),
// Legacy "Alerts as data" used in Security Solution.
// Kibana user creates these indices; reads / writes to them.
RoleDescriptor.IndicesPrivileges.builder().indices(ReservedRolesStore.ALERTS_LEGACY_INDEX).privileges("all").build(),
RoleDescriptor.IndicesPrivileges.builder()
.indices(ReservedRolesStore.ALERTS_LEGACY_INDEX, ReservedRolesStore.ALERTS_LEGACY_INDEX_REINDEXED_V8)
.privileges("all")
.build(),
// Used in Security Solution for value lists.
// Kibana user creates these indices; reads / writes to them.
RoleDescriptor.IndicesPrivileges.builder()
.indices(ReservedRolesStore.LISTS_INDEX, ReservedRolesStore.LISTS_ITEMS_INDEX)
.indices(
ReservedRolesStore.LISTS_INDEX,
ReservedRolesStore.LISTS_ITEMS_INDEX,
ReservedRolesStore.LISTS_INDEX_REINDEXED_V8,
ReservedRolesStore.LISTS_ITEMS_INDEX_REINDEXED_V8
)
.privileges("all")
.build(),
// "Alerts as data" internal backing indices used in Security Solution,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
public class ReservedRolesStore implements BiConsumer<Set<String>, ActionListener<RoleRetrievalResult>> {
/** "Security Solutions" only legacy signals index */
public static final String ALERTS_LEGACY_INDEX = ".siem-signals*";
public static final String ALERTS_LEGACY_INDEX_REINDEXED_V8 = ".reindexed-v8-siem-signals*";

/** Alerts, Rules, Cases (RAC) index used by multiple solutions */
public static final String ALERTS_BACKING_INDEX = ".internal.alerts*";
Expand All @@ -61,9 +62,11 @@ public class ReservedRolesStore implements BiConsumer<Set<String>, ActionListene

/** "Security Solutions" only lists index for value lists for detections */
public static final String LISTS_INDEX = ".lists-*";
public static final String LISTS_INDEX_REINDEXED_V8 = ".reindexed-v8-lists-*";

/** "Security Solutions" only lists index for value list items for detections */
public static final String LISTS_ITEMS_INDEX = ".items-*";
public static final String LISTS_ITEMS_INDEX_REINDEXED_V8 = ".reindexed-v8-items-*";

/** Index pattern for Universal Profiling */
public static final String UNIVERSAL_PROFILING_ALIASES = "profiling-*";
Expand Down Expand Up @@ -877,7 +880,14 @@ private static RoleDescriptor buildViewerRoleDescriptor() {
.build(),
// Security
RoleDescriptor.IndicesPrivileges.builder()
.indices(ReservedRolesStore.ALERTS_LEGACY_INDEX, ReservedRolesStore.LISTS_INDEX, ReservedRolesStore.LISTS_ITEMS_INDEX)
.indices(
ReservedRolesStore.ALERTS_LEGACY_INDEX,
ReservedRolesStore.LISTS_INDEX,
ReservedRolesStore.LISTS_ITEMS_INDEX,
ReservedRolesStore.ALERTS_LEGACY_INDEX_REINDEXED_V8,
ReservedRolesStore.LISTS_INDEX_REINDEXED_V8,
ReservedRolesStore.LISTS_ITEMS_INDEX_REINDEXED_V8
)
.privileges("read", "view_index_metadata")
.build(),
// Alerts-as-data
Expand Down Expand Up @@ -928,7 +938,14 @@ private static RoleDescriptor buildEditorRoleDescriptor() {
.build(),
// Security
RoleDescriptor.IndicesPrivileges.builder()
.indices(ReservedRolesStore.ALERTS_LEGACY_INDEX, ReservedRolesStore.LISTS_INDEX, ReservedRolesStore.LISTS_ITEMS_INDEX)
.indices(
ReservedRolesStore.ALERTS_LEGACY_INDEX,
ReservedRolesStore.LISTS_INDEX,
ReservedRolesStore.LISTS_ITEMS_INDEX,
ReservedRolesStore.ALERTS_LEGACY_INDEX_REINDEXED_V8,
ReservedRolesStore.LISTS_INDEX_REINDEXED_V8,
ReservedRolesStore.LISTS_ITEMS_INDEX_REINDEXED_V8
)
.privileges("read", "view_index_metadata", "write", "maintenance")
.build(),
// Alerts-as-data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -613,14 +613,17 @@ public void testKibanaSystemRole() {
".apm-custom-link",
".apm-source-map",
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)),
ReservedRolesStore.ALERTS_BACKING_INDEX_REINDEXED + randomAlphaOfLength(randomIntBetween(0, 13)),
ReservedRolesStore.ALERTS_INDEX_ALIAS + randomAlphaOfLength(randomIntBetween(0, 13)),
ReservedRolesStore.PREVIEW_ALERTS_INDEX_ALIAS + randomAlphaOfLength(randomIntBetween(0, 13)),
ReservedRolesStore.PREVIEW_ALERTS_BACKING_INDEX + randomAlphaOfLength(randomIntBetween(0, 13)),
ReservedRolesStore.PREVIEW_ALERTS_BACKING_INDEX_REINDEXED + randomAlphaOfLength(randomIntBetween(0, 13)),
ReservedRolesStore.LISTS_INDEX + randomAlphaOfLength(randomIntBetween(0, 13)),
ReservedRolesStore.LISTS_INDEX_REINDEXED_V8 + randomAlphaOfLength(randomIntBetween(0, 13)),
ReservedRolesStore.LISTS_ITEMS_INDEX + randomAlphaOfLength(randomIntBetween(0, 13)),
ReservedRolesStore.LISTS_ITEMS_INDEX_REINDEXED_V8 + randomAlphaOfLength(randomIntBetween(0, 13)),
".slo-observability." + randomAlphaOfLength(randomIntBetween(0, 13))
).forEach(index -> assertAllIndicesAccessAllowed(kibanaRole, index));

Expand Down

0 comments on commit 46ec08f

Please sign in to comment.