diff --git a/src/main/java/org/opensearch/securityanalytics/SecurityAnalyticsPlugin.java b/src/main/java/org/opensearch/securityanalytics/SecurityAnalyticsPlugin.java index 232b2ea97..2c60321df 100644 --- a/src/main/java/org/opensearch/securityanalytics/SecurityAnalyticsPlugin.java +++ b/src/main/java/org/opensearch/securityanalytics/SecurityAnalyticsPlugin.java @@ -292,24 +292,5 @@ public void onFailure(Exception e) { log.warn("Failed to initialize LogType config index and builtin log types"); } }); - // Trigger initialization of prepackaged rules by calling SearchRule API - SearchRequest searchRequest = new SearchRequest(Rule.PRE_PACKAGED_RULES_INDEX); - searchRequest.source(new SearchSourceBuilder().query(QueryBuilders.matchAllQuery()).size(0)); - searchRequest.preference(Preference.PRIMARY_FIRST.type()); - client.execute( - SearchRuleAction.INSTANCE, - new SearchRuleRequest(true, searchRequest), - new ActionListener<>() { - @Override - public void onResponse(SearchResponse searchResponse) { - log.info("Successfully initialized prepackaged rules"); - } - - @Override - public void onFailure(Exception e) { - log.warn("Failed initializing prepackaged rules", e); - } - } - ); } } \ No newline at end of file diff --git a/src/main/java/org/opensearch/securityanalytics/util/RuleIndices.java b/src/main/java/org/opensearch/securityanalytics/util/RuleIndices.java index c75bcbd70..53c0a516f 100644 --- a/src/main/java/org/opensearch/securityanalytics/util/RuleIndices.java +++ b/src/main/java/org/opensearch/securityanalytics/util/RuleIndices.java @@ -103,7 +103,6 @@ public void initRuleIndex(ActionListener actionListener, bo if (!ruleIndexExists(isPrepackaged)) { Settings indexSettings = Settings.builder() .put("index.hidden", true) - .put("index.auto_expand_replicas", "0-all") .build(); CreateIndexRequest indexRequest = new CreateIndexRequest(getRuleIndex(isPrepackaged)) .mapping(ruleMappings()) diff --git a/src/test/java/org/opensearch/securityanalytics/SecurityAnalyticsRestTestCase.java b/src/test/java/org/opensearch/securityanalytics/SecurityAnalyticsRestTestCase.java index d3d2192cc..b38174419 100644 --- a/src/test/java/org/opensearch/securityanalytics/SecurityAnalyticsRestTestCase.java +++ b/src/test/java/org/opensearch/securityanalytics/SecurityAnalyticsRestTestCase.java @@ -19,6 +19,7 @@ import org.junit.Assert; import org.junit.After; import org.junit.Before; +import org.junit.BeforeClass; import org.opensearch.action.admin.indices.mapping.get.GetMappingsResponse; import org.opensearch.action.search.SearchResponse; import org.opensearch.client.Request; @@ -236,7 +237,6 @@ void setDebugLogLevel() throws IOException, InterruptedException { makeRequest(client(), "PUT", "_cluster/settings", Collections.emptyMap(), se, new BasicHeader("Content-Type", "application/json")); - Thread.sleep(10000); } protected final List clusterPermissions = List.of(