From 9ca0f586ae63a90fef9c78b8b1fc24b020545ae3 Mon Sep 17 00:00:00 2001 From: Mike Reeves Date: Wed, 21 Feb 2024 11:45:02 -0500 Subject: [PATCH 1/2] Manage the repos --- salt/manager/files/mirror.txt | 0 salt/manager/files/repodownload.conf | 13 +++++++++++++ salt/manager/init.sls | 14 ++++++++++++++ setup/so-functions | 4 ++-- 4 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 salt/manager/files/mirror.txt create mode 100644 salt/manager/files/repodownload.conf diff --git a/salt/manager/files/mirror.txt b/salt/manager/files/mirror.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/salt/manager/files/repodownload.conf b/salt/manager/files/repodownload.conf new file mode 100644 index 0000000000..3c156a9db6 --- /dev/null +++ b/salt/manager/files/repodownload.conf @@ -0,0 +1,13 @@ +[main] +gpgcheck=1 +installonly_limit=3 +clean_requirements_on_remove=True +best=True +skip_if_unavailable=False +cachedir=/opt/so/conf/reposync/cache +keepcache=0 +[securityonionsync] +name=Security Onion Repo repo +mirrorlist=file:///opt/so/conf/reposync/mirror.txt +enabled=1 +gpgcheck=1 \ No newline at end of file diff --git a/salt/manager/init.sls b/salt/manager/init.sls index 23ef189b53..e51a448d56 100644 --- a/salt/manager/init.sls +++ b/salt/manager/init.sls @@ -75,6 +75,20 @@ yara_update_scripts: - defaults: EXCLUDEDRULES: {{ STRELKAMERGED.rules.excluded }} +so-repo-file: + file.managed: + - name: /opt/so/conf/reposync/repodownload.conf + - source: salt://manager/files/repodownload.conf + - user: socore + - group: socore + +so-repo-mirrorlist: + file.managed: + - name: /opt/so/conf/reposync/mirror.txt + - source: salt://manager/files/mirror.txt + - user: socore + - group: socore + so-repo-sync: {% if MANAGERMERGED.reposync.enabled %} cron.present: diff --git a/setup/so-functions b/setup/so-functions index f0462e4d64..ef1df4a719 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -1811,8 +1811,8 @@ repo_sync_local() { info "Adding Repo Download Configuration" mkdir -p /nsm/repo mkdir -p /opt/so/conf/reposync/cache - echo "https://repo.securityonion.net/file/so-repo/prod/2.4/oracle/9" > /opt/so/conf/reposync/mirror.txt - echo "https://so-repo-east.s3.us-east-005.backblazeb2.com/prod/2.4/oracle/9" >> /opt/so/conf/reposync/mirror.txt + echo "https://repo.securityonion.net/file/so-repo/prod/2.4/oracle/9.3" > /opt/so/conf/reposync/mirror.txt + echo "https://repo-alt.securityonion.net/prod/2.4/oracle/9.3" >> /opt/so/conf/reposync/mirror.txt echo "[main]" > /opt/so/conf/reposync/repodownload.conf echo "gpgcheck=1" >> /opt/so/conf/reposync/repodownload.conf echo "installonly_limit=3" >> /opt/so/conf/reposync/repodownload.conf From 759b2ff59e5ffa201464a32a0ac776925a8044bb Mon Sep 17 00:00:00 2001 From: Mike Reeves Date: Thu, 22 Feb 2024 10:03:51 -0500 Subject: [PATCH 2/2] Manage the repos --- salt/manager/files/mirror.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/salt/manager/files/mirror.txt b/salt/manager/files/mirror.txt index e69de29bb2..732c116b41 100644 --- a/salt/manager/files/mirror.txt +++ b/salt/manager/files/mirror.txt @@ -0,0 +1,2 @@ +https://repo.securityonion.net/file/so-repo/prod/2.4/oracle/9 +https://repo-alt.securityonion.net/prod/2.4/oracle/9 \ No newline at end of file