[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

fail2ban et apache-ssl



Bonjour à tous,
j'ai besoin de vos lumières car je n'arrive pas à faire fonctionner
fail2ban pour apache-ssl. Je suis sur debian sarge et après une
instalation de fail2ban en réalisant un backports en sid j'ai réussi à
faire marcher fail2ban sur ssh bien que l'instalation a été un peu
foireuse. Par contre pour apache-ssl rien n'y fais mais je pense que le log
 de apache-ssl n'est pas bien configuré pour fail2ban ou inversement.

Le fichier de conf de fail2ban est le suivant:

[Apache]
enabled = true
logfile = /var/log/apache-ssl/error.log
port = 443
timeregex = \S{3} \S{3} \d{2} \d{2}:\d{2}:\d{2} \d{4}
timepattern = %%a %%b %%d %%H:%%M:%%S %%Y
 failure|not found)
failregex = [[]client (?P<host>\S*)[]] user .*(?:: authentication
failure|not found)

[ApacheAttacks]
enabled = true
logfile = /var/log/apache-ssl/access.log
port = 443
maxfailures = 2
timeregex = \d{2}/\S{3}/\d{4}:\d{2}:\d{2}:\d{2}
timepattern = %%d/%%b/%%Y:%%H:%%M:%%S
 failure|not found)
failregex = ^(?P<host>\S*) -.*"GET
.*(?:awstats\.pl\?configdir=|index2\.php\?_REE
QUEST\[option\].*)\|echo.*

La configuration de apache pour les logs est la suivante:

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"
\"%{foree
nsic-id}n\" %T %v" full
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"
\"%{foree
nsic-id}n\" %P %T" debug
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"
\"%{foree
nsic-id}n\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{forensic-id}n\"" forensic
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent


Les fichiers de log de apache sont les suivants:

/etc/apache-ssl/error.log
[Sat Jan  6 22:41:35 2007] [error] [client 192.168.0.8] user qezcfeqz
not found:: /test/

/etc/apache-ssl/acces.log
192.168.0.8 - - [06/Jan/2007:23:48:42 +0100] "GET / HTTP/1.1" 200 485
"-" "Mozill
la/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.1) Gecko/20061205
Iceweasel/2.0.0.1  
(Debian-2.0.0.1+dfsg-1)" "-"

Merci pour vos réponses.



Reply to: