Skip to content

Commit ba0779e

Browse files
authored
Merge pull request #13624 from Security-Onion-Solutions/esver
fix es agent update for soup
2 parents b9d9311 + 2e379dd commit ba0779e

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

salt/common/tools/sbin/so-common

+2-1
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,8 @@ has_uppercase() {
677677
}
678678

679679
update_elastic_agent() {
680-
get_elastic_agent_vars
680+
local path="${1:-/opt/so/saltstack/default}"
681+
get_elastic_agent_vars "$path"
681682
echo "Checking if Elastic Agent update is necessary..."
682683
download_and_verify "$ELASTIC_AGENT_URL" "$ELASTIC_AGENT_MD5_URL" "$ELASTIC_AGENT_FILE" "$ELASTIC_AGENT_MD5" "$ELASTIC_AGENT_EXPANSION_DIR"
683684
}

salt/elasticfleet/tools/sbin_jinja/so-elastic-agent-grid-upgrade

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# this file except in compliance with the Elastic License 2.0.
66

77
. /usr/sbin/so-common
8-
{%- import_yaml 'elasticsearch/defaults.yaml' as ELASTICSEARCHDEFAULTS -%}
8+
{%- import_yaml 'elasticsearch/defaults.yaml' as ELASTICSEARCHDEFAULTS %}
99

1010
# Only run on Managers
1111
if ! is_manager_node; then

salt/manager/tools/sbin/soup

+3-2
Original file line numberDiff line numberDiff line change
@@ -837,12 +837,13 @@ determine_elastic_agent_upgrade() {
837837
if [[ $is_airgap -eq 0 ]]; then
838838
update_elastic_agent_airgap
839839
else
840-
update_elastic_agent
840+
# the new elasticsearch defaults.yaml file is not yet placed in /opt/so/saltstack/default/salt/elasticsearch yet
841+
update_elastic_agent "$UPDATE_DIR"
841842
fi
842843
}
843844

844845
update_elastic_agent_airgap() {
845-
get_elastic_agent_vars
846+
get_elastic_agent_vars "/tmp/soagupdate/SecurityOnion"
846847
rsync -av /tmp/soagupdate/fleet/* /nsm/elastic-fleet/artifacts/
847848
tar -xf "$ELASTIC_AGENT_FILE" -C "$ELASTIC_AGENT_EXPANSION_DIR"
848849
}

salt/suricata/tools/sbin/so-suricata-reload-rules

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77

88
. /usr/sbin/so-common
99

10-
retry 40 3 'docker exec -it so-suricata /opt/suricata/bin/suricatasc -c reload-rules /var/run/suricata/suricata-command.socket' '{"message": "done", "return": "OK"}'
11-
retry 40 3 'docker exec -it so-suricata /opt/suricata/bin/suricatasc -c ruleset-reload-nonblocking /var/run/suricata/suricata-command.socket' '{"message": "done", "return": "OK"}'
10+
retry 60 3 'docker exec -it so-suricata /opt/suricata/bin/suricatasc -c reload-rules /var/run/suricata/suricata-command.socket' '{"message": "done", "return": "OK"}' || fail "The Suricata container was not ready in time."
11+
retry 60 3 'docker exec -it so-suricata /opt/suricata/bin/suricatasc -c ruleset-reload-nonblocking /var/run/suricata/suricata-command.socket' '{"message": "done", "return": "OK"}' || fail "The Suricata container was not ready in time."

setup/so-setup

+2-2
Original file line numberDiff line numberDiff line change
@@ -759,8 +759,8 @@ if ! [[ -f $install_opt_file ]]; then
759759
title "Downloading IDS Rules"
760760
logCmd "so-rule-update"
761761
if [[ $monints || $is_import ]]; then
762-
title "Restarting Suricata to pick up the new rules"
763-
logCmd "so-suricata-restart"
762+
title "Applying the Suricata state to load the new rules"
763+
logCmd "salt-call state.apply suricata -l info"
764764
fi
765765
fi
766766
title "Setting up Kibana Default Space"

0 commit comments

Comments
 (0)