OPNsense Forum

English Forums => Documentation and Translation => Topic started by: thatso on April 23, 2024, 12:43:20 AM

Title: Spamhaus DROP and eDROP became a single list
Post by: thatso on April 23, 2024, 12:43:20 AM
Spamhaus DROP and eDROP to become a single list (https://www.spamhaus.org/resource-hub/network-security/spamhaus-drop-and-edrop-to-become-a-single-list/), effective April 10th, 2024.
The docs (https://docs.opnsense.org/manual/how-tos/edrop.html) should be updated accordingly.
Title: Re: Spamhaus DROP and eDROP became a single list
Post by: RamSense on April 23, 2024, 09:46:08 PM
thanks for sharing.
Title: Re: Spamhaus DROP and eDROP became a single list
Post by: Beehive on May 24, 2024, 07:55:56 AM
Spamhaus.org are also publishing the files as json data.
Bash script to convert the json to text. You can then host this on a web server and update your alias content links.

(Modify the variables to suit your needs)


#!/usr/bin/env bash

#
# Script to download Spamhaus IPv4 and IPv6 DROP list
# This script converts the json to a text file.
#

main() {
    local url="https://www.spamhaus.org/drop/drop_v4.json"
    local urlv6="https://www.spamhaus.org/drop/drop_v6.json"
    local output_file="/www/opnsense/spamhaus-drop_v4.txt"
    local output_filev6="/www/opnsense/spamhaus-drop_v6.txt"

    curl -s $url | jq -r 'select(.cidr != null) | .cidr' >$output_file
    curl -s $urlv6 | jq -r 'select(.cidr != null) | .cidr' >$output_filev6
}

main

# Optional
# echo -e "IP addresses have been extracted:\nIPv4: $output_file\nIPv6: $output_filev6"


Hopefully, someone will find this useful.


Cheers!