niedziela, 27 listopada 2016

Crontab with iptables

I created a small code in bash to check for any new requests in Apache's logs. Found IP(s) will be blocked by iptables.

Maybe you will find it useful ;)

The code looks like this:





Next thing was to add one line to the end of the crontab:



Logs you will receive will be similar to those below:



To collect some statistics, I also added 'host' command... but you already saw that in the code. ;)


Also you will find some details in /var/log/fw* files generated (by cron):



Maybe you will find it useful.

Cheers!

Brak komentarzy:

Prześlij komentarz