Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions docs/changelog/100594.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 100594
summary: Grant editor and viewer access to profiling
area: Authorization
type: bug
issues: []
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ public class ReservedRolesStore implements BiConsumer<Set<String>, ActionListene
/** "Security Solutions" only lists index for value list items for detections */
public static final String LISTS_ITEMS_INDEX = ".items-*";

/** Index pattern for Universal Profiling */
public static final String UNIVERSAL_PROFILING_ALIASES = "profiling-*";
public static final String UNIVERSAL_PROFILING_BACKING_INDICES = ".profiling-*";

public static final RoleDescriptor SUPERUSER_ROLE_DESCRIPTOR = new RoleDescriptor(
"superuser",
new String[] { "all" },
Expand Down Expand Up @@ -641,6 +645,11 @@ private static RoleDescriptor buildViewerRoleDescriptor() {
RoleDescriptor.IndicesPrivileges.builder()
.indices(ReservedRolesStore.ALERTS_INDEX_ALIAS, ReservedRolesStore.PREVIEW_ALERTS_INDEX_ALIAS)
.privileges("read", "view_index_metadata")
.build(),
// Universal Profiling
RoleDescriptor.IndicesPrivileges.builder()
.indices(ReservedRolesStore.UNIVERSAL_PROFILING_ALIASES, ReservedRolesStore.UNIVERSAL_PROFILING_BACKING_INDICES)
.privileges("read", "view_index_metadata")
.build() },
new RoleDescriptor.ApplicationResourcePrivileges[] {
RoleDescriptor.ApplicationResourcePrivileges.builder()
Expand Down Expand Up @@ -684,6 +693,10 @@ private static RoleDescriptor buildEditorRoleDescriptor() {
ReservedRolesStore.PREVIEW_ALERTS_INDEX_ALIAS
)
.privileges("read", "view_index_metadata", "write", "maintenance")
.build(),
RoleDescriptor.IndicesPrivileges.builder()
.indices(ReservedRolesStore.UNIVERSAL_PROFILING_ALIASES, ReservedRolesStore.UNIVERSAL_PROFILING_BACKING_INDICES)
.privileges("read", "view_index_metadata")
.build() },
new RoleDescriptor.ApplicationResourcePrivileges[] {
RoleDescriptor.ApplicationResourcePrivileges.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3057,6 +3057,8 @@ public void testPredefinedViewerRole() {
assertOnlyReadAllowed(role, "packetbeat-" + randomIntBetween(0, 5));
assertOnlyReadAllowed(role, "winlogbeat-" + randomIntBetween(0, 5));
assertOnlyReadAllowed(role, "endgame-" + randomIntBetween(0, 5));
assertOnlyReadAllowed(role, "profiling-" + randomIntBetween(0, 5));
assertOnlyReadAllowed(role, ".profiling-" + randomIntBetween(0, 5));
assertOnlyReadAllowed(role, randomAlphaOfLength(5));

assertNoAccessAllowed(role, TestRestrictedIndices.SAMPLE_RESTRICTED_NAMES);
Expand Down Expand Up @@ -3124,6 +3126,8 @@ public void testPredefinedEditorRole() {
assertOnlyReadAllowed(role, "packetbeat-" + randomIntBetween(0, 5));
assertOnlyReadAllowed(role, "winlogbeat-" + randomIntBetween(0, 5));
assertOnlyReadAllowed(role, "endgame-" + randomIntBetween(0, 5));
assertOnlyReadAllowed(role, "profiling-" + randomIntBetween(0, 5));
assertOnlyReadAllowed(role, ".profiling-" + randomIntBetween(0, 5));
assertOnlyReadAllowed(role, randomAlphaOfLength(5));

assertReadWriteDocsAndMaintenanceButNotDeleteIndexAllowed(role, ".siem-signals-" + randomIntBetween(0, 5));
Expand Down