Skip to content

Commit

Permalink
[Security Solution] Add proper permissions to fleet server for Endpoi…
Browse files Browse the repository at this point in the history
…nt response index (elastic#80238)

This PR adds the proper permissions for fleet server to create and write
documents to the .logs-endpoint.action.responses-* index. The Security
Endpoint, run by the Agent, streams action responses to this index which is
used by the Security app to determine if actions are complete, etc.

This was initially missed during testing because of using locally running fleet
servers that were given superuser permissions, hence bypassing the fleet server
user.

This PR adds the index to fleet server so that the Endpoint gets the key that
it needs to write to the index properly.

For more information, see this ticket: elastic/kibana#116715
  • Loading branch information
kevinlog authored and ywangd committed Nov 3, 2021
1 parent a786add commit f6c7822
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ GET /_security/service/elastic/fleet-server
"metrics-*",
"traces-*",
"synthetics-*",
".logs-endpoint.diagnostic.collection-*"
".logs-endpoint.diagnostic.collection-*",
".logs-endpoint.action.responses-*"
],
"privileges": [
"write",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ public class ServiceAccountIT extends ESRestTestCase {
+ " \"metrics-*\",\n"
+ " \"traces-*\",\n"
+ " \"synthetics-*\",\n"
+ " \".logs-endpoint.diagnostic.collection-*\"\n"
+ " \".logs-endpoint.diagnostic.collection-*\",\n"
+ " \".logs-endpoint.action.responses-*\"\n"
+ " ],\n"
+ " \"privileges\": [\n"
+ " \"write\",\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,14 @@ final class ElasticServiceAccounts {
new String[] { "monitor", "manage_own_api_key" },
new RoleDescriptor.IndicesPrivileges[] {
RoleDescriptor.IndicesPrivileges.builder()
.indices("logs-*", "metrics-*", "traces-*", "synthetics-*", ".logs-endpoint.diagnostic.collection-*")
.indices(
"logs-*",
"metrics-*",
"traces-*",
"synthetics-*",
".logs-endpoint.diagnostic.collection-*",
".logs-endpoint.action.responses-*"
)
.privileges("write", "create_index", "auto_configure")
.build(),
RoleDescriptor.IndicesPrivileges.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ public void testElasticFleetServerPrivileges() {
"metrics-" + randomAlphaOfLengthBetween(1, 20),
"traces-" + randomAlphaOfLengthBetween(1, 20),
"synthetics-" + randomAlphaOfLengthBetween(1, 20),
".logs-endpoint.diagnostic.collection-" + randomAlphaOfLengthBetween(1, 20)
".logs-endpoint.diagnostic.collection-" + randomAlphaOfLengthBetween(1, 20),
".logs-endpoint.action.responses-" + randomAlphaOfLengthBetween(1, 20)
).stream().map(this::mockIndexAbstraction).forEach(index -> {
assertThat(role.indices().allowedIndicesMatcher(AutoPutMappingAction.NAME).test(index), is(true));
assertThat(role.indices().allowedIndicesMatcher(AutoCreateAction.NAME).test(index), is(true));
Expand Down

0 comments on commit f6c7822

Please sign in to comment.