From d5dd0d88ede1d931916d4c764e780c076a1b7760 Mon Sep 17 00:00:00 2001 From: Josh Brower Date: Thu, 16 Nov 2023 10:58:23 -0500 Subject: [PATCH 1/4] .30 hotfix --- salt/manager/tools/sbin/soup | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/salt/manager/tools/sbin/soup b/salt/manager/tools/sbin/soup index 42ea7e764..9a2ae890d 100755 --- a/salt/manager/tools/sbin/soup +++ b/salt/manager/tools/sbin/soup @@ -735,8 +735,12 @@ apply_hotfix() { . /usr/sbin/so-elastic-fleet-common elastic_fleet_integration_remove endpoints-initial elastic-defend-endpoints /usr/sbin/so-elastic-fleet-integration-policy-elastic-defend -# elif [[ "$INSTALLEDVERSION" == "2.3.110" ]] ; then -# 2_3_10_hotfix_1 + elif [[ "$INSTALLEDVERSION" == "2.4.30" ]] ; then + rm -f /opt/so/conf/elastic-fleet/integrations/endpoints-initial/elastic-defend-endpoints.json + so-kibana-restart + . /usr/sbin/so-elastic-fleet-common + elastic_fleet_integration_remove endpoints-initial elastic-defend-endpoints + /usr/sbin/so-elastic-fleet-integration-policy-elastic-defend else echo "No actions required. ($INSTALLEDVERSION/$HOTFIXVERSION)" fi From ff8cd194f1f2adc269d7aac2a71039256ea2bd37 Mon Sep 17 00:00:00 2001 From: Josh Brower Date: Thu, 16 Nov 2023 11:21:34 -0500 Subject: [PATCH 2/4] Make sure kibana API is up --- salt/manager/tools/sbin/soup | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/salt/manager/tools/sbin/soup b/salt/manager/tools/sbin/soup index 9a2ae890d..a4bd6a4d5 100755 --- a/salt/manager/tools/sbin/soup +++ b/salt/manager/tools/sbin/soup @@ -737,10 +737,21 @@ apply_hotfix() { /usr/sbin/so-elastic-fleet-integration-policy-elastic-defend elif [[ "$INSTALLEDVERSION" == "2.4.30" ]] ; then rm -f /opt/so/conf/elastic-fleet/integrations/endpoints-initial/elastic-defend-endpoints.json - so-kibana-restart + so-kibana-restart --force . /usr/sbin/so-elastic-fleet-common + + echo "Checking to make sure that Kibana API is up & ready..." + RETURN_CODE=0 + wait_for_web_response "http://localhost:5601/api/fleet/settings" "fleet" 300 "curl -K /opt/so/conf/elasticsearch/curl.config" + RETURN_CODE=$? + if [[ "$RETURN_CODE" != "0" ]]; then + echo "Kibana API not accessible, exiting script..." + exit 1 + fi + elastic_fleet_integration_remove endpoints-initial elastic-defend-endpoints /usr/sbin/so-elastic-fleet-integration-policy-elastic-defend + salt-call state.highstate else echo "No actions required. ($INSTALLEDVERSION/$HOTFIXVERSION)" fi From 109ee55d8c6f84ce27a2e44dff3cfb29ad15be87 Mon Sep 17 00:00:00 2001 From: Josh Brower Date: Thu, 16 Nov 2023 11:37:38 -0500 Subject: [PATCH 3/4] Add to pre for .30 soup --- salt/manager/tools/sbin/soup | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/salt/manager/tools/sbin/soup b/salt/manager/tools/sbin/soup index a4bd6a4d5..18a436c01 100755 --- a/salt/manager/tools/sbin/soup +++ b/salt/manager/tools/sbin/soup @@ -529,6 +529,22 @@ up_to_2.4.20() { } up_to_2.4.30() { + rm -f /opt/so/conf/elastic-fleet/integrations/endpoints-initial/elastic-defend-endpoints.json + . /usr/sbin/so-elastic-fleet-common + + echo "Checking to make sure that Kibana API is up & ready..." + RETURN_CODE=0 + wait_for_web_response "http://localhost:5601/api/fleet/settings" "fleet" 300 "curl -K /opt/so/conf/elasticsearch/curl.config" + RETURN_CODE=$? + if [[ "$RETURN_CODE" != "0" ]]; then + echo "Kibana API not accessible, exiting script..." + exit 1 + fi + + elastic_fleet_integration_remove endpoints-initial elastic-defend-endpoints + /usr/sbin/so-elastic-fleet-integration-policy-elastic-defend + salt-call state.highstate + determine_elastic_agent_upgrade rm -f /opt/so/state/estemplates*.txt From 6b8e48c973567c775919fcefb7c10e811d4ad0b7 Mon Sep 17 00:00:00 2001 From: Josh Brower Date: Thu, 16 Nov 2023 11:41:20 -0500 Subject: [PATCH 4/4] Remove highstate --- salt/manager/tools/sbin/soup | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/salt/manager/tools/sbin/soup b/salt/manager/tools/sbin/soup index 18a436c01..67b291ddf 100755 --- a/salt/manager/tools/sbin/soup +++ b/salt/manager/tools/sbin/soup @@ -529,6 +529,8 @@ up_to_2.4.20() { } up_to_2.4.30() { + + # Remove older defend integration json rm -f /opt/so/conf/elastic-fleet/integrations/endpoints-initial/elastic-defend-endpoints.json . /usr/sbin/so-elastic-fleet-common @@ -543,8 +545,8 @@ up_to_2.4.30() { elastic_fleet_integration_remove endpoints-initial elastic-defend-endpoints /usr/sbin/so-elastic-fleet-integration-policy-elastic-defend - salt-call state.highstate + # Elastic Update for this release, so download Elastic Agent files determine_elastic_agent_upgrade rm -f /opt/so/state/estemplates*.txt