From 70c001e22b37c8cc45f962a898aab1fcb163b733 Mon Sep 17 00:00:00 2001 From: Mike Reeves Date: Fri, 21 Jun 2024 13:37:36 -0400 Subject: [PATCH 1/8] Update so-repo-sync --- salt/manager/tools/sbin/so-repo-sync | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/salt/manager/tools/sbin/so-repo-sync b/salt/manager/tools/sbin/so-repo-sync index a0393a36b..d7cdcc32d 100644 --- a/salt/manager/tools/sbin/so-repo-sync +++ b/salt/manager/tools/sbin/so-repo-sync @@ -7,6 +7,11 @@ NOROOT=1 . /usr/sbin/so-common +# See if a proxy is set. If so use it. +if [ -f /etc/profile.d/so-proxy.sh ]; then + . /etc/profile.d/so-proxy.sh +fi + set -e curl --retry 5 --retry-delay 60 -A "reposync/$(sync_options)" https://sigs.securityonion.net/checkup --output /tmp/checkup From c5ce7102e8b8cb57c2298f713c8c6943776dbe30 Mon Sep 17 00:00:00 2001 From: Mike Reeves Date: Fri, 21 Jun 2024 14:41:27 -0400 Subject: [PATCH 2/8] Make soup use reposync from the repo --- salt/manager/tools/sbin/so-elasticagent-status | 0 salt/manager/tools/sbin/so-repo-sync | 0 salt/manager/tools/sbin/soup | 2 +- 3 files changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 salt/manager/tools/sbin/so-elasticagent-status mode change 100644 => 100755 salt/manager/tools/sbin/so-repo-sync diff --git a/salt/manager/tools/sbin/so-elasticagent-status b/salt/manager/tools/sbin/so-elasticagent-status old mode 100644 new mode 100755 diff --git a/salt/manager/tools/sbin/so-repo-sync b/salt/manager/tools/sbin/so-repo-sync old mode 100644 new mode 100755 diff --git a/salt/manager/tools/sbin/soup b/salt/manager/tools/sbin/soup index 63df4eb25..0bd2f6b53 100755 --- a/salt/manager/tools/sbin/soup +++ b/salt/manager/tools/sbin/soup @@ -484,7 +484,7 @@ post_to_2.4.80() { repo_sync() { echo "Sync the local repo." - su socore -c '/usr/sbin/so-repo-sync' || fail "Unable to complete so-repo-sync." + su socore -c '$UPDATE_DIR/salt/manager/tools/sbin/so-repo-sync' || fail "Unable to complete so-repo-sync." } stop_salt_master() { From ff4679ec08b45c3800ee0d8c2165e6fc90ca5e8a Mon Sep 17 00:00:00 2001 From: Mike Reeves Date: Fri, 21 Jun 2024 14:45:06 -0400 Subject: [PATCH 3/8] Make soup use reposync from the repo --- salt/manager/tools/sbin/soup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/manager/tools/sbin/soup b/salt/manager/tools/sbin/soup index 0bd2f6b53..16b674d1a 100755 --- a/salt/manager/tools/sbin/soup +++ b/salt/manager/tools/sbin/soup @@ -484,7 +484,7 @@ post_to_2.4.80() { repo_sync() { echo "Sync the local repo." - su socore -c '$UPDATE_DIR/salt/manager/tools/sbin/so-repo-sync' || fail "Unable to complete so-repo-sync." + su socore -c '/tmp/sogh/securityonion/salt/manager/tools/sbin/so-repo-sync' || fail "Unable to complete so-repo-sync." } stop_salt_master() { From b84521cdd2e1b1fe39b1a928341aa57d3de7ae57 Mon Sep 17 00:00:00 2001 From: Mike Reeves Date: Fri, 21 Jun 2024 14:49:16 -0400 Subject: [PATCH 4/8] Make soup use reposync from the repo --- salt/manager/tools/sbin/soup | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/salt/manager/tools/sbin/soup b/salt/manager/tools/sbin/soup index 16b674d1a..28a023e01 100755 --- a/salt/manager/tools/sbin/soup +++ b/salt/manager/tools/sbin/soup @@ -483,8 +483,11 @@ post_to_2.4.80() { } repo_sync() { + # Making sure reposync is the latest + cp $UPDATE_DIR/salt/manager/tools/sbin/so-repo-sync /usr/sbin + chmod +x /usr/sbin/so-repo-sync echo "Sync the local repo." - su socore -c '/tmp/sogh/securityonion/salt/manager/tools/sbin/so-repo-sync' || fail "Unable to complete so-repo-sync." + su socore -c '/usr/sbin/so-repo-sync' || fail "Unable to complete so-repo-sync." } stop_salt_master() { From 6a9d78fa7c796f51a9aed2f352461818b818a833 Mon Sep 17 00:00:00 2001 From: Mike Reeves Date: Fri, 21 Jun 2024 15:10:44 -0400 Subject: [PATCH 5/8] Make soup use reposync from the repo --- salt/common/soup_scripts.sls | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/salt/common/soup_scripts.sls b/salt/common/soup_scripts.sls index 898de67ee..508b95b67 100644 --- a/salt/common/soup_scripts.sls +++ b/salt/common/soup_scripts.sls @@ -57,6 +57,12 @@ copy_so-yaml_manager_tools_sbin: - force: True - preserve: True +copy_so-repo-sync_manager_tools_sbin: + file.copy: + - name: /opt/so/saltstack/default/salt/manager/tools/sbin/so-repo-sync + - source: {{UPDATE_DIR}}/salt/manager/tools/sbin/so-repo-sync + - preserve: True + # This section is used to put the new script in place so that it can be called during soup. # It is faster than calling the states that normally manage them to put them in place. copy_so-common_sbin: @@ -94,6 +100,13 @@ copy_so-yaml_sbin: - force: True - preserve: True +copy_so-repo-sync_sbin: + file.copy: + - name: /usr/sbin/so-repo-sync + - source: {{UPDATE_DIR}}/salt/manager/tools/sbin/so-repo-sync + - force: True + - preserve: True + {% else %} fix_23_soup_sbin: cmd.run: From 0295b8d658c83d628a99b2c8d664dc2a402375ca Mon Sep 17 00:00:00 2001 From: Mike Reeves Date: Fri, 21 Jun 2024 15:11:23 -0400 Subject: [PATCH 6/8] Make soup use reposync from the repo --- salt/manager/tools/sbin/soup | 3 --- 1 file changed, 3 deletions(-) diff --git a/salt/manager/tools/sbin/soup b/salt/manager/tools/sbin/soup index 28a023e01..63df4eb25 100755 --- a/salt/manager/tools/sbin/soup +++ b/salt/manager/tools/sbin/soup @@ -483,9 +483,6 @@ post_to_2.4.80() { } repo_sync() { - # Making sure reposync is the latest - cp $UPDATE_DIR/salt/manager/tools/sbin/so-repo-sync /usr/sbin - chmod +x /usr/sbin/so-repo-sync echo "Sync the local repo." su socore -c '/usr/sbin/so-repo-sync' || fail "Unable to complete so-repo-sync." } From 77dedc575e4bddcc319b6d03b8304564abb79b28 Mon Sep 17 00:00:00 2001 From: Mike Reeves Date: Fri, 21 Jun 2024 15:20:07 -0400 Subject: [PATCH 7/8] Make soup use reposync from the repo --- salt/manager/tools/sbin/soup | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/salt/manager/tools/sbin/soup b/salt/manager/tools/sbin/soup index 63df4eb25..f025edc30 100755 --- a/salt/manager/tools/sbin/soup +++ b/salt/manager/tools/sbin/soup @@ -9,6 +9,11 @@ . /usr/sbin/so-common . /usr/sbin/so-image-common +# See if a proxy is set. If so use it. +if [ -f /etc/profile.d/so-proxy.sh ]; then + . /etc/profile.d/so-proxy.sh +fi + UPDATE_DIR=/tmp/sogh/securityonion DEFAULT_SALT_DIR=/opt/so/saltstack/default INSTALLEDVERSION=$(cat /etc/soversion) From 9577c3f59d4cc889f9caeaca9a7b8d6a0d043c09 Mon Sep 17 00:00:00 2001 From: Mike Reeves Date: Fri, 21 Jun 2024 15:24:54 -0400 Subject: [PATCH 8/8] Make soup use reposync from the repo --- salt/common/tools/sbin/so-common | 5 +++++ salt/manager/tools/sbin/so-repo-sync | 5 ----- salt/manager/tools/sbin/soup | 5 ----- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/salt/common/tools/sbin/so-common b/salt/common/tools/sbin/so-common index 8d4d9f8ab..05c47a6c1 100755 --- a/salt/common/tools/sbin/so-common +++ b/salt/common/tools/sbin/so-common @@ -31,6 +31,11 @@ if ! echo "$PATH" | grep -q "/usr/sbin"; then export PATH="$PATH:/usr/sbin" fi +# See if a proxy is set. If so use it. +if [ -f /etc/profile.d/so-proxy.sh ]; then + . /etc/profile.d/so-proxy.sh +fi + # Define a banner to separate sections banner="=========================================================================" diff --git a/salt/manager/tools/sbin/so-repo-sync b/salt/manager/tools/sbin/so-repo-sync index d7cdcc32d..a0393a36b 100755 --- a/salt/manager/tools/sbin/so-repo-sync +++ b/salt/manager/tools/sbin/so-repo-sync @@ -7,11 +7,6 @@ NOROOT=1 . /usr/sbin/so-common -# See if a proxy is set. If so use it. -if [ -f /etc/profile.d/so-proxy.sh ]; then - . /etc/profile.d/so-proxy.sh -fi - set -e curl --retry 5 --retry-delay 60 -A "reposync/$(sync_options)" https://sigs.securityonion.net/checkup --output /tmp/checkup diff --git a/salt/manager/tools/sbin/soup b/salt/manager/tools/sbin/soup index f025edc30..63df4eb25 100755 --- a/salt/manager/tools/sbin/soup +++ b/salt/manager/tools/sbin/soup @@ -9,11 +9,6 @@ . /usr/sbin/so-common . /usr/sbin/so-image-common -# See if a proxy is set. If so use it. -if [ -f /etc/profile.d/so-proxy.sh ]; then - . /etc/profile.d/so-proxy.sh -fi - UPDATE_DIR=/tmp/sogh/securityonion DEFAULT_SALT_DIR=/opt/so/saltstack/default INSTALLEDVERSION=$(cat /etc/soversion)