From 0dd2e51e83a8911fc3a15401a97c2e1c17f7ff90 Mon Sep 17 00:00:00 2001 From: Jason Ertel Date: Tue, 6 Dec 2022 11:39:58 -0500 Subject: [PATCH 01/10] Ensure Suricata move events get picked up --- salt/strelka/filecheck/filecheck | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/salt/strelka/filecheck/filecheck b/salt/strelka/filecheck/filecheck index 146625552..cd72eaffa 100644 --- a/salt/strelka/filecheck/filecheck +++ b/salt/strelka/filecheck/filecheck @@ -74,17 +74,21 @@ def process(filename, hizash): class CreatedEventHandler(FileSystemEventHandler): def on_created(self, event): + logging.info("File create detected: " + event.src_path) checksum(event.src_path) + def on_moved(self, event): + logging.info("File move detected: " + event.src_path + " -> " + event.dest_path) + checksum(event.dest_path) + if __name__ == "__main__": logging.info("Starting filecheck") - checkexisting() - event_handler =CreatedEventHandler() shutdown = False while not shutdown: + checkexisting() logging.info("Scheduling observer") observer = Observer() observer.schedule(event_handler, extract_path, recursive=True) From 819b39c0bb6638aede955192f427abfb39692d89 Mon Sep 17 00:00:00 2001 From: Jason Ertel Date: Tue, 6 Dec 2022 11:41:00 -0500 Subject: [PATCH 02/10] Update hotfix --- HOTFIX | 1 + 1 file changed, 1 insertion(+) diff --git a/HOTFIX b/HOTFIX index e69de29bb..b55757e17 100644 --- a/HOTFIX +++ b/HOTFIX @@ -0,0 +1 @@ +20221206 From 531423f49a739f9e5cd5cb5628d9a23c2b7a6ad2 Mon Sep 17 00:00:00 2001 From: Mike Reeves Date: Tue, 6 Dec 2022 13:25:03 -0500 Subject: [PATCH 03/10] Update init.sls --- salt/strelka/init.sls | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/salt/strelka/init.sls b/salt/strelka/init.sls index b372e6f6c..b272e15c6 100644 --- a/salt/strelka/init.sls +++ b/salt/strelka/init.sls @@ -170,6 +170,12 @@ filecheck_script: - group: 939 - mode: 755 +filecheck_restart: + cmd.run: + - name: kill $(ps -ef | grep filecheck | grep -v grep | grep -v tail | awk '{print $2}') + - onchanges: + - file: filecheck_script + filecheck_run: cron.present: - name: 'ps -ef | grep filecheck | grep -v grep || python3 /opt/so/conf/strelka/filecheck >> /opt/so/log/strelka/filecheck_stdout.log 2>&1 &' From f0c3b876a94993802af1eeca9d19c2a9ade2e512 Mon Sep 17 00:00:00 2001 From: Mike Reeves Date: Tue, 6 Dec 2022 13:35:03 -0500 Subject: [PATCH 04/10] Update init.sls --- salt/strelka/init.sls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/strelka/init.sls b/salt/strelka/init.sls index b272e15c6..502cb2bb7 100644 --- a/salt/strelka/init.sls +++ b/salt/strelka/init.sls @@ -172,7 +172,7 @@ filecheck_script: filecheck_restart: cmd.run: - - name: kill $(ps -ef | grep filecheck | grep -v grep | grep -v tail | awk '{print $2}') + - name: pkill -f "python3 /opt/so/conf/strelka/filecheck" - onchanges: - file: filecheck_script From 7b05627d5ca6b862e249cd517912706892ecac1f Mon Sep 17 00:00:00 2001 From: Jason Ertel Date: Wed, 7 Dec 2022 07:58:32 -0500 Subject: [PATCH 05/10] Suricata support for filecheck; reduce cron noise --- salt/strelka/init.sls | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/salt/strelka/init.sls b/salt/strelka/init.sls index 502cb2bb7..ded7978d9 100644 --- a/salt/strelka/init.sls +++ b/salt/strelka/init.sls @@ -173,12 +173,19 @@ filecheck_script: filecheck_restart: cmd.run: - name: pkill -f "python3 /opt/so/conf/strelka/filecheck" + - hide_output: True + - success_retcodes: [0,1] - onchanges: - file: filecheck_script +filecheck_oldcronremoval: + cron.absent: + - name: 'ps -ef | grep filecheck | grep -v grep || python3 /opt/so/conf/strelka/filecheck >> /opt/so/log/strelka/filecheck_stdout.log 2>&1 &' + - user: {{ filecheck_runas }} + filecheck_run: cron.present: - - name: 'ps -ef | grep filecheck | grep -v grep || python3 /opt/so/conf/strelka/filecheck >> /opt/so/log/strelka/filecheck_stdout.log 2>&1 &' + - name: 'pgrep -f "python3 /opt/so/conf/strelka/filecheck" &> /dev/null || python3 /opt/so/conf/strelka/filecheck >> /opt/so/log/strelka/filecheck_stdout.log 2>&1 &' - user: {{ filecheck_runas }} filcheck_history_clean: From 4aff1f0fdbb493708dd8f6413f2daad0b55ec805 Mon Sep 17 00:00:00 2001 From: Mike Reeves Date: Wed, 7 Dec 2022 09:19:51 -0500 Subject: [PATCH 06/10] Update HOTFIX --- HOTFIX | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HOTFIX b/HOTFIX index b55757e17..ec18fda07 100644 --- a/HOTFIX +++ b/HOTFIX @@ -1 +1 @@ -20221206 +20221207 From 0aab26880122e2a4b171a54b038ca4f9e8a3874b Mon Sep 17 00:00:00 2001 From: Mike Reeves Date: Wed, 7 Dec 2022 11:12:13 -0500 Subject: [PATCH 07/10] 2.3.190 hotfix --- VERIFY_ISO.md | 22 ++++++++++---------- sigs/securityonion-2.3.190-20221205.iso.sig | Bin 543 -> 0 bytes sigs/securityonion-2.3.190-20221207.iso.sig | Bin 0 -> 543 bytes 3 files changed, 11 insertions(+), 11 deletions(-) delete mode 100644 sigs/securityonion-2.3.190-20221205.iso.sig create mode 100644 sigs/securityonion-2.3.190-20221207.iso.sig diff --git a/VERIFY_ISO.md b/VERIFY_ISO.md index 148598b37..0323b457b 100644 --- a/VERIFY_ISO.md +++ b/VERIFY_ISO.md @@ -1,18 +1,18 @@ -### 2.3.190-20221205 ISO image built on 2022/12/05 +### 2.3.190-20221207 ISO image built on 2022/12/07 ### Download and Verify -2.3.190-20221205 ISO image: -https://download.securityonion.net/file/securityonion/securityonion-2.3.190-20221205.iso +2.3.190-20221207 ISO image: +https://download.securityonion.net/file/securityonion/securityonion-2.3.190-20221207.iso -MD5: E8D0BB6F43F67EC64F04AE239781E674 -SHA1: BC58236BDF8DBD86870182B6F79009406DC04138 -SHA256: 34A98078538060486C70A934839A271A5AD66CF50D55EEC04DA0B325B13D56AC +MD5: 0DBC3718D4FE133E5F4E7BDCA9117F7F +SHA1: A9B988A293125A0D41482D74397FE747A3701181 +SHA256: E7E2DCA74FEB76249C36CBADB862C69336C745F7835005B9A382D347313AE75E Signature for ISO image: -https://github.com/Security-Onion-Solutions/securityonion/raw/master/sigs/securityonion-2.3.190-20221205.iso.sig +https://github.com/Security-Onion-Solutions/securityonion/raw/master/sigs/securityonion-2.3.190-20221207.iso.sig Signing key: https://raw.githubusercontent.com/Security-Onion-Solutions/securityonion/master/KEYS @@ -26,22 +26,22 @@ wget https://raw.githubusercontent.com/Security-Onion-Solutions/securityonion/ma Download the signature file for the ISO: ``` -wget https://github.com/Security-Onion-Solutions/securityonion/raw/master/sigs/securityonion-2.3.190-20221205.iso.sig +wget https://github.com/Security-Onion-Solutions/securityonion/raw/master/sigs/securityonion-2.3.190-20221207.iso.sig ``` Download the ISO image: ``` -wget https://download.securityonion.net/file/securityonion/securityonion-2.3.190-20221205.iso +wget https://download.securityonion.net/file/securityonion/securityonion-2.3.190-20221207.iso ``` Verify the downloaded ISO image using the signature file: ``` -gpg --verify securityonion-2.3.190-20221205.iso.sig securityonion-2.3.190-20221205.iso +gpg --verify securityonion-2.3.190-20221207.iso.sig securityonion-2.3.190-20221207.iso ``` The output should show "Good signature" and the Primary key fingerprint should match what's shown below: ``` -gpg: Signature made Mon 05 Dec 2022 12:27:49 PM EST using RSA key ID FE507013 +gpg: Signature made Wed 07 Dec 2022 09:44:10 AM EST using RSA key ID FE507013 gpg: Good signature from "Security Onion Solutions, LLC " gpg: WARNING: This key is not certified with a trusted signature! gpg: There is no indication that the signature belongs to the owner. diff --git a/sigs/securityonion-2.3.190-20221205.iso.sig b/sigs/securityonion-2.3.190-20221205.iso.sig deleted file mode 100644 index 91fb01e4170778980973c2d1f7025747847bcc17..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 543 zcmV+)0^t3L0vrSY0RjL91p;G^Dir_<2@re`V7LBIa1&&}5C1?@mkx(y9Z1ci2Jpu< zu04bV>w3KV9Mqh?|8AMgykCfqynBq({ z!?AnFM6?noQjTn8I1^jnLgZ*|EsJ9pz21wC9f+6!D2Nl6Z6ErmTZMjK#OFMa-XlhU zlnPk~Pv#c1MEgI#8bir`*>(WTA%{_pum^(p1thEa^KQ&+sn&g{{iC{Z#WSx z;(gR-$U=V*l9J_u0AzkBGHS04_EDM`K_O}=Mg}f)$FVO;ZF^%n(Xzp<)HT>s5w_jX h%IIKY;mt>OU<OLaGyQCOEF9g zp>7RR<@$-h=qWX-LV$EuYhoWJ{fl{PHR`>K+2Sc8o|+5EV1s>f=fC_vF7RM@4Bu8s zd}-o;!yIYg^Q!uMf%FzVHox&3X&<>y+xncfcT?<%x@E1Ee__ImdAa`ms%9_r8_hSh%Jx{ZglYwA9WSnp-U^AG^p8s=s> zy#=~}WGX*Hvwh(>Nm&6T?U@8~BPsm&3)S^?j@pOY(?1r@-eYid6Bbg#0Dkp_d0{L?jgf8hHIx;J=-{`2AeLw4W(*ezvx=z Date: Wed, 7 Dec 2022 11:53:42 -0500 Subject: [PATCH 08/10] Use original style due to pgrep conflict with cron --- salt/strelka/init.sls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/strelka/init.sls b/salt/strelka/init.sls index ded7978d9..e305ab303 100644 --- a/salt/strelka/init.sls +++ b/salt/strelka/init.sls @@ -185,7 +185,7 @@ filecheck_oldcronremoval: filecheck_run: cron.present: - - name: 'pgrep -f "python3 /opt/so/conf/strelka/filecheck" &> /dev/null || python3 /opt/so/conf/strelka/filecheck >> /opt/so/log/strelka/filecheck_stdout.log 2>&1 &' + - name: 'ps -ef | grep filecheck | grep -v grep &> /dev/null || python3 /opt/so/conf/strelka/filecheck >> /opt/so/log/strelka/filecheck_stdout.log 2>&1 &' - user: {{ filecheck_runas }} filcheck_history_clean: From d48d473f436f9a90f2b485c5eff6aa68963444f4 Mon Sep 17 00:00:00 2001 From: Jason Ertel Date: Wed, 7 Dec 2022 14:06:24 -0500 Subject: [PATCH 09/10] Switch back to older style redirect due to incompatibility with Ub 18 --- salt/strelka/init.sls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/strelka/init.sls b/salt/strelka/init.sls index e305ab303..30181d9cc 100644 --- a/salt/strelka/init.sls +++ b/salt/strelka/init.sls @@ -185,7 +185,7 @@ filecheck_oldcronremoval: filecheck_run: cron.present: - - name: 'ps -ef | grep filecheck | grep -v grep &> /dev/null || python3 /opt/so/conf/strelka/filecheck >> /opt/so/log/strelka/filecheck_stdout.log 2>&1 &' + - name: 'ps -ef | grep filecheck | grep -v grep > /dev/null 2>&1 || python3 /opt/so/conf/strelka/filecheck >> /opt/so/log/strelka/filecheck_stdout.log 2>&1 &' - user: {{ filecheck_runas }} filcheck_history_clean: From da94ddca13541020d930f9f8a29663f23181a549 Mon Sep 17 00:00:00 2001 From: Mike Reeves Date: Wed, 7 Dec 2022 16:17:57 -0500 Subject: [PATCH 10/10] 2.3.190 hotfix --- VERIFY_ISO.md | 8 ++++---- sigs/securityonion-2.3.190-20221205.iso.sig | Bin 0 -> 543 bytes sigs/securityonion-2.3.190-20221207.iso.sig | Bin 543 -> 543 bytes 3 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 sigs/securityonion-2.3.190-20221205.iso.sig diff --git a/VERIFY_ISO.md b/VERIFY_ISO.md index 0323b457b..4a99db509 100644 --- a/VERIFY_ISO.md +++ b/VERIFY_ISO.md @@ -7,9 +7,9 @@ 2.3.190-20221207 ISO image: https://download.securityonion.net/file/securityonion/securityonion-2.3.190-20221207.iso -MD5: 0DBC3718D4FE133E5F4E7BDCA9117F7F -SHA1: A9B988A293125A0D41482D74397FE747A3701181 -SHA256: E7E2DCA74FEB76249C36CBADB862C69336C745F7835005B9A382D347313AE75E +MD5: F7F222325A5C1C880E11B667FEE913CA +SHA1: F7DFE818A0CED391548CDF0DE3B4D2A24E16A532 +SHA256: 95E62E0D347A80C8A9CD4979D6F6BE8B302A12424A888410025E9AAB8BD504B2 Signature for ISO image: https://github.com/Security-Onion-Solutions/securityonion/raw/master/sigs/securityonion-2.3.190-20221207.iso.sig @@ -41,7 +41,7 @@ gpg --verify securityonion-2.3.190-20221207.iso.sig securityonion-2.3.190-202212 The output should show "Good signature" and the Primary key fingerprint should match what's shown below: ``` -gpg: Signature made Wed 07 Dec 2022 09:44:10 AM EST using RSA key ID FE507013 +gpg: Signature made Wed 07 Dec 2022 02:36:23 PM EST using RSA key ID FE507013 gpg: Good signature from "Security Onion Solutions, LLC " gpg: WARNING: This key is not certified with a trusted signature! gpg: There is no indication that the signature belongs to the owner. diff --git a/sigs/securityonion-2.3.190-20221205.iso.sig b/sigs/securityonion-2.3.190-20221205.iso.sig new file mode 100644 index 0000000000000000000000000000000000000000..91fb01e4170778980973c2d1f7025747847bcc17 GIT binary patch literal 543 zcmV+)0^t3L0vrSY0RjL91p;G^Dir_<2@re`V7LBIa1&&}5C1?@mkx(y9Z1ci2Jpu< zu04bV>w3KV9Mqh?|8AMgykCfqynBq({ z!?AnFM6?noQjTn8I1^jnLgZ*|EsJ9pz21wC9f+6!D2Nl6Z6ErmTZMjK#OFMa-XlhU zlnPk~Pv#c1MEgI#8bir`*>(WTA%{_pum^(p1thEa^KQ&+sn&g{{iC{Z#WSx z;(gR-$U=V*l9J_u0AzkBGHS04_EDM`K_O}=Mg}f)$FVO;ZF^%n(Xzp<)HT>s5w_jX h%IIKY;mt>OU<o))j2@re`V7LBIa1)r(5C3=ffjar*O05zW4ovi1 zSKjx|WfGvnN<>rcB4HGGILnbE%ll+KmzBAiTuUaQ8^+$PqmkhO7MmpL8$Sms#rO5%Hg>L4RnyAdkL!v5) z;QvF?E=k-T8ITktf%8ty86@`2=3MftKy;IcDjkwFg~KX!KP h9&F|!dGuf2xelH9WLXUNK!OLaGyQCOEF9g zp>7RR<@$-h=qWX-LV$EuYhoWJ{fl{PHR`>K+2Sc8o|+5EV1s>f=fC_vF7RM@4Bu8s zd}-o;!yIYg^Q!uMf%FzVHox&3X&<>y+xncfcT?<%x@E1Ee__ImdAa`ms%9_r8_hSh%Jx{ZglYwA9WSnp-U^AG^p8s=s> zy#=~}WGX*Hvwh(>Nm&6T?U@8~BPsm&3)S^?j@pOY(?1r@-eYid6Bbg#0Dkp_d0{L?jgf8hHIx;J=-{`2AeLw4W(*ezvx=z