No description
| .gitignore | ||
| autofw.c | ||
| CMakeLists.txt | ||
| LICENSE | ||
| matcher.c | ||
| matcher.h | ||
| pbuf.c | ||
| pbuf.h | ||
| README.md | ||
| vbuf.c | ||
| vbuf.h | ||
AutoFW
This tool is inspired by fail2ban.
Assumes UFW for now.
Building
On Ubuntu: apt-get install -y cmake libpcre2-dev
cmake . make
Usage
- Create a file autofw.whitelist, containing IP addresses and ranges that should always be allowed to connect.
- Collect all IP addresses and ranges to block into a new file, say
autofw.badips. It may be a good idea to filter out entries in the whitelist. - Run
ufw insert 1 deny from $ipfor each entry inautofw.badips. The ufw tool will automatically ignore duplicates. - Collect all blacklisted addresses using the following command:
ufw status verbose | grep DENY | awk '{print $4}' > autofw.blacklist - Run
./autofw > ufw.updates. - Run the
ufw.updatesscript.