Skip to content

Commit 64b3e33

Browse files
joeypoonrjernst
authored andcommitted
Add .security-workflow-insights perms for kibana_system (elastic#116485)
Adds auto_configure, read, write, and create_index permissions for the new .security-workflows-insights-* index. This index is created and used internally by Kibana.
1 parent fe1632f commit 64b3e33

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/store/KibanaOwnedReservedRoleDescriptors.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,22 @@ static RoleDescriptor kibanaSystem(String name) {
484484
// Endpoint heartbeat. Kibana reads from these to determine metering/billing for
485485
// endpoints.
486486
RoleDescriptor.IndicesPrivileges.builder().indices(".logs-endpoint.heartbeat-*").privileges("read", "create_index").build(),
487+
// Security Solution workflows insights. Kibana creates, manages, and uses these
488+
// to provide users with insights on potential configuration improvements
489+
RoleDescriptor.IndicesPrivileges.builder()
490+
.indices(".edr-workflow-insights-*")
491+
.privileges(
492+
"create_index",
493+
"auto_configure",
494+
"manage",
495+
"read",
496+
"write",
497+
"delete",
498+
TransportUpdateSettingsAction.TYPE.name(),
499+
TransportPutMappingAction.TYPE.name(),
500+
RolloverAction.NAME
501+
)
502+
.build(),
487503
// For connectors telemetry. Will be removed once we switched to connectors API
488504
RoleDescriptor.IndicesPrivileges.builder().indices(".elastic-connectors*").privileges("read").build() },
489505
null,

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStoreTests.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,6 +1106,28 @@ public void testKibanaSystemRole() {
11061106
assertThat(kibanaRole.indices().allowedIndicesMatcher(RolloverAction.NAME).test(indexAbstraction), is(true));
11071107
});
11081108

1109+
// index for Security Solution workflow insights
1110+
Arrays.asList(".edr-workflow-insights-" + randomAlphaOfLength(randomIntBetween(0, 13))).forEach((index) -> {
1111+
final IndexAbstraction indexAbstraction = mockIndexAbstraction(index);
1112+
assertThat(kibanaRole.indices().allowedIndicesMatcher("indices:foo").test(indexAbstraction), is(false));
1113+
assertThat(kibanaRole.indices().allowedIndicesMatcher("indices:bar").test(indexAbstraction), is(false));
1114+
assertThat(kibanaRole.indices().allowedIndicesMatcher(TransportDeleteIndexAction.TYPE.name()).test(indexAbstraction), is(true));
1115+
assertThat(kibanaRole.indices().allowedIndicesMatcher(GetIndexAction.NAME).test(indexAbstraction), is(true));
1116+
assertThat(kibanaRole.indices().allowedIndicesMatcher(TransportCreateIndexAction.TYPE.name()).test(indexAbstraction), is(true));
1117+
assertThat(kibanaRole.indices().allowedIndicesMatcher(TransportIndexAction.NAME).test(indexAbstraction), is(true));
1118+
assertThat(kibanaRole.indices().allowedIndicesMatcher(TransportDeleteAction.NAME).test(indexAbstraction), is(true));
1119+
assertThat(kibanaRole.indices().allowedIndicesMatcher(TransportSearchAction.TYPE.name()).test(indexAbstraction), is(true));
1120+
assertThat(kibanaRole.indices().allowedIndicesMatcher(TransportMultiSearchAction.TYPE.name()).test(indexAbstraction), is(true));
1121+
assertThat(kibanaRole.indices().allowedIndicesMatcher(TransportGetAction.TYPE.name()).test(indexAbstraction), is(true));
1122+
assertThat(kibanaRole.indices().allowedIndicesMatcher(READ_CROSS_CLUSTER_NAME).test(indexAbstraction), is(false));
1123+
assertThat(
1124+
kibanaRole.indices().allowedIndicesMatcher(TransportUpdateSettingsAction.TYPE.name()).test(indexAbstraction),
1125+
is(true)
1126+
);
1127+
assertThat(kibanaRole.indices().allowedIndicesMatcher(TransportPutMappingAction.TYPE.name()).test(indexAbstraction), is(true));
1128+
assertThat(kibanaRole.indices().allowedIndicesMatcher(RolloverAction.NAME).test(indexAbstraction), is(true));
1129+
});
1130+
11091131
// Data telemetry reads mappings, metadata and stats of indices
11101132
Arrays.asList(randomAlphaOfLengthBetween(8, 24), "packetbeat-*").forEach((index) -> {
11111133
logger.info("index name [{}]", index);

0 commit comments

Comments
 (0)