/nft-rulesets

Repository to store a script that downloads and prepare GeoIP database to be used with nftables rulesets.

Primary LanguageShellGNU General Public License v3.0GPL-3.0

nft-rulesets

License: GPL v3

Purpose

Repository to store a script and all details that downloads and prepare GeoIP database to be used with nftables rulesets I found an awesome script on the WireFalls Github. 👋

the idea was brilliant.:+1:

Because we don't need any other script interpreter than bash.

But this script was using the GeoIP database from db-ip.com. And I wasn't happy for that for several reasons.

  1. I already use the free Maxmind GeoIP database with nginx
  2. I prefer the Maxmind GeoIP database. I believe that it's one of the most accurate one, and all subnets are written in CIDR mode, and I personnally think it's clearer, this way

Description

What this script is doing ? 🐧

  1. Checks that all the programs that the script use can be accessed.
  2. Create a small RamDrive to store its temporaries files to avoid storing data on HardDisks this increase spead.
  3. Downloads the Maxmind Database GeoLite2-Country in csv format for IPv4 and IPv6. and checks that the SHA256 checksumms are correct.
  4. Correlates the data to create files for selected countries. Selected countries have to be mentionned according to their ISO code. See this webpage for further details.
  5. Create an archive files of the selected countries and store them on disk.
  6. All steps are well logged and described.

Future evolutions. ⚙️

The script is at his first stage. It hasn't reached a number to be considered as stable enough.

In a near future I plan to add some new features, like the following ones :

  • Taking in consideration the parameters defined in a configuration file.
  • Taking in consideration command line arguments. ✅
  • Setup the nft rules. ✅
  • And other ideas that will come when the script evolves.

What do I expect from you ❔

  • Test this script.
  • Comment, improve it
  • Share your ideas.
  • Fork this repository
  • Add a Star to this repository

Thanks for your help.:pray: