Skip to content

Commit 3220179

Browse files
committed
Grants kibana_system full access to entities index
Modifies the reserved role descriptor to allow all privileges on the entities index. Adds a test to verify that the entities index has all access allowed.
1 parent 29f5db1 commit 3220179

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ static RoleDescriptor kibanaSystem(String name) {
547547
.indices(".asset-criticality.asset-criticality-*")
548548
.privileges("create_index", "manage", "read", "write")
549549
.build(),
550-
RoleDescriptor.IndicesPrivileges.builder().indices(".entities.v1.latest.security*").privileges("read").build(),
550+
RoleDescriptor.IndicesPrivileges.builder().indices(".entities.v1.latest.security*").privileges("all").build(),
551551
// For cloud_defend usageCollection
552552
RoleDescriptor.IndicesPrivileges.builder()
553553
.indices("logs-cloud_defend.*", "metrics-cloud_defend.*")

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1851,6 +1851,9 @@ public void testKibanaSystemRole() {
18511851
assertViewIndexMetadata(kibanaRole, indexName);
18521852
});
18531853

1854+
Array.asList(".entities.v1.latest.security_" + randomAlphaOfLength(randomIntBetween(0, 13)))
1855+
.forEach(indexName -> assertAllIndicesAccessAllowed(kibanaRole, indexName));
1856+
18541857
Arrays.asList("metrics-logstash." + randomAlphaOfLength(randomIntBetween(0, 13))).forEach((indexName) -> {
18551858
final IndexAbstraction indexAbstraction = mockIndexAbstraction(indexName);
18561859
assertThat(kibanaRole.indices().allowedIndicesMatcher("indices:foo").test(indexAbstraction), is(false));

0 commit comments

Comments
 (0)