I want to credit @jon who came up with all the steps in this thread
I recently discovered Threatfox Suricata rules, a promising source of Indicators of Compromise. The only downsides is around 30 MB of rules which ends up being too memory intensive on a lot of security appliances.
Since Threatfox Suricata rules take up to 2GB of physical RAM when applied in IPFire IPS., I want to test the RPZ method that @Jon perfected for DoH blocking.
Quote from Threatfox: By using an DNS Reponse Policy Zone (RPZ), also known as DNS firewall, you can block the resolution of certain domain names ovserved in the past 6 month on your DNS resolver.
Header of the RPZ file
$TTL 30 @ SOA rpz.threatfox.abuse.ch. hostmaster.threatfox.abuse.ch. 2402061856 300 1800 604800 30 NS localhost. ; ; ThreatFox Response Policy Zones (RPZ) ; Last updated: 2024-02-06 18:56:40 (UTC) ; ; Terms Of Use: https://threatfox.abuse.ch/faq/#tos/ ; For questions please contact threatfox [at] abuse.ch
This database is being updated every 5 minutes (300 seconds)
Step 1)
A new directory is needed. Enter the command:
mkdir -v -p -m757 /etc/unbound/zonefiles
Now edit a new configuration file:
nano /etc/unbound/local.d/threatfox.conf
Step 2)
And add these lines:
server:
module-config: "respip validator iterator"
rpz:
name: threatfox
#zonefile: zonefiles/threatfox.zone
zonefile: /etc/unbound/zonefiles/block.threatfox.rpz.zone
url: https://threatfox.abuse.ch/downloads/threatfox.rpz
rpz-action-override: nxdomain
rpz-log: yes
rpz-log-name: threatfox
To check for issues in the config file, run the command on IPFire:
unbound-checkconf
Step 3)
Restart unbound to load config file:
/etc/init.d/unbound restart
Step 4)
Wait for 5-6 minutes for the zonefiles to be downloaded to
/etc/unbound/zonefiles/block.threatfox.rpz.zone