tudasbazis:linux:fail2ban
Tartalomjegyzék
fail2ban
Egy file-t csak egy jail-hez adjunk meg, mert nem minden esetben kezeli jól a fail2ban
Ha van logrotate beállítva az ellenőrzött fájlra, érdemes annak idejét kibővíteni a fail2ban általi bann-time-ra
Telepítés
- Csomag telepítése:
apt-get install fail2ban - Program beállítása:
- /etc/fail2ban/jail.conf
[DEFAULT] # "ignoreip" can be an IP address, a CIDR mask or a DNS host ignoreip = 127.0.0.1/8 192.168.0.0/16 # "bantime" is the number of seconds that a host is banned. # 86400 s = 1 day bantime = 86400 ... # A host is banned if it has generated "maxretry" during the last "findtime" # seconds. # 604800 s = 7 days findtime = 604800 maxretry = 10 ... destemail = foo@bar.com ... # Choose default action. To change, just override value of 'action' with the # interpolation to the chosen action shortcut (e.g. action_mw, action_mwl, etc) in jail.local # globally (section [DEFAULT]) or per specific section action = %(action_)s ... # majd a fájl többi részén a szolgáltatások engedélyezése / tiltása
- Hasznos, bekapcsolandó szolgáltatások:
sshssh-ddosapacheapache-overflowspostfixdovecot
- Beállítások életbeléptetése:
service fail2ban restart
Munin modul
- Munin plugin telepítése:
ln -s /usr/share/munin/plugins/fail2ban /etc/munin/plugins/ echo -n " [fail2ban] user root " >> /etc/munin/plugin-conf.d/munin-node
- Munin plugin tesztelése:
munin-run fail2ban - Változások életbeléptetése:
service munin-node restart
Állapot lekérdezése
fail2ban-client status fail2ban-client status mail fail2ban-client status dovecot
Regexek tesztelése
fail2ban-regex /var/log/mail.log /etc/fail2ban/filter.d/postfix.conf
tudasbazis/linux/fail2ban.txt · legutóbbi módosítás: – Szerkesztő: tia
