Debian 12 + Jeedom 4.5 : fail2ban-client: command not found

Bonjour @Mips,

J’ai réinstallé from scratch mon serveur pour passer de debian 11 à debian 12 avec jeedom 4.5 hier soir (+ restauration sauvegarde)

Depuis j’ai des warnings dans cron_execution :

0041|sudo: fail2ban-client: command not found
0045|PHP Warning:  include(): Failed opening '/var/www/html/plugins/fail2ban/vendor/composer/../psr/log/Psr/Log/LoggerAwareTrait.php' for inclusion (include_path='.:/usr/share/php') in /var/www/html/vendor/composer/ClassLoader.php on line 576

Je pensais relancé l’installation des dépendances du plugins mais je ne sais pas trop comment faire depuis l’interface.

Merci

Je préfère remonter le problème avant de lancer des commandes manuellement dans le shell.


Informations Jeedom

Core : 4.5 (master)
DNS Jeedom : non

Plugin : fail2ban
Version : 2025-08-11 01:13:26 (stable)

Informations complémentaires

Log du plugin:


0000|[2025-12-10 11:29:37] DEBUG  execute locally LC_ALL=C sudo fail2ban-client status | grep 'Jail list:' | awk -F ':' '{print $2}' | awk '{$1=$1;print}'
0001|[2025-12-10 11:29:37]WARNING No jails found
0002|[2025-12-10 11:29:37] DEBUG  refreshAllJails of Fail2Ban Jeedom
0003|[2025-12-10 11:29:37] DEBUG  execute locally LC_ALL=C sudo fail2ban-client status 'apache-botsearch'
0004|[2025-12-10 11:29:37] DEBUG  execute locally LC_ALL=C sudo fail2ban-client status 'apache-noscript'
0005|[2025-12-10 11:29:37] DEBUG  execute locally LC_ALL=C sudo fail2ban-client status 'apache-overflows'
0006|[2025-12-10 11:29:37] DEBUG  execute locally LC_ALL=C sudo fail2ban-client status 'sshd'
0007|[2025-12-10 11:29:37] INFO  Début d'activation du plugin
0008|[2025-12-10 11:29:38] INFO  Info sur le démon : {"launchable_message":"","launchable":"nok","state":"nok","log":"nok","auto":0}
0009|[2025-12-10 11:29:38] DEBUG  Lancement de : /var/www/html/core/class/../../core/php/jeePlugin.php  plugin_id=fail2ban function=install callInstallFunction=1
0010|[2025-12-10 11:30:11] DEBUG  refreshAllJails of Fail2Ban Jeedom
0011|[2025-12-10 11:30:11] DEBUG  execute locally LC_ALL=C sudo fail2ban-client status 'apache-botsearch'
0012|[2025-12-10 11:30:11] DEBUG  execute locally LC_ALL=C sudo fail2ban-client status 'apache-noscript'
0013|[2025-12-10 11:30:11] DEBUG  execute locally LC_ALL=C sudo fail2ban-client status 'apache-overflows'
0014|[2025-12-10 11:30:12] DEBUG  execute locally LC_ALL=C sudo fail2ban-client status 'sshd'
0015|[2025-12-10 11:40:04] DEBUG  refreshAllJails of Fail2Ban Jeedom
0016|[2025-12-10 11:40:04] DEBUG  execute locally LC_ALL=C sudo fail2ban-client status 'apache-botsearch'
0017|[2025-12-10 11:40:05] DEBUG  execute locally LC_ALL=C sudo fail2ban-client status 'apache-noscript'
0018|[2025-12-10 11:40:05] DEBUG  execute locally LC_ALL=C sudo fail2ban-client status 'apache-overflows'
0019|[2025-12-10 11:40:05] DEBUG  execute locally LC_ALL=C sudo fail2ban-client status 'sshd'
0020|[2025-12-10 11:46:55] DEBUG  Lancement de : /var/www/html/core/class/../../core/php/jeePlugin.php  plugin_id=fail2ban function=remove callInstallFunction=1
0021|[2025-12-10 11:46:57] DEBUG  execute locally LC_ALL=C sudo fail2ban-client status | grep 'Jail list:' | awk -F ':' '{print $2}' | awk '{$1=$1;print}'
0022|[2025-12-10 11:46:57]WARNING No jails found
0023|[2025-12-10 11:46:57] DEBUG  refreshAllJails of Fail2Ban Jeedom
0024|[2025-12-10 11:46:57] DEBUG  execute locally LC_ALL=C sudo fail2ban-client status 'apache-botsearch'
0025|[2025-12-10 11:46:57] DEBUG  execute locally LC_ALL=C sudo fail2ban-client status 'apache-noscript'
0026|[2025-12-10 11:46:57] DEBUG  execute locally LC_ALL=C sudo fail2ban-client status 'apache-overflows'
0027|[2025-12-10 11:46:57] DEBUG  execute locally LC_ALL=C sudo fail2ban-client status 'sshd'
0028|[2025-12-10 11:46:57] INFO  Début d'activation du plugin
0029|[2025-12-10 11:46:58] INFO  Info sur le démon : {"launchable_message":"","launchable":"nok","state":"nok","log":"nok","auto":0}
0030|[2025-12-10 11:46:58] DEBUG  Lancement de : /var/www/html/core/class/../../core/php/jeePlugin.php  plugin_id=fail2ban function=install callInstallFunction=1

@Mips, le warning c’est peut être un autre sujet car je l’ai aussi sur le plugin hydrao.

0321|PHP Warning:  include(/var/www/html/plugins/hydrao/vendor/composer/../psr/log/Psr/Log/LoggerAwareTrait.php): Failed to open stream: No such file or directory in /var/www/html/vendor/composer/ClassLoader.php on line 576
0322|PHP Warning:  include(): Failed opening '/var/www/html/plugins/hydrao/vendor/composer/../psr/log/Psr/Log/LoggerAwareTrait.php' for inclusion (include_path='.:/usr/share/php') in /var/www/html/vendor/composer/ClassLoader.php on line 576
0323|PHP Warning:  include(/var/www/html/plugins/fail2ban/vendor/composer/../psr/log/Psr/Log/LoggerAwareTrait.php): Failed to open stream: No such file or directory in /var/www/html/vendor/composer/ClassLoader.php on line 576
0324|PHP Warning:  include(): Failed opening '/var/www/html/plugins/fail2ban/vendor/composer/../psr/log/Psr/Log/LoggerAwareTrait.php' for inclusion (include_path='.:/usr/share/php') in /var/www/html/vendor/composer/ClassLoader.php on line 576

Bonjour

Si je me souviens bien, dans la documentation de Mips, il est dit que le plugin n’installe pas fail2ban et ne le configure pas.

Deuxième point Jeedom n’installe plus fail2ban comme dans les versions précédentes.

Donc il faut installer fail2ban avec la commande apt en CLI.

Fail2ban agit sur le firewall pour bannir les ip bannies.

Une discussion intéressante sur le choix du programme firewall:

1 « J'aime »

Super merci pour ton retour, j’avais pas vu ces infos et je comprend mieux.

J’ai lu rapidement, il faut installer fail2ban et iptables si j’ai tout suivi.

J’essaye ce soir de faire l’installation et je marquerai le sujet comme résolu.

Je le laisse ouvert si j’ai des questions et j’essaye de décrire ce que j’ai du faire pour que ça fonctionne si ça peut aider.

L’installation n’est pas si simple:

1- Installer fail2ban avec la commande apt
2- créer la règle (jail) pour Jeedom, fichier jeedom.conf dans /etc/fail2ban/jail.d

root@jeedom:/etc/fail2ban/jail.d# cat jeedom.conf
[DEFAULT]
#Ne pas bloque localhost ni s'auto-bloquer.
ignoreip = 127.0.0.1/8 192.168.1.0/24 192.168.0.0/24 10.0.0.0/8

# ban de  1 semaine
bantime  = 604800

# on regarde les attaques sur les 2 dernières heures. Les 5 minutes par défaut, ça ne marche plus, les pirates se sont adaptés
findtime = 7200
maxretry = 3

# on surveille tous les ports
banaction = iptables-multiport

# action a prendre: ban + log détaillé
action = %(action_)s

# Ne pas activer cette regle qui bloque l'accès a jeedom trop facile a cause d'erreur de type [access_compat:error] [pid 10800] [client 192.168.0.67:62801] AH01797: client denied by server configuration: /var/www/html/plugins/zigbee/core/config/devices/undefined, referer: http://192.168.0.49/index.php?v=d&p=zigbee&m=zigbee&id=189
[apache-multiport] 
enabled = true
port      = http,https
filter    = apache-auth
logpath   = /var/www/html/log/http*.error
maxretry  = 3

[apache-botsearch]
enabled   = true
port      = http,https
filter    = apache-botsearch
logpath   = /var/www/html/log/http*.error
maxretry  = 6

[apache-overflows]
enabled   = true
port      = http,https
filter    = apache-overflows
logpath   = /var/www/html/log/http*.error
maxretry  = 2

[apache-noscript]
enabled   = true
port      = http,https
filter    = apache-noscript
logpath   = /var/www/html/log/http*.error
maxretry  = 1

[apache-badbots]
port      = http,https
logpath   = /var/www/html/log/http*.error


Attention: J’ai modifié le fichier original, on peut le trouver sur le forum

3- Choisir le firewall iptables ou nftables
nftables est le firewall par défaut de Debian 12: voir la discussion citée dans le post précédent.
pour le paramétrage.

Si le choix se porte sur iptables il faut l’installer avec apt.

4- relancer le daemon: systemctl restart fail2ban
5- Vérifier fail2ban:

root@jeedom:/etc/fail2ban/jail.d# fail2ban-client status
Status
|- Number of jail:	5
`- Jail list:	apache-botsearch, apache-multiport, apache-noscript, apache-overflows, sshd
root@jeedom:/etc/fail2ban/jail.d# 

6- Pour une règle définie:

root@jeedom:/etc/fail2ban/jail.d# fail2ban-client status apache-noscript
Status for the jail: apache-noscript
|- Filter
|  |- Currently failed:	0
|  |- Total failed:	1991
|  `- File list:	/var/www/html/log/http.error
`- Actions
   |- Currently banned:	62
   |- Total banned:	62
   `- Banned IP list:	146.70.194.254 176.65.132.122 20.222.232.51 74.176.64.167 128.199.106.229 45.154.98.144 172.238.126.87 44.223.5.225 185.177.72.24 195.181.172.247 195.178.110.201 172.192.16.240 137.184.177.9 129.212.181.160 172.192.74.60 84.20.18.75 4.227.23.117 20.242.107.22 31.148.31.244 188.68.178.104 83.234.177.254 85.204.70.106 185.230.240.250 188.166.229.34 212.59.106.242 109.196.64.48 130.33.64.247 109.110.74.112 194.9.236.11 46.138.80.128 37.113.20.200 79.139.136.158 87.117.58.182 62.33.225.4 78.189.52.211 62.60.131.218 4.241.111.42 78.179.101.242 109.196.78.217 109.196.73.251 46.39.249.220 94.228.205.191 2.63.182.255 146.70.194.230 48.210.57.6 82.102.18.118 4.217.221.186 13.79.168.144 64.23.235.33 4.189.97.65 20.196.125.130 85.11.167.4 136.114.112.117 35.188.228.70 48.210.70.5 206.189.102.187 62.60.135.159 157.230.62.41 64.23.147.102 206.189.143.30 20.78.180.119 4.194.80.43
root@jeedom:/etc/fail2ban/jail.d# 

J’ai installé iptables, je ne savais pas que Debian 12 avait le firewall nftables par defaut.
Je dois me former dessus et basculer fail2ban dessus.

7- Vérification des adresses bannies du firewall iptables:

root@jeedom:/etc/fail2ban/jail.d# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
f2b-apache-multiport  tcp  --  anywhere             anywhere             multiport dports http,https
f2b-apache-noscript  tcp  --  anywhere             anywhere             multiport dports http,https

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

Chain f2b-apache-multiport (1 references)
target     prot opt source               destination         
REJECT     all  --  45.148.10.205        anywhere             reject-with icmp-port-unreachable
REJECT     all  --  62.60.135.159        anywhere             reject-with icmp-port-unreachable
REJECT     all  --  ec2-35-92-228-99.us-west-2.compute.amazonaws.com  anywhere             reject-with icmp-port-unreachable
REJECT     all  --  ec2-35-93-101-23.us-west-2.compute.amazonaws.com  anywhere             reject-with icmp-port-unreachable
REJECT     all  --  195.178.110.201      anywhere             reject-with icmp-port-unreachable
REJECT     all  --  ec2-18-175-242-34.eu-west-2.compute.amazonaws.com  anywhere             reject-with icmp-port-unreachable
REJECT     all  --  ec2-3-96-162-154.ca-central-1.compute.amazonaws.com  anywhere             reject-with icmp-port-unreachable
REJECT     all  --  ec2-13-58-250-47.us-east-2.compute.amazonaws.com  anywhere             reject-with icmp-port-unreachable
REJECT     all  --  ec2-35-182-118-195.ca-central-1.compute.amazonaws.com  anywhere             reject-with icmp-port-unreachable
1 « J'aime »

Bonjour,

Concernant iptables, fail2ban et config associés, effectivement le plugin ne s’en occupe pas, je ne vais pas revenir la dessus.

Mais je ne pense pas que le warning sur composer vienne de là.

Comment la migration a-t-elle été faite?
Install from scratch? Donc deb12 neuf, jeedom 4.5 neuf et … ? Restauration backup?

Essaies déjà de réinstaller le plugin depuis le market (sans désinstallation avant) pour être sur que tous les fichiers sont bien présents

Hello Mips, pas de problème j’avais pas vu que le plugin s’en occupais pas mais maintenant je le sais pas de problème.

La migration a été faite via une install from scratch debian 12.12 + jeedom 4.5 direct et restauration d’un backup jeedom 4.5 (que j’ai fais depuis mon ancien serveur debian 11)

Pour le moment j’ai pas réussi a configurer fail2ban (je vais essayer ce weekend) j’avais pas penser à la réinstallation depuis le market merci :slight_smile:
Je ferai un retour ensuite

edit :
Je n’ai plus de warning depuis la réinstallation depuis le market.
Il y a certainement qqch qui ne se restaure pas, j’ai pas pensé a faire un backup avant de le faire…

ok pas de soucis

en principe ca aurait du aller avec la restauration, il y a probablement eu un problème soit lors du backup soit lors de la restauration… mais bref, je pense que je vais juste surveiller si d’autres personnes remontent un problème similaire car jusqu’ici c’est pas le cas

Ce sujet a été automatiquement fermé après 24 heures suivant le dernier commentaire. Aucune réponse n’est permise dorénavant.