j'ai installé fail2ban sur mon raspberry pi 3b+ mais je n'arrive pas à le faire marcher.
Sur le log domoticz j'ai ceci :
Code : Tout sélectionner
2025-03-21 02:11:56.706 Error: Error parsing http request address: ::ffff:172.105.246.139
2025-03-21 02:11:56.765 Error: Error parsing http request address: ::ffff:172.105.246.139
2025-03-21 02:11:56.823 Error: Error parsing http request address: ::ffff:172.105.246.139
2025-03-21 03:32:16.563 Error: Error parsing http request address: ::ffff:101.198.0.150
2025-03-21 03:32:17.628 Error: Error parsing http request address: ::ffff:101.198.0.180/etc/fail2ban/jail.conf
Code : Tout sélectionner
[domoticz]
enabled = true
port = 8084
filter = domoticz
logpath = /tmp/domoticz.txt
maxretry = 3
findtime = 3600
[domoticzssl]
enabled = true
port = 8443
filter = domoticz
logpath = /tmp/domoticz.txt
maxretry = 3
findtime = 3600etc/fail2ban/filter.d/domoticz.conf
Code : Tout sélectionner
# Fail2Ban configuration file for domoticz
#
# Author: Domoticz user 'ThinkPad'
#
# $Revision$
#
[Definition]
# Option: failregex
# Notes.: regex to match the password failures messages in the logfile. The
# host must be matched by a group named "host". The tag "<HOST>" can
# be used for standard IP/hostname matching and is only an alias for
# (?:::f{4,6}:)?(?P<host>[\w\-.^_]+)
# Values: TEXT
#
failregex = Error: Error parsing http request address: <HOST>
Error: Failed login attempt from <HOST> for user '.*' !
Error: Failed login attempt from <HOST> for '.*' !
Error: \[web:8080\] Failed authentication attempt, ignoring client request \(remote address: <HOST>\)
Error: \[web:8443\] Failed authentication attempt, ignoring client request \(remote address: <HOST>\)
#First line is for 'Login Page' authentication mode of Domoticz
#Second line is for 'Basic-Auth' authentication mode in Domoticz
#
#
#
# Option: ignoreregex
# Notes.: regex to ignore. If this regex matches, the line is ignored.
# Values: TEXT
#
ignoreregex =Je ne sais pas où cela ne marche pas.
Quand je test la jail j'ai ceci :
fail2ban-regex /tmp/domoticz.txt /etc/fail2ban/filter.d/domoticz.conf /etc/fail2ban/filter.d/domoticz.conf
Code : Tout sélectionner
Running tests
=============
Use failregex filter file : domoticz, basedir: /etc/fail2ban
Use ignoreregex line : /etc/fail2ban/filter.d/domoticz.conf
Use log file : /tmp/domoticz.txt
Use encoding : UTF-8
Results
=======
Failregex: 32 total
|- #) [# of hits] regular expression
| 1) [32] .*Error: Error parsing http request address: <HOST>
`-
Ignoreregex: 0 total
Date template hits:
|- [# of hits] date format
| [1170] {^LN-BEG}ExYear(?P<_sep>[-/.])Month(?P=_sep)Day(?:T| ?)24hour:Minute:Second(?:[.,]Microseconds)?(?:\s*Zone offset)?
`-
Lines: 1215 lines, 0 ignored, 32 matched, 1183 missed
[processed in 1.59 sec]
Missed line(s): too many to print. Use --print-all-missed to print all 1183 lines
Merci d'avance pour votre aide !