This is a reply that I will edit and update, but here is my config:
Conf Files:
/root/suricata/update.yaml:
disable-conf: /root/suricata/disable.conf
enable-conf: /root/suricata/enable.conf
drop-conf: /root/suricata/drop.conf
modify-conf: /root/suricata/modify.conf
ignore:
- "*deleted.rules"
sources:
- https://www.snort.org/rules/snortrules-snapshot-29111.tar.gz?oinkcode=aaaaaaaaaaaaaa(redacted)aaaaaaaaaaaaaaaaaaaaaa
local:
- /root/suricata/homelab.rules
/root/suricata/disable.conf (huge file, this will be a summary):
4585 sid:gid lines
11 re “string” lines
/root/suricata/enable.conf:
2006408
/root/suricata/drop/conf:
# Empty file
/root/suricata/modify.conf:
2006408 "\\$HOME_NET" "\\[\\$HOME_NET, \\!\\$INTERNAL_DEVICELIST\\]"
/root/suricata/threshold.in:
suppress gen_id 0, sig_id 0, track by_dst, ip 10.30.0.8
suppress gen_id 1, sig_id 0, track by_dst, ip 10.30.0.8
/root/suricata/homelab.rules (converted from threshold, and convert/testing these on the ‘suricata.yaml’/‘custom.yaml’ netmap bpf line):
alert ip 10.30.14.0/24 any -> any any (msg:"Network is life - Network"; bypass; sid:1000000; rev:1;)
alert ip 10.30.5.5 any -> any any (msg:"Network is life - Host"; bypass; sid:1000001; rev:1;)
alert ip 10.30.5.4 any -> any any (msg:"Network is life - Host"; bypass; sid:1000002; rev:1;)
alert ip 10.30.5.3 any -> any any (msg:"Network is life - Host"; bypass; sid:1000003; rev:1;)
alert ip 10.30.10.16 any -> any any (msg:"Network is life - Host"; bypass; sid:1000004; rev:1;)
alert ip 10.30.10.1 any -> any any (msg:"Network is life - Host"; bypass; sid:1000005; rev:1;)
alert ip 10.30.10.36 any -> any any (msg:"Network is life - Host"; bypass; sid:1000006; rev:1;)
alert ip 10.30.1.3 any -> any any (msg:"Network is life - Host"; bypass; sid:1000007; rev:1;)
alert ip 10.30.10.62 any -> any any (msg:"Network is life - Host"; bypass; sid:1000008; rev:1;)
alert ip 10.30.1.33 any -> any any (msg:"Network is life - Host"; bypass; sid:1000009; rev:1;)
State / Tool Output:
Output from suricata-update list-enabled-sources --config /root/suricata/update.yaml --suricata-conf /usr/local/etc/suricata/suricata.yaml --suricata /usr/local/bin/suricata --data-dir /usr/local/etc/suricata:
26/11/2024 -- 14:07:14 - <Info> -- Loading /root/suricata/update.yaml
26/11/2024 -- 14:07:14 - <Info> -- Using /usr/local/share/suricata/rules for Suricata provided rules.
26/11/2024 -- 14:07:14 - <Info> -- Found Suricata version 7.0.7 at /usr/local/bin/suricata.
From modify.conf:
- https://www.snort.org/rules/snortrules-snapshot-29111.tar.gz?oinkcode=aaaaaaaaaaaaaa(redacted)aaaaaaaaaaaaaaaaaaaaaa
Local files/directories:
- /root/suricata/homelab.rules
Enabled sources:
- abuse.ch/feodotracker
- malsilo/win-malware
- abuse.ch/urlhaus
- aleksibovellan/nmap
- et/open
- oisf/trafficid
- pawpatrules
- tgreen/hunting
- abuse.ch/sslbl-c2
- abuse.ch/sslbl-ja3
- ptrules/open
- etnetera/aggressive
- abuse.ch/sslbl-blacklist
- stamus/lateral
A Shell script named “suricataupdate.sh” will start the suricata-update process and output the standard out and error out to the log file ‘suricata-update.log’, thus this command gives an idea about run time:
Output from head suricata-update.log && tail suricata-update.log && grep Disabling suricata-update.log | wc -l:
26/11/2024 -- 14:54:16 - <Info> -- Loading /root/suricata/update.yaml
26/11/2024 -- 14:54:16 - <Debug> -- Setting configuration value subcommand -> update
26/11/2024 -- 14:54:16 - <Debug> -- Setting configuration value verbose -> True
26/11/2024 -- 14:54:16 - <Debug> -- Setting data directory to /usr/local/etc/suricata
26/11/2024 -- 14:54:16 - <Debug> -- Setting configuration value config -> /root/suricata/update.yaml
26/11/2024 -- 14:54:16 - <Debug> -- Setting configuration value suricata-conf -> /usr/local/etc/suricata/suricata.yaml
26/11/2024 -- 14:54:16 - <Debug> -- Setting configuration value suricata -> /usr/local/bin/suricata
26/11/2024 -- 14:54:16 - <Debug> -- Setting configuration value version -> False
26/11/2024 -- 14:54:16 - <Debug> -- Setting configuration value show-advanced -> False
26/11/2024 -- 15:26:09 - <Debug> -- Disabling: [1:2053531] ET TA_ABUSED_SERVICES Observed Commonly Actor Abused Online Service Domain (data-seed-prebsc-1-s2 .binance .org in TLS SNI)
26/11/2024 -- 15:26:09 - <Debug> -- Disabling: [1:2051746] ET TA_ABUSED_SERVICES Observed Commonly Actor Abused Online Service Domain (egnyte .com in TLS SNI)
26/11/2024 -- 15:26:09 - <Debug> -- Disabling: [1:2051743] ET TA_ABUSED_SERVICES DNS Query to Commonly Actor Abused Online Service (egnyte .com)
26/11/2024 -- 15:26:09 - <Debug> -- Disabling: [1:2053729] ET TA_ABUSED_SERVICES Commonly Actor Abused Online Service Domain (cdn .ethers .io)
26/11/2024 -- 15:26:09 - <Debug> -- Disabling: [1:2053730] ET TA_ABUSED_SERVICES Observed Commonly Actor Abused Online Service Domain (cdn .ethers .io in TLS SNI)
26/11/2024 -- 15:26:09 - <Debug> -- Disabling: [1:2046653] ET TA_ABUSED_SERVICES Commonly Abused File Sharing Domain (wasabi .com) in DNS Lookup
26/11/2024 -- 15:26:09 - <Debug> -- Disabling: [1:2052706] ET TA_ABUSED_SERVICES Observed Abused File Sharing/CRM Platform (pipedrive-files-*-pipedrive .com .s3 .* .amazonaws .com) in TLS SNI
26/11/2024 -- 15:26:09 - <Debug> -- Disabling: [1:2052634] ET TA_ABUSED_SERVICES DNS Query to Abused File Sharing/CRM Domain (flg .to)
26/11/2024 -- 15:26:09 - <Debug> -- Disabling: [1:2052635] ET TA_ABUSED_SERVICES DNS Query to Abused File Sharing/CRM Domain (getflg .com)
26/11/2024 -- 15:26:09 - <Debug> -- Disabling: [1:2052636] ET TA_ABUSED_SERVICES Observed Abused File Sharing/CRM Platform (flg .to in TLS SNI)
5382
Scripts:
/root/suricataupdate.sh
#!/bin/sh
# Get current date and time
TIMESTAMP=$(date +"%Y-%m-%d %H:%M:%S")
# Check if I am already running
if [ ! -e /root/suricata/inRunSuricataUpdate ]; then
touch /root/suricata/inRunSuricataUpdate
else
echo "$TIMESTAMP: I am already running... exiting."
exit 0 # Exit with a 0
fi
# Define file paths
ROOT_CUSTOM1="/root/suricata.rules"
SURICATA_CUSTOM1="/usr/local/etc/suricata/opnsense.rules/suricata.rules"
echo "$TIMESTAMP: Checking for rule updates..." > /root/suricatarules.log
script_name="rule-updater.py"
# Check if the script is running using ps
ps aux | grep "$script_name" | grep -v grep > /dev/null
if [ $? -eq 0 ]; then
echo "$TIMESTAMP: Script '$script_name' is already running." >> /root/suricatarules.log
exit 0 # Exit with a 0
else
echo "$TIMESTAMP: Script '$script_name' is not running. Proceeding..." >> /root/suricatarules.log
fi
script_name="installRules.py"
# Check if the script is running using ps
ps aux | grep "$script_name" | grep -v grep > /dev/null
if [ $? -eq 0 ]; then
echo "$TIMESTAMP: Script '$script_name' is already running." >> /root/suricatarules.log
exit 0 # Exit with a 0
else
echo "$TIMESTAMP: Script '$script_name' is not running. Proceeding..." >> /root/suricatarules.log
fi
cp /usr/local/etc/suricata/opnsense.rules/suricata.rules /root/suricata.rules
suricata-update --config /root/suricata/update.yaml --suricata-conf /usr/local/etc/suricata/suricata.yaml --suricata /usr/local/bin/suricata --data-dir /usr/local/etc/suricata --threshold-in=/root/suricata/threshold.in --threshold-out=/usr/local/etc/suricata/threshold.config --output /usr/local/etc/suricata/opnsense.rules -v --no-test --no-reload 2>&1 | tee /root/suricata-update.log
RESTART_NEEDED="NO"
# Check if files are identical
if cmp -s "$ROOT_CUSTOM1" "$SURICATA_CUSTOM1"; then
echo "$TIMESTAMP: $ROOT_CUSTOM1 Files are identical." >> suricatarules.log
else
echo "$TIMESTAMP: Rules file is different, restarting Suricata" >> /root/suricatarules.log
RESTART_NEEDED="YES"
fi
if [ "$RESTART_NEEDED" == "YES" ]; then
service suricata restart
echo "$TIMESTAMP: Suricata service restarted." >> /root/suricatarules.log
fi
# Removing run check
rm /root/suricata/inRunSuricataUpdate
exit 0
Please let me know if there is another detail / conf / log to add to this collection 
The custom.yaml if you are interested in it is in a related blog post here:
and I’m working this all across the OPNSense forum as well since you have to mod the environment just a little to get this level of functionality - the other unrelated shell script that allows this to take affect and keep the ‘custom.yaml’ and the rule-file as well in shape ( thankfully minimal mod necessary due to all the parameters that ‘suricata-update’ takes <3 ):