Since my home server not intended for use by any people outside of my city (plus some VPN endpoints in other countries) — it is ok to ban some unwanted countries and cities from which I don't expect anything good, except attempts to hack my box to use my resources or set me up :drgn_sigh: .

So I added some GeoIP blocking to the npf with script to update GeoIP list — I blocked China, Iran, North Korea, etc and Moscow (because there are a lot of government and commercial backed bots coming from here). Results are good — the bots don't disappeared completely but the speed of adding new IPs to the blacklist is decreased :drgn_happy_blep:

Sadly, I was unable to add USA and UK to the list, because looks like there are some limits (not found how to increase them :drgn_flat_sob: ), which disallows to load a lot of CIDRs for these countries to the blacklist.

Graph of the count of banned IPs per week. There are two red tangents on the two points — before and after the GeoIP bans were enabled. And the two red lines, parallel to the X axis.
The resulting derivatives are 0.59 and 0.38, so the speed of raising the values (count of blocked bots) are decreased.Part of the script to update npf blacklists. Script contents:

# List of blocked countries:
# AE - United Arab Emirates
# AF - Afganistan
# BY - Belarus
# CN - China
# CU - Cuba
# HK - Hong Kong
# HU - Hungary
# IR - Iran
# KP - North Korea
# KW - Kuwait
# PK - Pakistan
# PS - Palestine
# TW - Taiwan
# UA - Ukraine
/usr/pkg/bin/curl --connect-timeout 30 --fail --interface re0 --ipv4 --silent \
        --retry 3 --retry-connrefused --retry-delay 5 --retry-max-time 90 \
        --show-error --proxy http://127.0.0.1:20172 \
        -o - "$GEOIP_COUNTRIES_SOURCE" | \
        /usr/bin/egrep '^[0-9.,]+((AE)|(AF)|(BY)|(CN)|(CU)|(HK)|(HU)|(IR)|(KP)|(KW)|(PK)|(PS)|(TW)|(UA))$' | \
        /usr/bin/awk -F, '{ print $1, "-", $2 }' | \
        /usr/pkg/bin/iprange > /usr/share/npf/blacklist.countries.new
if [ "$?" -ne "0" ]; then
        echo "Failed to update countries blacklist"
        rm -f /usr/share/npf/blacklist.netset.new \
                /usr/share/npf/blacklist.countries.new
        exit 3
fi

# List of blocked cities:
# Moscow
/usr/pkg/bin/curl --connect-timeout 30 --fail --interface re0 --ipv4 --silent \
        --retry 3 --retry-connrefused --retry-delay 5 --retry-max-time 90 \
        --show-error --proxy http://127.0.0.1:20172 \
        -o - "$GEOIP_CITIES_SOURCE" | \
        gzip -d | \
0

If you have a fediverse account, you can quote this note from your own instance. Search https://mastodon.bsd.cafe/users/evgandr/statuses/116008337274418941 on your instance and quote it. (Note that quoting is not supported in Mastodon.)