Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

debian 10 - fail2ban - aucune règle dans iptables ?

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
Didier100
Posts: 3
Joined: 2010-08-12 18:44

debian 10 - fail2ban - aucune règle dans iptables ?

#1 Post by Didier100 »

Bonjour,

Je viens d'installer une Debian 10 sur un serveur virtuel (Proxmox) qui tourne pour le moment en local.
C'est un serveur de test pour me familiariser avec Debian 10.

J'ai installé fail2ban

Code: Select all

sudo apt-get install fail2ban
puis j'ai fait un test en lancent la commande

Code: Select all

sudo iptables -L -n
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
En voulant modifiér le /etc/fail2ban/jail.conf j'ai lu qu'il ne faut pas modifier ce fichier

# YOU SHOULD NOT MODIFY THIS FILE.

et j'ai ainsi crée le fichier jail.local

Code: Select all

sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
j'ai édité ensuite le fichier jail.local

Code: Select all

sudo vim /etc/fail2ban/jail.local
et modifié une partie du code
[sshd]

# To use more aggressive sshd modes set filter parameter "mode" in jail.local:
# normal (default), ddos, extra or aggressive (combines all).
# See "tests/files/logs/sshd" or "filter.d/sshd.conf" for usage example and details.
#mode = normal
enabled = true
port = ssh
logpath = %(sshd_log)s
backend = %(sshd_backend)s


[dropbear]
enabled = true
port = ssh
logpath = %(dropbear_log)s
backend = %(dropbear_backend)s


[selinux-ssh]

port = ssh
logpath = %(auditd_log)s
Puis j'ai redémarré fail2ban comme suite

Code: Select all

sudo fail2ban-client restart
En exécutant

Code: Select all

sudo iptables -L -n
j'ai toujours:
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Aucune règle à été transcrite dans iptables!

La command suivante

Code: Select all

sudo fail2ban-client status
m'affiche
Status
|- Number of jail: 2
`- Jail list: dropbear, sshd
On voit donc bel et bien que les deux règles ont été prise en compte en tout cas par fail2ban ...


La commande

Code: Select all

apt-cache policy iptables 
donne
iptables:
Installé : 1.8.2-4
Candidat : 1.8.2-4
Table de version :
*** 1.8.2-4 500
500 http://deb.debian.org/debian buster/main i386 Packages
100 /var/lib/dpkg/status

et la commande

Code: Select all

apt-cache policy nftables 
donne
nftables:
Installé : (aucun)
Candidat : 0.9.0-2
Table de version :
0.9.0-2 500
500 http://deb.debian.org/debian buster/main i386 Packages
Ma question: Que doit je faire pour que fail2ban me permet de transcrire / créer des règles dans iptables?

Merci d'avance pour votre aide :wink:



Post Reply