Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 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
6 changes: 6 additions & 0 deletions docs/changelog/129662.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 129662
summary: "[Security] Add entity store and asset criticality index privileges to built\
\ in Editor and Viewer roles"
area: Authorization
type: enhancement
issues: []
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ public class ReservedRolesStore implements BiConsumer<Set<String>, ActionListene
public static final String LISTS_ITEMS_INDEX = ".items-*";
public static final String LISTS_ITEMS_INDEX_REINDEXED_V8 = ".reindexed-v8-items-*";

/** "Security Solutions" Entity Store and Asset Criticality indices for Asset Inventory and Entity Analytics */
public static final String ENTITY_STORE_V1_LATEST_INDEX = ".entities.v1.latest.security_*";
public static final String ASSET_CRITICALITY_INDEX = ".asset-criticality.asset-criticality-*";

/** Index pattern for Universal Profiling */
public static final String UNIVERSAL_PROFILING_ALIASES = "profiling-*";
public static final String UNIVERSAL_PROFILING_BACKING_INDICES = ".profiling-*";
Expand Down Expand Up @@ -784,7 +788,9 @@ private static RoleDescriptor buildViewerRoleDescriptor() {
ReservedRolesStore.LISTS_ITEMS_INDEX,
ReservedRolesStore.ALERTS_LEGACY_INDEX_REINDEXED_V8,
ReservedRolesStore.LISTS_INDEX_REINDEXED_V8,
ReservedRolesStore.LISTS_ITEMS_INDEX_REINDEXED_V8
ReservedRolesStore.LISTS_ITEMS_INDEX_REINDEXED_V8,
ReservedRolesStore.ENTITY_STORE_V1_LATEST_INDEX,
ReservedRolesStore.ASSET_CRITICALITY_INDEX
)
.privileges("read", "view_index_metadata")
.build(),
Expand Down Expand Up @@ -846,10 +852,16 @@ private static RoleDescriptor buildEditorRoleDescriptor() {
ReservedRolesStore.LISTS_ITEMS_INDEX,
ReservedRolesStore.ALERTS_LEGACY_INDEX_REINDEXED_V8,
ReservedRolesStore.LISTS_INDEX_REINDEXED_V8,
ReservedRolesStore.LISTS_ITEMS_INDEX_REINDEXED_V8
ReservedRolesStore.LISTS_ITEMS_INDEX_REINDEXED_V8,
ReservedRolesStore.ASSET_CRITICALITY_INDEX
)
.privileges("read", "view_index_metadata", "write", "maintenance")
.build(),
// Security - Entity Store is view only
RoleDescriptor.IndicesPrivileges.builder()
.indices(ReservedRolesStore.ENTITY_STORE_V1_LATEST_INDEX)
.privileges("read", "view_index_metadata")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to double check - Serverless Editor appears to have write access to these indices - is this difference intentional?

Copy link
Contributor Author

@opauloh opauloh Jun 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for bringing it to my attention!

I will tag @hop-dev and @jaredburgettelastic to help on that. Mark / Jared, from what I could see, users don't really need to write directly into the Entity Store index, but do you happen to know a use case where they would need? Like running the API to clean the Entity Store or something else?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No I think this was a mistake in the original PR apologies!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for confirming @hop-dev, so @richard-dennehy, the changes on this PR are correct, we will follow up on reducing the extra permissions on Serverless editor role to keep it consistent!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@opauloh sorry I have just thought, because the transform runs as the user who enabled the entity store, I believe we do need write permissions? Have I got that wrong?

Copy link
Contributor Author

@opauloh opauloh Jul 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I initially thought the same, but it turns out the Transform API doesn't require write privilege.

Required authorization
Index privileges: create_index,read,index,view_index_metadata
Cluster privileges: manage_transform

I guess the rationale behind this is that users shouldn't be writing to the transform destination indices directly anyway?


That's also accurate with the Entity Store permission page. (No write access required to the .entities.v1.latest.* index)

Also, by design, Editors wouldn't have the "manage" privilege, so Editors users won't likely be the ones to enable Entity Store / Asset Inventory, unless extra permissions are granted:

I.e screenshot from the permissions screen when accessing the Entity Store with an Editor user:

image

However, editors should be able to read entity store data and update asset criticality once it's enabled.


The only use case I can imagine writing directly would be handy is, if we had to update data directly on the destination index using the user permission to update data without waiting for the transforms to run, however, I didn't find anything performing that operation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the detailed investigation, that's interesting about the transform write permissions! 👍

.build(),
// Alerts-as-data
RoleDescriptor.IndicesPrivileges.builder()
.indices(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3676,6 +3676,9 @@ public void testPredefinedViewerRole() {
assertOnlyReadAllowed(role, ".profiling-" + randomIntBetween(0, 5));
assertOnlyReadAllowed(role, randomAlphaOfLength(5));

assertOnlyReadAllowed(role, ".entities.v1.latest.security_" + randomIntBetween(0, 5));
assertOnlyReadAllowed(role, ".asset-criticality.asset-criticality-" + randomIntBetween(0, 5));

assertOnlyReadAllowed(role, ".slo-observability." + randomIntBetween(0, 5));
assertViewIndexMetadata(role, ".slo-observability." + randomIntBetween(0, 5));

Expand Down Expand Up @@ -3746,6 +3749,7 @@ public void testPredefinedEditorRole() {
assertOnlyReadAllowed(role, "endgame-" + randomIntBetween(0, 5));
assertOnlyReadAllowed(role, "profiling-" + randomIntBetween(0, 5));
assertOnlyReadAllowed(role, ".profiling-" + randomIntBetween(0, 5));
assertOnlyReadAllowed(role, ".entities.v1.latest.security_" + randomIntBetween(0, 5));
assertOnlyReadAllowed(role, randomAlphaOfLength(5));

assertReadWriteDocsAndMaintenanceButNotDeleteIndexAllowed(role, ".siem-signals-" + randomIntBetween(0, 5));
Expand All @@ -3756,6 +3760,7 @@ public void testPredefinedEditorRole() {
assertReadWriteDocsAndMaintenanceButNotDeleteIndexAllowed(role, ".internal.alerts-" + randomIntBetween(0, 5));
assertReadWriteDocsAndMaintenanceButNotDeleteIndexAllowed(role, ".preview.alerts-" + randomIntBetween(0, 5));
assertReadWriteDocsAndMaintenanceButNotDeleteIndexAllowed(role, ".internal.preview.alerts-" + randomIntBetween(0, 5));
assertReadWriteDocsAndMaintenanceButNotDeleteIndexAllowed(role, ".asset-criticality.asset-criticality-" + randomIntBetween(0, 5));

assertViewIndexMetadata(role, ".slo-observability." + randomIntBetween(0, 5));
assertReadWriteAndManage(role, ".slo-observability." + randomIntBetween(0, 5));
Expand Down