|
@@ -658,8 +658,11 @@ public class ReservedRolesStoreTests extends ESTestCase {
|
|
|
".fleet-servers"
|
|
|
).forEach(index -> assertAllIndicesAccessAllowed(kibanaRole, index));
|
|
|
|
|
|
- // read-only index for Endpoint specific action responses
|
|
|
- Arrays.asList(".logs-endpoint.action.responses-" + randomAlphaOfLength(randomIntBetween(0, 13))).forEach((index) -> {
|
|
|
+ // read-only index for Endpoint and Osquery manager specific action responses
|
|
|
+ Arrays.asList(
|
|
|
+ ".logs-endpoint.action.responses-" + randomAlphaOfLength(randomIntBetween(0, 13)),
|
|
|
+ ".logs-osquery_manager.action.responses-" + randomAlphaOfLength(randomIntBetween(0, 13))
|
|
|
+ ).forEach((index) -> {
|
|
|
final IndexAbstraction indexAbstraction = mockIndexAbstraction(index);
|
|
|
assertThat(kibanaRole.indices().allowedIndicesMatcher("indices:foo").test(indexAbstraction), is(false));
|
|
|
assertThat(kibanaRole.indices().allowedIndicesMatcher("indices:bar").test(indexAbstraction), is(false));
|
|
@@ -677,8 +680,11 @@ public class ReservedRolesStoreTests extends ESTestCase {
|
|
|
assertThat(kibanaRole.indices().allowedIndicesMatcher(RolloverAction.NAME).test(indexAbstraction), is(true));
|
|
|
});
|
|
|
|
|
|
- // Index for Endpoint specific actions
|
|
|
- Arrays.asList(".logs-endpoint.actions-" + randomAlphaOfLength(randomIntBetween(0, 13))).forEach((index) -> {
|
|
|
+ // Index for Endpoint and Osquery manager specific actions
|
|
|
+ Arrays.asList(
|
|
|
+ ".logs-endpoint.actions-" + randomAlphaOfLength(randomIntBetween(0, 13)),
|
|
|
+ ".logs-osquery_manager.actions-" + randomAlphaOfLength(randomIntBetween(0, 13))
|
|
|
+ ).forEach((index) -> {
|
|
|
final IndexAbstraction indexAbstraction = mockIndexAbstraction(index);
|
|
|
assertThat(kibanaRole.indices().allowedIndicesMatcher("indices:foo").test(indexAbstraction), is(false));
|
|
|
assertThat(kibanaRole.indices().allowedIndicesMatcher("indices:bar").test(indexAbstraction), is(false));
|
|
@@ -823,7 +829,10 @@ public class ReservedRolesStoreTests extends ESTestCase {
|
|
|
// Hidden data indices for endpoint package
|
|
|
".logs-endpoint.action.responses-" + randomAlphaOfLengthBetween(3, 8),
|
|
|
".logs-endpoint.diagnostic.collection-" + randomAlphaOfLengthBetween(3, 8),
|
|
|
- ".logs-endpoint.actions-" + randomAlphaOfLengthBetween(3, 8)
|
|
|
+ ".logs-endpoint.actions-" + randomAlphaOfLengthBetween(3, 8),
|
|
|
+ // Hidden data indices for osquery_manager package
|
|
|
+ ".logs-osquery_manager.action.responses-" + randomAlphaOfLengthBetween(3, 8),
|
|
|
+ ".logs-osquery_manager.actions-" + randomAlphaOfLengthBetween(3, 8)
|
|
|
).forEach(indexName -> {
|
|
|
logger.info("index name [{}]", indexName);
|
|
|
final IndexAbstraction indexAbstraction = mockIndexAbstraction(indexName);
|
|
@@ -838,7 +847,8 @@ public class ReservedRolesStoreTests extends ESTestCase {
|
|
|
is(true)
|
|
|
);
|
|
|
|
|
|
- final boolean isAlsoAutoCreateIndex = indexName.startsWith(".logs-endpoint.actions-");
|
|
|
+ final boolean isAlsoAutoCreateIndex = indexName.startsWith(".logs-endpoint.actions-")
|
|
|
+ || indexName.startsWith(".logs-osquery_manager.actions-");
|
|
|
assertThat(kibanaRole.indices().allowedIndicesMatcher(CreateIndexAction.NAME).test(indexAbstraction), is(false));
|
|
|
assertThat(kibanaRole.indices().allowedIndicesMatcher(AutoCreateAction.NAME).test(indexAbstraction), is(isAlsoAutoCreateIndex));
|
|
|
assertThat(kibanaRole.indices().allowedIndicesMatcher(CreateDataStreamAction.NAME).test(indexAbstraction), is(false));
|
|
@@ -848,7 +858,9 @@ public class ReservedRolesStoreTests extends ESTestCase {
|
|
|
// Endpoint diagnostic and actions data streams also have read access, all others should not.
|
|
|
final boolean isAlsoReadIndex = indexName.startsWith(".logs-endpoint.diagnostic.collection-")
|
|
|
|| indexName.startsWith(".logs-endpoint.actions-")
|
|
|
- || indexName.startsWith(".logs-endpoint.action.responses-");
|
|
|
+ || indexName.startsWith(".logs-endpoint.action.responses-")
|
|
|
+ || indexName.startsWith(".logs-osquery_manager.actions-")
|
|
|
+ || indexName.startsWith(".logs-osquery_manager.action.responses-");
|
|
|
assertThat(kibanaRole.indices().allowedIndicesMatcher(GetAction.NAME).test(indexAbstraction), is(isAlsoReadIndex));
|
|
|
assertThat(kibanaRole.indices().allowedIndicesMatcher(SearchAction.NAME).test(indexAbstraction), is(isAlsoReadIndex));
|
|
|
assertThat(kibanaRole.indices().allowedIndicesMatcher(MultiSearchAction.NAME).test(indexAbstraction), is(isAlsoReadIndex));
|