Skip to content

Commit 2e9ff9a

Browse files
[Cloud Security]Fix Cloud Security Package indices' deletion step error for ilm policy (#116982)
* add ilm deletion step permission for the findings index * add back logs-endpoint index * fix tests for reserved role * fix linting issue
1 parent ec66857 commit 2e9ff9a

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,8 @@ static RoleDescriptor kibanaSystem(String name) {
331331
".logs-endpoint.diagnostic.collection-*",
332332
"logs-apm-*",
333333
"logs-apm.*-*",
334+
"logs-cloud_security_posture.findings-*",
335+
"logs-cloud_security_posture.vulnerabilities-*",
334336
"metrics-apm-*",
335337
"metrics-apm.*-*",
336338
"traces-apm-*",

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

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1586,10 +1586,8 @@ public void testKibanaSystemRole() {
15861586
final IndexAbstraction indexAbstraction = mockIndexAbstraction(cspIndex);
15871587
assertThat(kibanaRole.indices().allowedIndicesMatcher("indices:foo").test(indexAbstraction), is(false));
15881588
assertThat(kibanaRole.indices().allowedIndicesMatcher("indices:bar").test(indexAbstraction), is(false));
1589-
assertThat(
1590-
kibanaRole.indices().allowedIndicesMatcher(TransportDeleteIndexAction.TYPE.name()).test(indexAbstraction),
1591-
is(false)
1592-
);
1589+
// Ensure privileges necessary for ILM policies in Cloud Security Posture Package
1590+
assertThat(kibanaRole.indices().allowedIndicesMatcher(TransportDeleteIndexAction.TYPE.name()).test(indexAbstraction), is(true));
15931591
assertThat(kibanaRole.indices().allowedIndicesMatcher(GetIndexAction.NAME).test(indexAbstraction), is(true));
15941592
assertThat(
15951593
kibanaRole.indices().allowedIndicesMatcher(TransportCreateIndexAction.TYPE.name()).test(indexAbstraction),
@@ -1613,10 +1611,9 @@ public void testKibanaSystemRole() {
16131611
final IndexAbstraction indexAbstraction = mockIndexAbstraction(cspIndex);
16141612
assertThat(kibanaRole.indices().allowedIndicesMatcher("indices:foo").test(indexAbstraction), is(false));
16151613
assertThat(kibanaRole.indices().allowedIndicesMatcher("indices:bar").test(indexAbstraction), is(false));
1616-
assertThat(
1617-
kibanaRole.indices().allowedIndicesMatcher(TransportDeleteIndexAction.TYPE.name()).test(indexAbstraction),
1618-
is(false)
1619-
);
1614+
// Ensure privileges necessary for ILM policies in Cloud Security Posture Package
1615+
assertThat(kibanaRole.indices().allowedIndicesMatcher(TransportDeleteIndexAction.TYPE.name()).test(indexAbstraction), is(true));
1616+
assertThat(kibanaRole.indices().allowedIndicesMatcher(TransportDeleteIndexAction.TYPE.name()).test(indexAbstraction), is(true));
16201617
assertThat(kibanaRole.indices().allowedIndicesMatcher(GetIndexAction.NAME).test(indexAbstraction), is(true));
16211618
assertThat(
16221619
kibanaRole.indices().allowedIndicesMatcher(TransportCreateIndexAction.TYPE.name()).test(indexAbstraction),
@@ -1710,6 +1707,7 @@ public void testKibanaSystemRole() {
17101707
kibanaRole.indices().allowedIndicesMatcher("indices:monitor/" + randomAlphaOfLengthBetween(3, 8)).test(indexAbstraction),
17111708
is(true)
17121709
);
1710+
17131711
});
17141712

17151713
// cloud_defend

0 commit comments

Comments
 (0)