Skip to content

Commit dd02f74

Browse files
ymao1ersin-erdal
andauthored
Allow kibana_system user to manage .reindexed-v8-internal.alerts indices (#118959)
* 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 cd2ee4c commit dd02f74

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
@@ -236,7 +236,10 @@ static RoleDescriptor kibanaSystem(String name) {
236236
// Observability, etc.
237237
// Kibana system user creates these indices; reads / writes to them via the
238238
// aliases (see below).
239-
RoleDescriptor.IndicesPrivileges.builder().indices(ReservedRolesStore.ALERTS_BACKING_INDEX).privileges("all").build(),
239+
RoleDescriptor.IndicesPrivileges.builder()
240+
.indices(ReservedRolesStore.ALERTS_BACKING_INDEX, ReservedRolesStore.ALERTS_BACKING_INDEX_REINDEXED)
241+
.privileges("all")
242+
.build(),
240243
// "Alerts as data" public index aliases used in Security Solution,
241244
// Observability, etc.
242245
// Kibana system user uses them to read / write alerts.
@@ -248,7 +251,7 @@ static RoleDescriptor kibanaSystem(String name) {
248251
// Kibana system user creates these indices; reads / writes to them via the
249252
// aliases (see below).
250253
RoleDescriptor.IndicesPrivileges.builder()
251-
.indices(ReservedRolesStore.PREVIEW_ALERTS_BACKING_INDEX_ALIAS)
254+
.indices(ReservedRolesStore.PREVIEW_ALERTS_BACKING_INDEX, ReservedRolesStore.PREVIEW_ALERTS_BACKING_INDEX_REINDEXED)
252255
.privileges("all")
253256
.build(),
254257
// 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
@@ -46,6 +46,7 @@ public class ReservedRolesStore implements BiConsumer<Set<String>, ActionListene
4646

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

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

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

5961
/** "Security Solutions" only lists index for value lists for detections */
6062
public static final String LISTS_INDEX = ".lists-*";
@@ -885,8 +887,10 @@ private static RoleDescriptor buildEditorRoleDescriptor() {
885887
RoleDescriptor.IndicesPrivileges.builder()
886888
.indices(
887889
ReservedRolesStore.ALERTS_BACKING_INDEX,
890+
ReservedRolesStore.ALERTS_BACKING_INDEX_REINDEXED,
888891
ReservedRolesStore.ALERTS_INDEX_ALIAS,
889-
ReservedRolesStore.PREVIEW_ALERTS_BACKING_INDEX_ALIAS,
892+
ReservedRolesStore.PREVIEW_ALERTS_BACKING_INDEX,
893+
ReservedRolesStore.PREVIEW_ALERTS_BACKING_INDEX_REINDEXED,
890894
ReservedRolesStore.PREVIEW_ALERTS_INDEX_ALIAS
891895
)
892896
.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)