@@ -801,7 +801,7 @@ public void testKibanaSystemRole() {
801801 assertThat (kibanaRole .indices ().allowedIndicesMatcher (GetIndexAction .NAME ).test (mockIndexAbstraction (index )), is (true ));
802802 assertThat (
803803 kibanaRole .indices ().allowedIndicesMatcher (TransportCreateIndexAction .TYPE .name ()).test (mockIndexAbstraction (index )),
804- is (false )
804+ is (true )
805805 );
806806 assertThat (kibanaRole .indices ().allowedIndicesMatcher (TransportIndexAction .NAME ).test (mockIndexAbstraction (index )), is (false ));
807807 assertThat (kibanaRole .indices ().allowedIndicesMatcher (TransportDeleteAction .NAME ).test (mockIndexAbstraction (index )), is (false ));
@@ -949,7 +949,7 @@ public void testKibanaSystemRole() {
949949 );
950950 });
951951
952- // read-only index for Endpoint and Osquery manager specific action responses
952+ // Elastic Defend internal index for response actions results
953953 Arrays .asList (".logs-endpoint.action.responses-" + randomAlphaOfLength (randomIntBetween (0 , 13 ))).forEach ((index ) -> {
954954 final IndexAbstraction indexAbstraction = mockIndexAbstraction (index );
955955 assertThat (kibanaRole .indices ().allowedIndicesMatcher ("indices:foo" ).test (indexAbstraction ), is (false ));
@@ -959,10 +959,7 @@ public void testKibanaSystemRole() {
959959 is (false )
960960 );
961961 assertThat (kibanaRole .indices ().allowedIndicesMatcher (GetIndexAction .NAME ).test (indexAbstraction ), is (true ));
962- assertThat (
963- kibanaRole .indices ().allowedIndicesMatcher (TransportCreateIndexAction .TYPE .name ()).test (indexAbstraction ),
964- is (false )
965- );
962+ assertThat (kibanaRole .indices ().allowedIndicesMatcher (TransportCreateIndexAction .TYPE .name ()).test (indexAbstraction ), is (true ));
966963 assertThat (kibanaRole .indices ().allowedIndicesMatcher (TransportIndexAction .NAME ).test (indexAbstraction ), is (true ));
967964 assertThat (kibanaRole .indices ().allowedIndicesMatcher (TransportDeleteAction .NAME ).test (indexAbstraction ), is (true ));
968965 assertThat (kibanaRole .indices ().allowedIndicesMatcher (TransportSearchAction .TYPE .name ()).test (indexAbstraction ), is (true ));
@@ -1069,10 +1066,7 @@ public void testKibanaSystemRole() {
10691066 is (false )
10701067 );
10711068 assertThat (kibanaRole .indices ().allowedIndicesMatcher (GetIndexAction .NAME ).test (indexAbstraction ), is (true ));
1072- assertThat (
1073- kibanaRole .indices ().allowedIndicesMatcher (TransportCreateIndexAction .TYPE .name ()).test (indexAbstraction ),
1074- is (false )
1075- );
1069+ assertThat (kibanaRole .indices ().allowedIndicesMatcher (TransportCreateIndexAction .TYPE .name ()).test (indexAbstraction ), is (true ));
10761070 assertThat (kibanaRole .indices ().allowedIndicesMatcher (TransportIndexAction .NAME ).test (indexAbstraction ), is (true ));
10771071 assertThat (kibanaRole .indices ().allowedIndicesMatcher (TransportDeleteAction .NAME ).test (indexAbstraction ), is (true ));
10781072 assertThat (kibanaRole .indices ().allowedIndicesMatcher (TransportSearchAction .TYPE .name ()).test (indexAbstraction ), is (true ));
@@ -1097,10 +1091,7 @@ public void testKibanaSystemRole() {
10971091 is (false )
10981092 );
10991093 assertThat (kibanaRole .indices ().allowedIndicesMatcher (GetIndexAction .NAME ).test (indexAbstraction ), is (true ));
1100- assertThat (
1101- kibanaRole .indices ().allowedIndicesMatcher (TransportCreateIndexAction .TYPE .name ()).test (indexAbstraction ),
1102- is (false )
1103- );
1094+ assertThat (kibanaRole .indices ().allowedIndicesMatcher (TransportCreateIndexAction .TYPE .name ()).test (indexAbstraction ), is (true ));
11041095 assertThat (kibanaRole .indices ().allowedIndicesMatcher (TransportIndexAction .NAME ).test (indexAbstraction ), is (false ));
11051096 assertThat (kibanaRole .indices ().allowedIndicesMatcher (TransportDeleteAction .NAME ).test (indexAbstraction ), is (false ));
11061097 assertThat (kibanaRole .indices ().allowedIndicesMatcher (TransportSearchAction .TYPE .name ()).test (indexAbstraction ), is (true ));
@@ -1319,12 +1310,21 @@ public void testKibanaSystemRole() {
13191310
13201311 final boolean isAlsoAutoCreateIndex = indexName .startsWith (".logs-endpoint.actions-" )
13211312 || indexName .startsWith (".logs-endpoint.action.responses-" );
1313+
1314+ final boolean isAlsoCreateIndex = indexName .startsWith (".logs-endpoint.actions-" )
1315+ || indexName .startsWith (".logs-endpoint.action.responses-" )
1316+ || indexName .startsWith (".logs-endpoint.diagnostic.collection-" )
1317+ || indexName .startsWith (".logs-endpoint.heartbeat-" );
1318+
13221319 assertThat (
13231320 kibanaRole .indices ().allowedIndicesMatcher (TransportCreateIndexAction .TYPE .name ()).test (indexAbstraction ),
1324- is (false )
1321+ is (isAlsoCreateIndex )
1322+ );
1323+ assertThat (kibanaRole .indices ().allowedIndicesMatcher (AutoCreateAction .NAME ).test (indexAbstraction ), is (isAlsoCreateIndex ));
1324+ assertThat (
1325+ kibanaRole .indices ().allowedIndicesMatcher (CreateDataStreamAction .NAME ).test (indexAbstraction ),
1326+ is (isAlsoCreateIndex )
13251327 );
1326- assertThat (kibanaRole .indices ().allowedIndicesMatcher (AutoCreateAction .NAME ).test (indexAbstraction ), is (isAlsoAutoCreateIndex ));
1327- assertThat (kibanaRole .indices ().allowedIndicesMatcher (CreateDataStreamAction .NAME ).test (indexAbstraction ), is (false ));
13281328 assertThat (
13291329 kibanaRole .indices ().allowedIndicesMatcher (TransportIndexAction .NAME ).test (indexAbstraction ),
13301330 is (isAlsoAutoCreateIndex )
0 commit comments