Threat feed / Open-source, Linux, BSD and host firewalls / Script or API
Block attackers on firewalld with the ACIDRIPP feed
A small scheduled script or an API call keeps the list up to date. The feature is called ipsets (--new-ipset, --add-entries-from-file) bound to the drop zone as a source.
The address to use
https://cybersecurity.acidripp.com/feed/block/strict.plain
This is the strict list: addresses that got into our decoys, ran commands there or brought malware in the last 14 days. It is small and safe to block. For more coverage, replace strict in the address with standard (also addresses that tried passwords) or wide (also every scanner). What each list holds, and every format, is on the threat feed page.
Before you start
| Product | firewalld |
|---|---|
| What it accepts | ip, cidr, ipv6 |
| File format | For --add-entries-from-file the man page says: "The file should contain an entry per line. Lines starting with an hash or semicolon are ignored. Also empty lines." Use type hash:net for CIDR, hash:ip for single addresses. |
| Limits | not documented by firewalld; the ipset option maxelem applies (ipset default 65536), set it with --option=maxelem=N |
| Needs | firewalld with ipset support (list types with firewall-cmd --get-ipset-types). |
Add the feed
# one-time setup (options are from firewall-cmd(1))
firewall-cmd --permanent --new-ipset=feedblock --type=hash:net --option=maxelem=1000000
firewall-cmd --permanent --zone=drop --add-source=ipset:feedblock
firewall-cmd --reload
#!/bin/sh
# /usr/local/sbin/feedblock-firewalld.sh - composed by us; applies only the difference, so the set is never emptied
set -eu
URL="https://cybersecurity.acidripp.com/feed/block/strict.plain"; S=feedblock; D=$(mktemp -d); trap 'rm -rf "$D"' EXIT
curl -fsS --max-time 60 -o "$D/raw" "$URL"
grep -E '^[0-9]{1,3}(\.[0-9]{1,3}){3}(/[0-9]{1,2})?$' "$D/raw" | sort -u > "$D/new" || true
[ -s "$D/new" ] || { echo "feed empty or unreachable, keeping current set" >&2; exit 1; }
firewall-cmd --ipset=$S --get-entries | sort -u > "$D/old"
comm -13 "$D/old" "$D/new" > "$D/add"
comm -23 "$D/old" "$D/new" > "$D/del"
if [ -s "$D/add" ]; then
firewall-cmd -q --ipset=$S --add-entries-from-file="$D/add"
firewall-cmd -q --permanent --ipset=$S --add-entries-from-file="$D/add"
fi
if [ -s "$D/del" ]; then
firewall-cmd -q --ipset=$S --remove-entries-from-file="$D/del"
firewall-cmd -q --permanent --ipset=$S --remove-entries-from-file="$D/del"
fi
# cron: */5 * * * * root /usr/local/sbin/feedblock-firewalld.sh
# IPv6: second ipset created with --family=inet6 (firewall-cmd --permanent --new-ipset=feedblock6 --type=hash:net --family=inet6)
Block with it
- firewall-cmd --permanent --zone=drop --add-source=ipset:feedblock binds the set to the drop zone ("Any incoming network packets are dropped, there is no reply").
- Alternative shown by the firewalld project: firewall-cmd --add-rich-rule='rule source ipset=feedblock drop'.
Good to know
- From firewall-cmd(1): --new-ipset (permanent only), --add-entries-from-file, --remove-entries-from-file, --get-entries, --add-source=ipset:NAME, --reload. The diff script is ours.
- firewalld has no swap; the script adds and removes only the difference so the set is never empty. Entries already present only produce a warning.
- Do not create the set with a timeout option: firewalld then cannot list its entries.
- A new permanent ipset is usable at runtime only after firewall-cmd --reload.
- The drop zone only covers incoming traffic from those sources.
What we could not confirm
- Not executed on a host; the output format of --get-entries (one entry per line) is assumed.
- Speed of --add-entries-from-file with very large files was not measured.
Sources
- https://firewalld.org/documentation/man-pages/firewall-cmd.html
- https://firewalld.org/documentation/man-pages/firewalld.ipset.html
- https://firewalld.org/2015/12/ipset-support
- https://firewalld.org/documentation/zone/predefined-zones.html
Most steps were checked against the vendor's documentation; the points above were not on 30 November 2026. They were not tested on a device: menus move between versions, so check against your own. Found a mistake? Write to audit@acidripp.com. The feed comes with no guarantee; test before you block production traffic.