Skip to content

Commit 4dd1b87

Browse files
ymao1ersin-erdal
andauthored
Allow kibana_system user to manage .reindexed-v8-internal.alerts indices (#118959) (#119461)
* Adding reindexed alerts as data backing index prefixes * Update docs/changelog/118959.yaml * Update docs/changelog/118959.yaml --------- Co-authored-by: Ersin Erdal <[email protected]>
1 parent 03f5ba3 commit 4dd1b87

File tree

4 files changed

+19
-5
lines changed

4 files changed

+19
-5
lines changed

docs/changelog/118959.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 118959
2+
summary: Allow kibana_system user to manage .reindexed-v8-internal.alerts indices
3+
area: Authorization
4+
type: enhancement
5+
issues: []

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,10 @@ static RoleDescriptor kibanaSystem(String name) {
233233
// Observability, etc.
234234
// Kibana system user creates these indices; reads / writes to them via the
235235
// aliases (see below).
236-
RoleDescriptor.IndicesPrivileges.builder().indices(ReservedRolesStore.ALERTS_BACKING_INDEX).privileges("all").build(),
236+
RoleDescriptor.IndicesPrivileges.builder()
237+
.indices(ReservedRolesStore.ALERTS_BACKING_INDEX, ReservedRolesStore.ALERTS_BACKING_INDEX_REINDEXED)
238+
.privileges("all")
239+
.build(),
237240
// "Alerts as data" public index aliases used in Security Solution,
238241
// Observability, etc.
239242
// Kibana system user uses them to read / write alerts.
@@ -245,7 +248,7 @@ static RoleDescriptor kibanaSystem(String name) {
245248
// Kibana system user creates these indices; reads / writes to them via the
246249
// aliases (see below).
247250
RoleDescriptor.IndicesPrivileges.builder()
248-
.indices(ReservedRolesStore.PREVIEW_ALERTS_BACKING_INDEX_ALIAS)
251+
.indices(ReservedRolesStore.PREVIEW_ALERTS_BACKING_INDEX, ReservedRolesStore.PREVIEW_ALERTS_BACKING_INDEX_REINDEXED)
249252
.privileges("all")
250253
.build(),
251254
// Endpoint / Fleet policy responses. Kibana requires read access to send

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public class ReservedRolesStore implements BiConsumer<Set<String>, ActionListene
4747

4848
/** Alerts, Rules, Cases (RAC) index used by multiple solutions */
4949
public static final String ALERTS_BACKING_INDEX = ".internal.alerts*";
50+
public static final String ALERTS_BACKING_INDEX_REINDEXED = ".reindexed-v8-internal.alerts*";
5051

5152
/** Alerts, Rules, Cases (RAC) index used by multiple solutions */
5253
public static final String ALERTS_INDEX_ALIAS = ".alerts*";
@@ -55,7 +56,8 @@ public class ReservedRolesStore implements BiConsumer<Set<String>, ActionListene
5556
public static final String PREVIEW_ALERTS_INDEX_ALIAS = ".preview.alerts*";
5657

5758
/** Alerts, Rules, Cases (RAC) preview index used by multiple solutions */
58-
public static final String PREVIEW_ALERTS_BACKING_INDEX_ALIAS = ".internal.preview.alerts*";
59+
public static final String PREVIEW_ALERTS_BACKING_INDEX = ".internal.preview.alerts*";
60+
public static final String PREVIEW_ALERTS_BACKING_INDEX_REINDEXED = ".reindexed-v8-internal.preview.alerts*";
5961

6062
/** "Security Solutions" only lists index for value lists for detections */
6163
public static final String LISTS_INDEX = ".lists-*";
@@ -933,8 +935,10 @@ private static RoleDescriptor buildEditorRoleDescriptor() {
933935
RoleDescriptor.IndicesPrivileges.builder()
934936
.indices(
935937
ReservedRolesStore.ALERTS_BACKING_INDEX,
938+
ReservedRolesStore.ALERTS_BACKING_INDEX_REINDEXED,
936939
ReservedRolesStore.ALERTS_INDEX_ALIAS,
937-
ReservedRolesStore.PREVIEW_ALERTS_BACKING_INDEX_ALIAS,
940+
ReservedRolesStore.PREVIEW_ALERTS_BACKING_INDEX,
941+
ReservedRolesStore.PREVIEW_ALERTS_BACKING_INDEX_REINDEXED,
938942
ReservedRolesStore.PREVIEW_ALERTS_INDEX_ALIAS
939943
)
940944
.privileges("read", "view_index_metadata", "write", "maintenance")

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,9 +614,11 @@ public void testKibanaSystemRole() {
614614
".apm-source-map",
615615
ReservedRolesStore.ALERTS_LEGACY_INDEX + randomAlphaOfLength(randomIntBetween(0, 13)),
616616
ReservedRolesStore.ALERTS_BACKING_INDEX + randomAlphaOfLength(randomIntBetween(0, 13)),
617+
ReservedRolesStore.ALERTS_BACKING_INDEX_REINDEXED + randomAlphaOfLength(randomIntBetween(0, 13)),
617618
ReservedRolesStore.ALERTS_INDEX_ALIAS + randomAlphaOfLength(randomIntBetween(0, 13)),
618619
ReservedRolesStore.PREVIEW_ALERTS_INDEX_ALIAS + randomAlphaOfLength(randomIntBetween(0, 13)),
619-
ReservedRolesStore.PREVIEW_ALERTS_BACKING_INDEX_ALIAS + randomAlphaOfLength(randomIntBetween(0, 13)),
620+
ReservedRolesStore.PREVIEW_ALERTS_BACKING_INDEX + randomAlphaOfLength(randomIntBetween(0, 13)),
621+
ReservedRolesStore.PREVIEW_ALERTS_BACKING_INDEX_REINDEXED + randomAlphaOfLength(randomIntBetween(0, 13)),
620622
ReservedRolesStore.LISTS_INDEX + randomAlphaOfLength(randomIntBetween(0, 13)),
621623
ReservedRolesStore.LISTS_ITEMS_INDEX + randomAlphaOfLength(randomIntBetween(0, 13)),
622624
".slo-observability." + randomAlphaOfLength(randomIntBetween(0, 13))

0 commit comments

Comments
 (0)