@@ -1687,15 +1687,22 @@ public void testKibanaSystemRole() {
16871687 "logs-tenable_io.vulnerability-" + randomAlphaOfLength (randomIntBetween (0 , 13 )),
16881688 "logs-rapid7_insightvm.vulnerability-" + randomAlphaOfLength (randomIntBetween (0 , 13 )),
16891689 "logs-rapid7_insightvm.asset_vulnerability-" + randomAlphaOfLength (randomIntBetween (0 , 13 )),
1690- "logs-carbon_black_cloud.asset_vulnerability_summary-" + randomAlphaOfLength (randomIntBetween (0 , 13 ))
1690+ "logs-carbon_black_cloud.asset_vulnerability_summary-" + randomAlphaOfLength (randomIntBetween (0 , 13 )),
1691+ "logs-m365_defender.vulnerability-" + randomAlphaOfLength (randomIntBetween (0 , 13 )),
1692+ "logs-microsoft_defender_endpoint.vulnerability-" + randomAlphaOfLength (randomIntBetween (0 , 13 ))
16911693 ).forEach (indexName -> {
16921694 final IndexAbstraction indexAbstraction = mockIndexAbstraction (indexName );
16931695 assertThat (kibanaRole .indices ().allowedIndicesMatcher ("indices:foo" ).test (indexAbstraction ), is (false ));
16941696 assertThat (kibanaRole .indices ().allowedIndicesMatcher ("indices:bar" ).test (indexAbstraction ), is (false ));
1695- assertThat (
1696- kibanaRole .indices ().allowedIndicesMatcher (TransportDeleteIndexAction .TYPE .name ()).test (indexAbstraction ),
1697- is (false )
1698- );
1697+ if (indexAbstraction .getName ().startsWith ("logs-m365_defender.vulnerability-" ) == false &&
1698+ indexAbstraction .getName ().startsWith ("logs-microsoft_defender_endpoint.vulnerability-" ) == false ) {
1699+ // delete_index is granted for m365_defender.vulnerability and microsoft_defender_endpoint.vulnerability
1700+ // because of ILM policy. So exclude both from this check.
1701+ assertThat (
1702+ kibanaRole .indices ().allowedIndicesMatcher (TransportDeleteIndexAction .TYPE .name ()).test (indexAbstraction ),
1703+ is (false )
1704+ );
1705+ }
16991706 assertThat (kibanaRole .indices ().allowedIndicesMatcher (GetIndexAction .NAME ).test (indexAbstraction ), is (true ));
17001707 assertThat (
17011708 kibanaRole .indices ().allowedIndicesMatcher (TransportCreateIndexAction .TYPE .name ()).test (indexAbstraction ),
@@ -1715,6 +1722,20 @@ public void testKibanaSystemRole() {
17151722 assertThat (kibanaRole .indices ().allowedIndicesMatcher (RolloverAction .NAME ).test (indexAbstraction ), is (true ));
17161723 });
17171724
1725+ Arrays .asList (
1726+ "logs-m365_defender.vulnerability-" + randomAlphaOfLength (randomIntBetween (0 , 13 )),
1727+ "logs-microsoft_defender_endpoint.vulnerability-" + randomAlphaOfLength (randomIntBetween (0 , 13 ))
1728+ ).forEach (indexName -> {
1729+ logger .info ("index name [{}]" , indexName );
1730+ final IndexAbstraction indexAbstraction = mockIndexAbstraction (indexName );
1731+ // Allow delete index
1732+ assertThat (kibanaRole .indices ().allowedIndicesMatcher (TransportDeleteIndexAction .TYPE .name ()).test (indexAbstraction ), is (true ));
1733+ // Implied by the overall view_index_metadata and monitor privilege
1734+ assertViewIndexMetadata (kibanaRole , indexName );
1735+ assertThat (kibanaRole .indices ().allowedIndicesMatcher ("indices:monitor/" ).test (indexAbstraction ), is (true ));
1736+
1737+ });
1738+
17181739 Arrays .asList (
17191740 "logs-cloud_security_posture.findings_latest-default" ,
17201741 "logs-cloud_security_posture.scores-default" ,
0 commit comments