Nieuws:

Welkom, Gast. Alsjeblieft inloggen of registreren.
Heb je de activerings-mail niet ontvangen?

Auteur Topic: [OPGELOST]fail2ban  (gelezen 668 keer)

[OPGELOST]fail2ban
« Gepost op: 2013/09/05, 07:56:29 »
Bij het configureren van fail2ban lees ik op https://www.digitalocean.com/community/articles/how-to-protect-ssh-with-fail2ban-on-centos-6 het volgende:


The default fail2ban configuration file is location at /etc/fail2ban/jail.conf. The configuration work should not be done in that file, however, and we should instead make a local copy of it.
cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
After the file is copied, you can make all of your changes within the new jail.local file. Many of possible services that may need protection are in the file already. Each is located in its own section, configured and turned off.

Vraag: Betekent dit dat jail.local een hogere prioriteit heeft dan jail.conf  om instelling in te lezen ?
« Laatst bewerkt op: 2013/09/05, 12:05:23 door henkoegema »
Miscere utile dulci. (Ter leering ende vermaeck)
http://henk.oegema.com  (Op RaspberryPi2)
Registered linux user 520520.  In gebruik: Ubuntu  22.04.4 Hobby's: Radio Amateur callsign: PA2HO.  Interesses: Raspberry Pi & Arduino & Jetson Nano (voor AI & ML)

Offline Johan van Dijk

  • Administrator
    • johanvandijk
Re: fail2ban
« Reactie #1 Gepost op: 2013/09/05, 08:50:47 »
Dit werkt in Ubuntu hetzelfde:
Citaat van: jail.conf
# This file was composed for Debian systems from the original one
#  provided now under /usr/share/doc/fail2ban/examples/jail.conf
#  for additional examples.
#
# To avoid merges during upgrades DO NOT MODIFY THIS FILE
# and rather provide your changes in /etc/fail2ban/jail.local


En van http://www.fail2ban.org/wiki/index.php/MANUAL_0_8#Configuration
Citaat
Every .conf file can be overridden with a file named .local. The .conf file is read first, then .local, with later settings overriding earlier ones. Thus, a .local file doesn't have to include everything in the corresponding .conf file, only those settings that you wish to override.

Ik heb hier ook gewoon een kopie gemaakt en in het nieuwe bestand wat dingetjes veranderd.

Mocht je de UFW firewall in Ubuntu gebruiken, dan heb je hier een voorbeeld die ik op mijn computer gebruik:

jail.local:
[ssh]

enabled  = true
banaction = ufw-ssh
port     = ssh
filter   = sshd
logpath  = /var/log/auth.log
maxretry = 6

action.d/ufw-ssh.conf:
[Definition]
actionstart =
actionstop =
actioncheck =
actionban = ufw insert 1 deny from <ip> to any app OpenSSH
actionunban = ufw delete deny from <ip> to any app OpenSSH

Re: fail2ban
« Reactie #2 Gepost op: 2013/09/05, 11:49:15 »
Dank je Johan.  Dat bevestigt inderdaad wat ik al vermoedde.
Miscere utile dulci. (Ter leering ende vermaeck)
http://henk.oegema.com  (Op RaspberryPi2)
Registered linux user 520520.  In gebruik: Ubuntu  22.04.4 Hobby's: Radio Amateur callsign: PA2HO.  Interesses: Raspberry Pi & Arduino & Jetson Nano (voor AI & ML)