Skip to content

Commit 85ce1c7

Browse files
authored
Give kibana user privileges to create APM agent config index (#46765) (#46793)
* Give kibana user reserved role privileges on .apm-* to create APM agent configuration index. * fixed test to include checking all .apm-* permissions * changed pattern from ".apm-*" to the more specific ".apm-agent-configuration"
1 parent 84859b2 commit 85ce1c7

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ private static Map<String, RoleDescriptor> initializeReservedRoles() {
123123
// .code_internal-* is for Code's internal worker queue index creation.
124124
RoleDescriptor.IndicesPrivileges.builder()
125125
.indices(".code-*", ".code_internal-*").privileges("all").build(),
126+
// .apm-* is for APM's agent configuration index creation
127+
RoleDescriptor.IndicesPrivileges.builder()
128+
.indices(".apm-agent-configuration").privileges("all").build(),
126129
},
127130
null,
128131
new ConfigurableClusterPrivilege[] { new ManageApplicationPrivileges(Collections.singleton("kibana-*")) },

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,12 @@ public void testKibanaSystemRole() {
334334
assertThat(kibanaRole.indices().allowedIndicesMatcher(IndexAction.NAME).test(".reporting"), is(false));
335335
assertThat(kibanaRole.indices().allowedIndicesMatcher("indices:foo").test(randomAlphaOfLengthBetween(8, 24)), is(false));
336336

337-
Arrays.asList(".kibana", ".kibana-devnull", ".reporting-" + randomAlphaOfLength(randomIntBetween(0, 13))).forEach((index) -> {
337+
Arrays.asList(
338+
".kibana",
339+
".kibana-devnull",
340+
".reporting-" + randomAlphaOfLength(randomIntBetween(0, 13)),
341+
".apm-agent-configuration"
342+
).forEach((index) -> {
338343
logger.info("index name [{}]", index);
339344
assertThat(kibanaRole.indices().allowedIndicesMatcher("indices:foo").test(index), is(true));
340345
assertThat(kibanaRole.indices().allowedIndicesMatcher("indices:bar").test(index), is(true));

0 commit comments

Comments
 (0)