Skip to content

Granting kibana_system reserved role access to "all" privileges to .adhoc.alerts* and .internal.adhoc.alerts* indices #127321

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Jun 3, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
6 changes: 6 additions & 0 deletions docs/changelog/127321.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 127321
summary: Granting `kibana_system` reserved role access to "all" privileges to `.adhoc.alerts*`
and `.internal.adhoc.alerts*` indices
area: Authorization
type: enhancement
issues: []
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,12 @@ static RoleDescriptor kibanaSystem(String name) {
RoleDescriptor.IndicesPrivileges.builder().indices(ReservedRolesStore.ALERTS_INDEX_ALIAS).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()
.indices(ReservedRolesStore.ADHOC_ALERTS_BACKING_INDEX, ReservedRolesStore.ADHOC_ALERTS_INDEX_ALIAS)
.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().indices(ReservedRolesStore.PREVIEW_ALERTS_INDEX_ALIAS).privileges("all").build(),
// "Alerts as data" internal backing indices used in Security Solution
// Kibana system user creates these indices; reads / writes to them via the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ public class ReservedRolesStore implements BiConsumer<Set<String>, ActionListene
public static final String PREVIEW_ALERTS_BACKING_INDEX = ".internal.preview.alerts*";
public static final String PREVIEW_ALERTS_BACKING_INDEX_REINDEXED = ".reindexed-v8-internal.preview.alerts*";

/** "Attack Discovery" ad-hoc alerts index */
public static final String ADHOC_ALERTS_INDEX_ALIAS = ".adhoc.alerts*";
public static final String ADHOC_ALERTS_BACKING_INDEX = ".internal.adhoc.alerts*";

/** "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-*";
Expand Down Expand Up @@ -782,7 +786,11 @@ private static RoleDescriptor buildViewerRoleDescriptor() {
.build(),
// Alerts-as-data
RoleDescriptor.IndicesPrivileges.builder()
.indices(ReservedRolesStore.ALERTS_INDEX_ALIAS, ReservedRolesStore.PREVIEW_ALERTS_INDEX_ALIAS)
.indices(
ReservedRolesStore.ALERTS_INDEX_ALIAS,
ReservedRolesStore.PREVIEW_ALERTS_INDEX_ALIAS,
ReservedRolesStore.ADHOC_ALERTS_INDEX_ALIAS
)
.privileges("read", "view_index_metadata")
.build(),
// Universal Profiling
Expand Down Expand Up @@ -846,7 +854,9 @@ private static RoleDescriptor buildEditorRoleDescriptor() {
ReservedRolesStore.ALERTS_INDEX_ALIAS,
ReservedRolesStore.PREVIEW_ALERTS_BACKING_INDEX,
ReservedRolesStore.PREVIEW_ALERTS_BACKING_INDEX_REINDEXED,
ReservedRolesStore.PREVIEW_ALERTS_INDEX_ALIAS
ReservedRolesStore.PREVIEW_ALERTS_INDEX_ALIAS,
ReservedRolesStore.ADHOC_ALERTS_BACKING_INDEX,
ReservedRolesStore.ADHOC_ALERTS_INDEX_ALIAS
)
.privileges("read", "view_index_metadata", "write", "maintenance")
.build(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,8 @@ public void testKibanaSystemRole() {
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.ADHOC_ALERTS_INDEX_ALIAS + randomAlphaOfLength(randomIntBetween(0, 13)),
ReservedRolesStore.ADHOC_ALERTS_BACKING_INDEX + 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)),
Expand Down
Loading