Merge pull request #11805 from Security-Onion-Solutions/2.4/defendhotfix2

.30 hotfix
This commit is contained in:
Josh Brower
2023-11-16 11:42:49 -05:00
committed by GitHub

View File

@@ -529,6 +529,24 @@ 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
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
# Elastic Update for this release, so download Elastic Agent files
determine_elastic_agent_upgrade
rm -f /opt/so/state/estemplates*.txt
@@ -735,8 +753,23 @@ 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 --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