I would like to congratulate @ms and all the people that have contributed to the libloc project, which is getting some overdue recognition from Debian and Fedora project. Hopefully sometime soon it will be in Arch Linux and all the other popular distributions.
Yes, I concur:
Yet, I am not really sure about how to use it. Blocking countries is already part of IPFire so I guess this may be for a more specialized and security related scenario…? Maybe if I have a server on DMZ?
It’s a library that is built into IPFire.
It was just created in a way to make it a library that anyone that wanted to work with location information could use.
This replaced Maxmind geoip which used to provide that information but they changed their terms and conditions so that to get access to the maxmind geoip database you had to have an account with maxmind.
The IPFire devs created Libloc to overcome that issue and it is general enough that bothers are using it.
Here is the blog post about the changeover.
and for those interested a blog post on how libloc works.
There’s also an IPFire web page showing how to use it.
I’m wondering if there’s anyone in our community who would be willing to submit a post to Hacker News about libloc, including links to both of those blog posts.
I don’t have an account on any social media platform, except for YouTube. I only follow Hacker News as a lurker, so I’m unable to do this myself.
I already messaged a link of the blog entry to all my colleges who are using debian or fedora so it will spread and gets attention
My latest version on Banish uses libloc to block on ASN as well as IP Address, CIDR and FQDN and adds a useful cgi set-up page to the IPFire menu and integrates into the IP Address Blocklists feature.
It is available from:
******* Banish-002.tar.gz ********
Requirements IPFire 2.27 (x86_64) - Core-Update 170 or later.
This version of Banish adds the facility to block on Autonomous System
Number (ASN) as well as the earlier method of IP Address, CIDR or FQDN.
Banish-002 uses the location database to derive the ip address associated
with an ASN and combines these addresses with the other entries in the Banish
blocklist in an ipset to generate a blocklist for ipblocklist
This version is compatible with Banish-001 but make sure you backup:
if upgrading from Banish-001
As extraction of ip addresses from the location database is slow they are
cached in /var/ipfire/Banish/cache and the location database is checked hourly for
updates and if changed the banish blocklist is updated with any new entries. This
usually occurs once per week.
The ASN of a network can be found from a whois command or by interrogating
the location database from the command line with “location lookup ip-address”.
The ASN can then be entered into ‘Banished Resource’ window (as ASxxxxx)
along with any remark if required and will be entered into to the Banish blocklist
with the ‘add button’. The entry will become active on the next IP-blocklist update
which is run every 15 minutes.
Banish-002 will add the following new files to IPfire:
These IPFire files are modified:
To install… Download Banish-002.tar.gz to /tmp
Extract the tar file using “tar -xvf banish-xxx.tar.gz -C /”
Regenerate the language cache with “update-lang-cache”
Note 1: this is an add-on for IP Address Blocklists and the Banish
blocklist needs to be enabled in the IP Address Blocklists menu and the firewall
rule-set reloaded with the “Apply Changes” button in the “Firewall Rules” menu.
Note 2: Banish entries are are updated every 15 minutes when IP-based
blocking is updated.
I’m not sure how useful the add-on will be to others but on my system it functions as a major spam blocking facility along with IP Address Blocklists and Location Block.