Skip to content

LiinxTV/fail2ban-monitoring

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 

Repository files navigation

Features

  • Real-time database updates.
  • Easy to install to your server.
  • Powerfull and cost less resources.
  • Compatible with most GNU distributions.

Requierements:

Installation:

I can't believe that you don't have fail2ban installed on your server. If you don't have it, please go to (https://doc.ubuntu-fr.org/fail2ban)

Required:

Optional:

To install:

Shell part:

sudo git clone https://github.com/LiinxTV/fail2ban-monitoring.git
cd fail2ban-monitoring
mv fail2ban-monitoring.sh /usr/bin/fail2ban-monitoring.sh

Warning, before installing, make sure to have the alias in your ~/.bashrc:

echo "alias f2bm='sh /usr/bin/fail2ban-monitoring.sh'" >> ~/.bashrc
source ~/.bashrc

You need to add this to your /etc/mysql/conf.d/mysql.cnf

sudo nano /etc/mysql/conf.d/mysql.cnf

[mysqld]
sql_mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"

Then finally install it:

f2bm install

NOTE: if you want to import your actual fail2ban list to the database, just run f2bm import

If you want to see if f2bm is correctly installed, just run:

f2bm debug

Grafana setup:

First, add a data source:

Fill the form like this:

Grafana part 2 - The dashboard:

Select grafana.json and finish the import process.

Nice, you're done !

Configuration:

• You must define action event to your JAILs. Exemple configuration of SSHD jail:

[sshd]
port    = ssh
logpath = %(sshd_log)s
backend = %(sshd_backend)s
action = grafana

About

Grafana dashboard for monitoring fail2ban

Resources

Stars

Watchers

Forks

Languages