Skip to content

Commit 0ab59bb

Browse files
authored
[Security Solution] allows kibana_system user to manage .reindexed-v8-* Security Solution indices (#119054)
* [Security Solution] allows kibana_system user to manage reindexed Security Solution indices * fix code * Update docs/changelog/119054.yaml
1 parent 971a794 commit 0ab59bb

File tree

4 files changed

+38
-4
lines changed

4 files changed

+38
-4
lines changed

docs/changelog/119054.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 119054
2+
summary: "[Security Solution] allows `kibana_system` user to manage .reindexed-v8-*\
3+
\ Security Solution indices"
4+
area: Authorization
5+
type: enhancement
6+
issues: []

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/store/KibanaOwnedReservedRoleDescriptors.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,11 +225,19 @@ static RoleDescriptor kibanaSystem(String name) {
225225
RoleDescriptor.IndicesPrivileges.builder().indices("logs-fleet_server*").privileges("read", "delete_index").build(),
226226
// Legacy "Alerts as data" used in Security Solution.
227227
// Kibana user creates these indices; reads / writes to them.
228-
RoleDescriptor.IndicesPrivileges.builder().indices(ReservedRolesStore.ALERTS_LEGACY_INDEX).privileges("all").build(),
228+
RoleDescriptor.IndicesPrivileges.builder()
229+
.indices(ReservedRolesStore.ALERTS_LEGACY_INDEX, ReservedRolesStore.ALERTS_LEGACY_INDEX_REINDEXED_V8)
230+
.privileges("all")
231+
.build(),
229232
// Used in Security Solution for value lists.
230233
// Kibana user creates these indices; reads / writes to them.
231234
RoleDescriptor.IndicesPrivileges.builder()
232-
.indices(ReservedRolesStore.LISTS_INDEX, ReservedRolesStore.LISTS_ITEMS_INDEX)
235+
.indices(
236+
ReservedRolesStore.LISTS_INDEX,
237+
ReservedRolesStore.LISTS_ITEMS_INDEX,
238+
ReservedRolesStore.LISTS_INDEX_REINDEXED_V8,
239+
ReservedRolesStore.LISTS_ITEMS_INDEX_REINDEXED_V8
240+
)
233241
.privileges("all")
234242
.build(),
235243
// "Alerts as data" internal backing indices used in Security Solution,

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStore.java

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
public class ReservedRolesStore implements BiConsumer<Set<String>, ActionListener<RoleRetrievalResult>> {
4444
/** "Security Solutions" only legacy signals index */
4545
public static final String ALERTS_LEGACY_INDEX = ".siem-signals*";
46+
public static final String ALERTS_LEGACY_INDEX_REINDEXED_V8 = ".reindexed-v8-siem-signals*";
4647

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

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

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

6770
/** Index pattern for Universal Profiling */
6871
public static final String UNIVERSAL_PROFILING_ALIASES = "profiling-*";
@@ -829,7 +832,14 @@ private static RoleDescriptor buildViewerRoleDescriptor() {
829832
.build(),
830833
// Security
831834
RoleDescriptor.IndicesPrivileges.builder()
832-
.indices(ReservedRolesStore.ALERTS_LEGACY_INDEX, ReservedRolesStore.LISTS_INDEX, ReservedRolesStore.LISTS_ITEMS_INDEX)
835+
.indices(
836+
ReservedRolesStore.ALERTS_LEGACY_INDEX,
837+
ReservedRolesStore.LISTS_INDEX,
838+
ReservedRolesStore.LISTS_ITEMS_INDEX,
839+
ReservedRolesStore.ALERTS_LEGACY_INDEX_REINDEXED_V8,
840+
ReservedRolesStore.LISTS_INDEX_REINDEXED_V8,
841+
ReservedRolesStore.LISTS_ITEMS_INDEX_REINDEXED_V8
842+
)
833843
.privileges("read", "view_index_metadata")
834844
.build(),
835845
// Alerts-as-data
@@ -880,7 +890,14 @@ private static RoleDescriptor buildEditorRoleDescriptor() {
880890
.build(),
881891
// Security
882892
RoleDescriptor.IndicesPrivileges.builder()
883-
.indices(ReservedRolesStore.ALERTS_LEGACY_INDEX, ReservedRolesStore.LISTS_INDEX, ReservedRolesStore.LISTS_ITEMS_INDEX)
893+
.indices(
894+
ReservedRolesStore.ALERTS_LEGACY_INDEX,
895+
ReservedRolesStore.LISTS_INDEX,
896+
ReservedRolesStore.LISTS_ITEMS_INDEX,
897+
ReservedRolesStore.ALERTS_LEGACY_INDEX_REINDEXED_V8,
898+
ReservedRolesStore.LISTS_INDEX_REINDEXED_V8,
899+
ReservedRolesStore.LISTS_ITEMS_INDEX_REINDEXED_V8
900+
)
884901
.privileges("read", "view_index_metadata", "write", "maintenance")
885902
.build(),
886903
// Alerts-as-data

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStoreTests.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,14 +613,17 @@ public void testKibanaSystemRole() {
613613
".apm-custom-link",
614614
".apm-source-map",
615615
ReservedRolesStore.ALERTS_LEGACY_INDEX + randomAlphaOfLength(randomIntBetween(0, 13)),
616+
ReservedRolesStore.ALERTS_LEGACY_INDEX_REINDEXED_V8 + randomAlphaOfLength(randomIntBetween(0, 13)),
616617
ReservedRolesStore.ALERTS_BACKING_INDEX + randomAlphaOfLength(randomIntBetween(0, 13)),
617618
ReservedRolesStore.ALERTS_BACKING_INDEX_REINDEXED + randomAlphaOfLength(randomIntBetween(0, 13)),
618619
ReservedRolesStore.ALERTS_INDEX_ALIAS + randomAlphaOfLength(randomIntBetween(0, 13)),
619620
ReservedRolesStore.PREVIEW_ALERTS_INDEX_ALIAS + randomAlphaOfLength(randomIntBetween(0, 13)),
620621
ReservedRolesStore.PREVIEW_ALERTS_BACKING_INDEX + randomAlphaOfLength(randomIntBetween(0, 13)),
621622
ReservedRolesStore.PREVIEW_ALERTS_BACKING_INDEX_REINDEXED + randomAlphaOfLength(randomIntBetween(0, 13)),
622623
ReservedRolesStore.LISTS_INDEX + randomAlphaOfLength(randomIntBetween(0, 13)),
624+
ReservedRolesStore.LISTS_INDEX_REINDEXED_V8 + randomAlphaOfLength(randomIntBetween(0, 13)),
623625
ReservedRolesStore.LISTS_ITEMS_INDEX + randomAlphaOfLength(randomIntBetween(0, 13)),
626+
ReservedRolesStore.LISTS_ITEMS_INDEX_REINDEXED_V8 + randomAlphaOfLength(randomIntBetween(0, 13)),
624627
".slo-observability." + randomAlphaOfLength(randomIntBetween(0, 13))
625628
).forEach(index -> assertAllIndicesAccessAllowed(kibanaRole, index));
626629

0 commit comments

Comments
 (0)