Skip to content

Commit

Permalink
Grants kibana_system reserved role access to .preview.alerts* index (e…
Browse files Browse the repository at this point in the history
  • Loading branch information
dplumlee authored and ywangd committed Nov 18, 2021
1 parent f0c7ea6 commit c122c74
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public class ReservedRolesStore implements BiConsumer<Set<String>, ActionListene
public static final String ALERTS_LEGACY_INDEX = ".siem-signals*";
public static final String ALERTS_BACKING_INDEX = ".internal.alerts*";
public static final String ALERTS_INDEX_ALIAS = ".alerts*";
public static final String PREVIEW_ALERTS_INDEX_ALIAS = ".preview.alerts*";

public static final RoleDescriptor SUPERUSER_ROLE_DESCRIPTOR = new RoleDescriptor(
"superuser",
Expand Down Expand Up @@ -674,6 +675,9 @@ public static RoleDescriptor kibanaSystemRoleDescriptor(String name) {
// "Alerts as data" public index aliases used in Security Solution, Observability, etc.
// Kibana system user uses them to read / write alerts.
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.PREVIEW_ALERTS_INDEX_ALIAS).privileges("all").build(),
// Endpoint / Fleet policy responses. Kibana requires read access to send telemetry
RoleDescriptor.IndicesPrivileges.builder().indices("metrics-endpoint.policy-*").privileges("read").build(),
// Endpoint metrics. Kibana requires read access to send telemetry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,8 @@ public void testKibanaSystemRole() {
".apm-custom-link",
ReservedRolesStore.ALERTS_LEGACY_INDEX + randomAlphaOfLength(randomIntBetween(0, 13)),
ReservedRolesStore.ALERTS_BACKING_INDEX + randomAlphaOfLength(randomIntBetween(0, 13)),
ReservedRolesStore.ALERTS_INDEX_ALIAS + randomAlphaOfLength(randomIntBetween(0, 13))
ReservedRolesStore.ALERTS_INDEX_ALIAS + randomAlphaOfLength(randomIntBetween(0, 13)),
ReservedRolesStore.PREVIEW_ALERTS_INDEX_ALIAS + randomAlphaOfLength(randomIntBetween(0, 13))
).forEach(index -> assertAllIndicesAccessAllowed(kibanaRole, index));

// read-only index access, including cross cluster
Expand Down

0 comments on commit c122c74

Please sign in to comment.