Fail2ban Impossible de trouver une adresse IP correspondante

Salut,

Ces dernières semaines je retrouve fréquemment ce genre de logs et alertes.

[code]cat /var/log/fail2ban.log-20120610

2012-06-09 23:32:23,331 fail2ban.filter : WARNING Unable to find a corresponding IP address for p-50-63-86-147.ip.secureserver.net
2012-06-09 23:32:23,332 fail2ban.filter : WARNING Unable to find a corresponding IP address for p-50-63-86-147.ip.secureserver.net
[/code]
Une histoire d’ip reverse, je crois …

[code]cat /var/log/apache2/access.log-20120610

ip-50-63-86-147.ip.secureserver.net - - [09/Jun/2012:23:32:12 +0200] “GET /jmx-console/index.jsp HTTP/1.1” 403 447 “-” “-”[/code]

[code]cat /var/log/messages-20120610

Jun 9 23:33:57 mon_domaine kernel: [49949.782293] [IPTABLES DROP OUTPUT] : IN= OUT=eth0 SRC=91.x.x.x DST=50.63.86.147 LEN=68 TOS=0x00 PREC=0xC0 TTL=64 ID=64 ID=22563 PROTO=ICMP TYPE=3 CODE=3 [SRC=50.63.86.147 DST=91.x.x.x LEN=40 TOS=0x00 PREC=0x00 TTL=116 ID=3963 DF PROTO=TCP SPT=55063 DPT=80 WINDOW=6379363793 RES=0x00 ACK FIN URGP=0 ][/code]

Deux semaines que je farfouille sur la toile, mais …

Que faite vous pour y remédier ?

Ton fail2ban semble manger le premier caractère du nom de domaine ip-50-63-86-147.ip.secureserver.net tes logs fail2ban le transforme en p-50-63-86-147.ip.secureserver.net. Une règle fail2ban mal écrite ou mal exécutée?

On peut voir ton /etc/fail2ban/filter.d/apache-auth.conf?

Salut,

[quote=“ripat”]…Une règle fail2ban mal écrite ou mal exécutée?
[/quote]

Tu as peut être vu juste, mais je dois avoir une foutu poutre dans l’œil … :confused:

J’ai commenté toutes ces règles (gras), une à une, et chaque fois j’ai lancé une vérification.

[quote]:~# fail2ban-regex /var/log/apache2/access.log /etc/fail2ban/filter.d/apache-w00tw00t.conf

Running tests

Use regex file : /etc/fail2ban/filter.d/apache-w00tw00t.conf
Use log file : /var/log/apache2/access.log

Results

Failregex
|- Regular expressions:
| [1] [[]client []] (client sent HTTP/1.1 request without hostname|Invalid method in request|request failed: URI too long|erroneous characters after protocol string)
| [2] ^ -."GET /w00tw00t.at.ISC.SANS.DFind:).".*
| [3] ^ -."GET /w00tw00t.".*
| [4] .[client .w00tw00t.
| [5] ^ -.
“GET /w00tw00t.at.ISC.SANS.test0:).".
| [6] ^ -."GET /w00tw00t.at.ISC.SANS.test:).”.*
| [7] ^ -."GET /w00tw00t.at.ISC.SANS.test1:).".*
| [8] ^ -."GET /w00tw00t.at.blackhats.romanian.anti-sec:).".*
| [9] ^ -."GET [\w{1,3} \w{1,3} \d{1,2} \d{1,2}:\d{1,2}:\d{1,2} \d{1,4}] [error] [client 91.x.x.x] File does not exist: /.{1,20}/(w00tw00t|wootwoot|WootWoot|WooTWooT).{1,250}.".*
|
`- Number of matches:
[1] 0 match(es)
[2] 0 match(es)
[3] 0 match(es)
[4] 0 match(es)
[5] 0 match(es)
[6] 0 match(es)
[7] 0 match(es)
[8] 0 match(es)
[9] 0 match(es)

Ignoreregex
|- Regular expressions:
|
`- Number of matches:

Summary

Sorry, no match

Look at the above section ‘Running tests’ which could contain important
information.
:~#
[/quote]
Ou est elle, cette poutre ?

Il semblerait que ce soit celle là, qui engendre : Unable to find a corresponding IP address

[code]:~# fail2ban-regex /var/log/apache2/access.log-20120610 /etc/fail2ban/filter.d/apache-w00tw00t.conf

Running tests

Use regex file : /etc/fail2ban/filter.d/apache-w00tw00t.conf
Use log file : /var/log/apache2/access.log-20120610

Unable to find a corresponding IP address for hosted-by.paylasweb.net
Unable to find a corresponding IP address for hosted-by.paylasweb.net
Unable to find a corresponding IP address for tj-201-140-164-2.gtel.net.mx
Unable to find a corresponding IP address for tj-201-140-164-2.gtel.net.mx
Unable to find a corresponding IP address for hosted-by.paylasweb.net
Unable to find a corresponding IP address for hosted-by.paylasweb.net
Unable to find a corresponding IP address for 207.46.13.99-msnbot-207-46-13-99.search.msn.com
Unable to find a corresponding IP address for 207.46.13.99-msnbot-207-46-13-99.search.msn.com
Unable to find a corresponding IP address for 72.167.247.195.ip-msnbot-65-52-108-26.search.msn.com
Unable to find a corresponding IP address for 72.167.247.195.ip-msnbot-65-52-108-26.search.msn.com

Results

Failregex
|- Regular expressions:
| [1] [[]client []] (client sent HTTP/1.1 request without hostname|Invalid method in request|request failed: URI too long|erroneous characters after protocol string)
| [2] ^ -."GET /w00tw00t.at.ISC.SANS.DFind:).".*
| [3] ^ -."GET /w00tw00t.".*
| [4] .[client .w00tw00t.
| [5] ^ -.
“GET /w00tw00t.at.ISC.SANS.test0:).".
| [6] ^ -."GET /w00tw00t.at.ISC.SANS.test:).”.*
| [7] ^ -."GET /w00tw00t.at.ISC.SANS.test1:).".*
| [8] ^ -."GET /w00tw00t.at.blackhats.romanian.anti-sec:).".*
| [9] ^ -."GET [\w{1,3} \w{1,3} \d{1,2} \d{1,2}:\d{1,2}:\d{1,2} \d{1,4}] [error] [client 91.x.x.x] File does not exist: /.{1,20}/(w00tw00t|wootwoot|WootWoot|WooTWooT).{1,250}.".*
|
`- Number of matches:
[1] 0 match(es)
[2] 10 match(es)
[3] 13 match(es)
[4] 0 match(es)
[5] 2 match(es)
[6] 0 match(es)
[7] 0 match(es)
[8] 0 match(es)
[9] 0 match(es)

Ignoreregex
|- Regular expressions:
|
`- Number of matches:

Summary

Addresses found:
[1]
[2]
89.121.253.227 (Tue Jun 05 16:45:25 2012)
89.121.253.227 (Tue Jun 05 16:54:24 2012)
69.24.67.227 (Wed Jun 06 06:54:45 2012)
213.79.125.20 (Thu Jun 07 21:08:29 2012)
213.79.125.20 (Thu Jun 07 23:21:29 2012)
50.63.137.16 (Fri Jun 08 04:32:10 2012)
12.52.57.157 (Fri Jun 08 04:47:08 2012)
74.86.27.131 (Sat Jun 09 10:48:26 2012)
31.210.99.87 (Sat Jun 09 14:40:29 2012)
31.210.99.87 (Sat Jun 09 14:44:26 2012)
[3]
62.225.128.44 (Tue Jun 05 15:09:17 2012)
89.121.253.227 (Tue Jun 05 16:45:25 2012) (already matched)
89.121.253.227 (Tue Jun 05 16:54:24 2012) (already matched)
176.31.8.59 (Tue Jun 05 19:39:53 2012)
69.24.67.227 (Wed Jun 06 06:54:45 2012) (already matched)
213.79.125.20 (Thu Jun 07 21:08:29 2012) (already matched)
213.79.125.20 (Thu Jun 07 23:21:29 2012) (already matched)
50.63.137.16 (Fri Jun 08 04:32:10 2012) (already matched)
12.52.57.157 (Fri Jun 08 04:47:08 2012) (already matched)
74.86.27.131 (Sat Jun 09 10:48:26 2012) (already matched)
31.210.99.87 (Sat Jun 09 14:40:29 2012) (already matched)
31.210.99.87 (Sat Jun 09 14:44:26 2012) (already matched)
176.31.53.130 (Sat Jun 09 17:44:06 2012)
[4]
[5]
176.31.8.59 (Tue Jun 05 19:39:53 2012) (already matched)
176.31.53.130 (Sat Jun 09 17:44:06 2012) (already matched)
[6]
[7]
[8]
[9]

Date template hits:
0 hit(s): MONTH Day Hour:Minute:Second
0 hit(s): WEEKDAY MONTH Day Hour:Minute:Second Year
0 hit(s): WEEKDAY MONTH Day Hour:Minute:Second
0 hit(s): Year/Month/Day Hour:Minute:Second
0 hit(s): Day/Month/Year Hour:Minute:Second
0 hit(s): Day/Month/Year Hour:Minute:Second
881 hit(s): Day/MONTH/Year:Hour:Minute:Second
0 hit(s): Month/Day/Year:Hour:Minute:Second
0 hit(s): Year-Month-Day Hour:Minute:Second
0 hit(s): Year.Month.Day Hour:Minute:Second
0 hit(s): Day-MONTH-Year Hour:Minute:Second[.Millisecond]
0 hit(s): Day-Month-Year Hour:Minute:Second
0 hit(s): TAI64N
0 hit(s): Epoch
0 hit(s): ISO 8601
0 hit(s): Hour:Minute:Second
0 hit(s): <Month/Day/Year@Hour:Minute:Second>

Success, the total number of match is 25

However, look at the above section ‘Running tests’ which could contain important
information.
root@schema-indus:~#[/code]

Rhôooo, ma foi c’est open-source … :wink:

[code]:~# cat /etc/fail2ban/filter.d/apache-auth.conf

Fail2Ban configuration file

Author: Cyril Jaquier

$Revision$

[Definition]

Option: failregex

Notes.: regex to match the password failure messages in the logfile. The

host must be matched by a group named “host”. The tag “” can

be used for standard IP/hostname matching and is only an alias for

(?:::f{4,6}:)?(?P[\w-.^_]+)

Values: TEXT

failregex = [[]client []] user .* authentication failure
[[]client []] user .* not found
[[]client []] user .* password mismatch

Option: ignoreregex

Notes.: regex to ignore. If this regex matches, the line is ignored.

Values: TEXT

ignoreregex =
:~#
[/code]

Notes:

Ces règles semblent plutôt efficace, non … 8)

:~# banip -N fail2ban-Apache-scan -N fail2ban-SSH -N fail2ban-apache-anti-scripts -N fail2ban-apache-dosevasive -N fail2ban-apache-w00tw00t -A INPUT -p tcp -j fail2ban-apache-dosevasive -A INPUT -p tcp -m tcp --dport 22 -j fail2ban-SSH -A INPUT -p tcp -m tcp --dport 80 -j fail2ban-Apache-scan -A INPUT -p tcp -m tcp --dport 80 -j fail2ban-apache-anti-scripts -A INPUT -p tcp -m tcp --dport 80 -j fail2ban-apache-w00tw00t -A fail2ban-Apache-scan -j RETURN -A fail2ban-SSH -s 64.120.239.216/32 -j DROP -A fail2ban-SSH -s 190.142.174.221/32 -j DROP -A fail2ban-SSH -s 194.54.177.134/32 -j DROP -A fail2ban-SSH -s 176.53.57.150/32 -j DROP -A fail2ban-SSH -s 91.121.115.25/32 -j DROP -A fail2ban-SSH -s 69.64.61.89/32 -j DROP -A fail2ban-SSH -s 189.87.195.51/32 -j DROP -A fail2ban-SSH -s 84.96.74.44/32 -j DROP -A fail2ban-SSH -s 193.0.96.15/32 -j DROP -A fail2ban-SSH -s 213.79.125.20/32 -j DROP -A fail2ban-SSH -s 203.146.127.173/32 -j DROP -A fail2ban-SSH -s 85.17.207.216/32 -j DROP -A fail2ban-SSH -s 118.97.8.28/32 -j DROP -A fail2ban-SSH -s 50.97.33.38/32 -j DROP -A fail2ban-SSH -s 210.13.73.30/32 -j DROP -A fail2ban-SSH -s 64.26.171.35/32 -j DROP -A fail2ban-SSH -s 91.121.3.140/32 -j DROP -A fail2ban-SSH -s 213.227.39.134/32 -j DROP -A fail2ban-SSH -s 173.240.102.27/32 -j DROP -A fail2ban-SSH -s 186.46.29.218/32 -j DROP -A fail2ban-SSH -s 217.24.211.173/32 -j DROP -A fail2ban-SSH -j RETURN -A fail2ban-apache-anti-scripts -s 176.31.53.130/32 -j DROP -A fail2ban-apache-anti-scripts -s 50.63.86.147/32 -j DROP -A fail2ban-apache-anti-scripts -s 147.86.63.50/32 -j DROP -A fail2ban-apache-anti-scripts -s 95.247.167.72/32 -j DROP -A fail2ban-apache-anti-scripts -s 87.99.210.31/32 -j DROP -A fail2ban-apache-anti-scripts -s 249.238.67.216/32 -j DROP -A fail2ban-apache-anti-scripts -s 216.67.238.249/32 -j DROP -A fail2ban-apache-anti-scripts -s 16.67.238.249/32 -j DROP -A fail2ban-apache-anti-scripts -s 72.167.247.195/32 -j DROP -A fail2ban-apache-anti-scripts -s 31.210.99.87/32 -j DROP -A fail2ban-apache-anti-scripts -s 65.52.108.26/32 -j DROP -A fail2ban-apache-anti-scripts -s 74.86.27.131/32 -j DROP -A fail2ban-apache-anti-scripts -s 91.121.148.161/32 -j DROP -A fail2ban-apache-anti-scripts -s 12.52.57.157/32 -j DROP -A fail2ban-apache-anti-scripts -s 50.56.64.228/32 -j DROP -A fail2ban-apache-anti-scripts -s 213.79.125.20/32 -j DROP -A fail2ban-apache-anti-scripts -s 62.225.128.44/32 -j DROP -A fail2ban-apache-anti-scripts -s 46.45.140.95/32 -j DROP -A fail2ban-apache-anti-scripts -s 193.110.72.242/32 -j DROP -A fail2ban-apache-anti-scripts -s 222.122.6.74/32 -j DROP -A fail2ban-apache-anti-scripts -s 69.24.67.227/32 -j DROP -A fail2ban-apache-anti-scripts -s 114.33.125.94/32 -j DROP -A fail2ban-apache-anti-scripts -s 95.108.158.243/32 -j DROP -A fail2ban-apache-anti-scripts -s 207.46.13.99/32 -j DROP -A fail2ban-apache-anti-scripts -s 50.63.137.16/32 -j DROP -A fail2ban-apache-anti-scripts -s 178.33.174.195/32 -j DROP -A fail2ban-apache-anti-scripts -s 37.59.205.10/32 -j DROP -A fail2ban-apache-anti-scripts -s 109.74.11.139/32 -j DROP -A fail2ban-apache-anti-scripts -s 89.121.253.227/32 -j DROP -A fail2ban-apache-anti-scripts -s 46.105.9.196/32 -j DROP -A fail2ban-apache-anti-scripts -s 72.9.159.168/32 -j DROP -A fail2ban-apache-anti-scripts -s 184.168.70.25/32 -j DROP -A fail2ban-apache-anti-scripts -s 89.202.228.214/32 -j DROP -A fail2ban-apache-anti-scripts -s 65.52.108.12/32 -j DROP -A fail2ban-apache-anti-scripts -s 54.248.27.234/32 -j DROP -A fail2ban-apache-anti-scripts -s 178.162.176.234/32 -j DROP -A fail2ban-apache-anti-scripts -s 64.34.169.244/32 -j DROP -A fail2ban-apache-anti-scripts -s 94.125.33.114/32 -j DROP -A fail2ban-apache-anti-scripts -s 66.249.71.236/32 -j DROP -A fail2ban-apache-anti-scripts -s 178.63.66.147/32 -j DROP -A fail2ban-apache-anti-scripts -s 216.157.108.13/32 -j DROP -A fail2ban-apache-anti-scripts -s 216.157.108.15/32 -j DROP -A fail2ban-apache-anti-scripts -s 216.157.108.14/32 -j DROP -A fail2ban-apache-anti-scripts -s 66.249.68.236/32 -j DROP -A fail2ban-apache-anti-scripts -s 216.157.108.16/32 -j DROP -A fail2ban-apache-anti-scripts -s 5.39.15.216/32 -j DROP -A fail2ban-apache-anti-scripts -s 46.105.111.141/32 -j DROP -A fail2ban-apache-anti-scripts -s 180.76.5.55/32 -j DROP -A fail2ban-apache-anti-scripts -s 176.31.8.59/32 -j DROP -A fail2ban-apache-anti-scripts -s 46.105.108.155/32 -j DROP -A fail2ban-apache-anti-scripts -s 95.170.190.36/32 -j DROP -A fail2ban-apache-anti-scripts -s 66.249.73.141/32 -j DROP -A fail2ban-apache-anti-scripts -j RETURN -A fail2ban-apache-dosevasive -s 85.17.24.80/32 -j DROP -A fail2ban-apache-dosevasive -s 66.249.66.47/32 -j DROP -A fail2ban-apache-dosevasive -s 66.249.72.56/32 -j DROP -A fail2ban-apache-dosevasive -s 66.249.73.141/32 -j DROP -A fail2ban-apache-dosevasive -j RETURN -A fail2ban-apache-w00tw00t -s 176.31.53.130/32 -j DROP -A fail2ban-apache-w00tw00t -s 74.86.27.131/32 -j DROP -A fail2ban-apache-w00tw00t -s 91.121.148.161/32 -j DROP -A fail2ban-apache-w00tw00t -s 12.52.57.157/32 -j DROP -A fail2ban-apache-w00tw00t -s 222.122.6.74/32 -j DROP -A fail2ban-apache-w00tw00t -s 213.79.125.20/32 -j DROP -A fail2ban-apache-w00tw00t -s 62.225.128.44/32 -j DROP -A fail2ban-apache-w00tw00t -s 46.45.140.95/32 -j DROP -A fail2ban-apache-w00tw00t -s 69.24.67.227/32 -j DROP -A fail2ban-apache-w00tw00t -s 114.33.125.94/32 -j DROP -A fail2ban-apache-w00tw00t -s 50.63.137.16/32 -j DROP -A fail2ban-apache-w00tw00t -s 50.56.64.228/32 -j DROP -A fail2ban-apache-w00tw00t -s 178.33.174.195/32 -j DROP -A fail2ban-apache-w00tw00t -s 37.59.205.10/32 -j DROP -A fail2ban-apache-w00tw00t -s 89.121.253.227/32 -j DROP -A fail2ban-apache-w00tw00t -s 46.105.9.196/32 -j DROP -A fail2ban-apache-w00tw00t -s 72.9.159.168/32 -j DROP -A fail2ban-apache-w00tw00t -s 178.162.176.234/32 -j DROP -A fail2ban-apache-w00tw00t -s 94.125.33.114/32 -j DROP -A fail2ban-apache-w00tw00t -s 178.63.66.147/32 -j DROP -A fail2ban-apache-w00tw00t -s 5.39.15.216/32 -j DROP -A fail2ban-apache-w00tw00t -s 46.105.111.141/32 -j DROP -A fail2ban-apache-w00tw00t -s 176.31.8.59/32 -j DROP -A fail2ban-apache-w00tw00t -s 46.105.108.155/32 -j DROP -A fail2ban-apache-w00tw00t -s 95.170.190.36/32 -j DROP -A fail2ban-apache-w00tw00t -j RETURN :~#

Ça m’a l’air normal non? Fail2ban ne semble plus supprimer le premier caractère du host. Ce ne serait donc finalement plus qu’un problème de résolution inverse, qu’Apache n’est pas parvenu à résoudre non plus j’imagine. Tu devrais également trouver les noms de domaine du genre hosted-by.paylasweb.net dans le fichier log d’apache.

Je ne connais pas les regex en python mais j’imagine qu’elles sont PCRE (Perl Compatible RE). Celle qui capture l’ip du host me semble correcte quoi que je ne comprenne pas ce que le premier groupe optionnel non capturant b?[/b] vient faire ici.

Il devrait capturer des chaînes comme celle-ci ::ffff: ou ::ffffff: ipv6 ?

edit:
Le truc avec des fff c’est bien de l’ipv6, ou plutôt de l’ipv4 embedded dans de l’ipv6

[quote]Examples of IPv6 addresses with an embedded IPv4 address of 10.23.1.5 are

FE80::5EfE:10.23.1.5 (An ISATAP address)
::FFFF:10.23.1.5 and ::FFFF:0:10.23.1.5 (SIIT addresses)
FEC0:0:0:1::10.23.1.5 (TRT address)

fengnet.com/book/CCIE%20Professi … 1sec1.html[/quote]

Si je puis me permettre un commentaire, indépendamment du “bug” d’extraction de nom d’hôte de fail2ban, ce serait de configurer apache pour enregistrer l’adresse IP du client dans ses logs et non le reverse DNS. D’une part, ça économise la charge de faire la résolution DNS inverse à partir de l’adresse (et ça évite à fail2ban de refaire la résolution DNS de l’adresse à partir du nom), et d’autre part le reverse DNS n’est pas forcément aussi fiable que l’adresse IP. Parfois le reverse n’est pas à jour et pointe vers une autre adresse, il sera alors impossible de remonter à l’adresse originelle. Pire, un attaquant qui a la main sur le reverse de son adresse IP peut le faire pointer vers n’importe quelle adresse et la faire bannir à tort.

Salut,

[quote=“ripat”]Ça m’a l’air normal non? Fail2ban ne semble plus supprimer le premier caractère du host. Ce ne serait donc finalement plus qu’un problème de résolution inverse, qu’Apache n’est pas parvenu à résoudre non plus j’imagine.
[/quote]

@ripat

Bien vu! :wink:

[quote=“PascalHambourg”]Si je puis me permettre un commentaire, indépendamment du “bug” d’extraction de nom d’hôte de fail2ban, ce serait de configurer apache pour enregistrer l’adresse IP du client dans ses logs et non le reverse DNS.
[/quote]
À quoi fait tu donc allusion ?

Que dois-je rechercher ?

Un module …

Une directive …

</Directory > ? <Directory />

N’est ce pas le cas, présentement … :think:

Vérifie la directive HostnameLookups dans les fichiers de configuration d’Apache (apache2.conf?). Doit être off. Si ça ne suffit pas, vérifie la valeur du CustomLog dans ton fichier de config de sites-enabled (000-default?), sans doute combined. Si c’est le cas, dans apache2.conf, trouve la ligne qui défini le format combined et remplace %h par %a. Ça devrait suffire pour empêcher apache de faire de la résolution inverse.

httpd.apache.org/docs/2.0/mod/mo … ml#formats

Salut,

[quote=“ripat”]Vérifie la directive HostnameLookups dans les fichiers de configuration d’Apache (apache2.conf?). Doit être off. Si ça ne suffit pas, vérifie la valeur du CustomLog dans ton fichier de config de sites-enabled (000-default?), sans doute combined. Si c’est le cas, dans apache2.conf, trouve la ligne qui défini le format combined et remplace %h par %a. Ça devrait suffire pour empêcher apache de faire de la résolution inverse.

httpd.apache.org/docs/2.0/mod/mo … ml#formats[/quote]

Merci ripat! :023

Comme vous l’aviez pressentit, ma configuration d’apache n’aller pas dans ce sens.

J’ai donc mis en place tous ceci hier soir. Sachant également que j’ai procéder à un nettoyage chirurgicale des logs. (fail2ban, apache)

J’ai jugé opportun un reboot du serveur, mange pas pain, et je pouvais me le permettre.

[quote=“Journal des accès”]http://httpd.apache.org/docs/2.2/fr/logs.html#accesslog

Le journal des accès au serveur enregistre toutes les requêtes que traite ce dernier. La localisation et le contenu du journal des accès sont définis par la directive CustomLog. La directive LogFormat permet de simplifier la sélection du contenu du journal. Cette section décrit comment configurer le serveur pour l’enregistrement des informations dans le journal des accès.[/quote]

Lorsque je me connectais à mon CMS le premier champ était de ce format

alille-x.x.x.x.w2-5.abo.wanadoo.fr - - [08/Jun/2012:02:24:41 +0200] "GET / HTTP/1.1" 200 1520 "-"

À présent: 2.5.x.x - - [11/Jun/2012:14:57:01 +0200] "GET /.....

Autre exemple, ce type de robot.

Premier champ, avant:

msnbot-65-52-108-20.search.msn.com. [08/Jun/2012:05:03:27 +0200] "GET /robots.txt ....

À cette heure:

65.52.108.20 - - [11/Jun/2012:04:29:30 +0200] "GET /robots.txt 

[code]# Active la résolution DNS pour les noms d’hôtes
#HostnameLookups On
HostnameLookups Off

ErrorLog: The location of the error log file.

If you do not specify an ErrorLog directive within a

container, error messages relating to that virtual host will be

logged here. If you do define an error logfile for a

container, that host’s errors will be logged there and not here.

##ErrorLog ${APACHE_LOG_DIR}/error.log

chemin du fichier de log des erreurs du serveur.

ErrorLog /var/log/apache2/error.log

LogLevel: Control the number of messages logged to the error_log.

Possible values include: debug, info, notice, warn, error, crit,

alert, emerg.

niveau de log du serveur

emerg Messages Urgents - Le système est inutilisable.

alert Messages d’actions qui doivent être effectuées immédiatement.

crit Messages critiques.

error Messages d’erreurs.

warn Messages d’avertissement.

notice Messages normales mais significatives.

info Messages d’informations.

debug Messages de débogage

LogLevel warn

The following directives define some format nicknames for use with

a CustomLog directive (see below).

If you are behind a reverse proxy, you might want to change %h into %{X-Forwarded-For}i

format des lignes contenues dans les logs

%a Adresse ip distante.

%A Adresse ip local.

%B Taille de la réponse en octets, excluant l’entête HTTP.

%b Taille de la réponse en octets, excluant l’entête HTTP au format CLF.

%{Foobar}C Contenu du cookie “Foobar” de la requête envoyée au serveur.

%D Le temps mis à servir la requête .

%{FOOBAR}e Contenue de la variable d’environnement “FOOBAR”.

%f Nom du fichier.

%h Hôte distant.

%H Le protocole demandé.

%{Foobar}i Le contenu de “Foobar”: Ligne(s) d’en-tête de la requête envoyée au serveur.

%l nom du fichier de log distant (de identd, si il est fournit).

cela retournera un tiret tant que //mod_ident// n’est pas présent

et //IdentityCheck// n’est pas mis à ON.

%m Méthode de la requête.

%{Foobar}n Contenu de la note “Foobar” provenant d’un autre module.

%{Foobar}o Le contenu de “Foobar”: Ligne(s) d’entête dans la réponse.

%p Port canonique du serveur qui sert la réponse.

%P Id du processus fils qui a servi la requête.

%{format}P Id du processus ou du thread fils qui a servi la requête.

Les formats valides sont pid, tid, et hextid.

hextid nécessite APR 1.2.0 ou supérieur.

%q Chaînes de la requête (Commençant avec un ? si une chaine de requête existe, sinon une chaîne vide)

%r Première ligne de la requête.

%s Statut. Pour les requête redirigées en interne, ceci est la requête originale — %>s pour la dernière.

%t Heure à laquelle la requête a été reçue (format standard anglais mois jour année )

%{format}t L’heure, au format précisé, qui doit être dans les formats de strftime(3). (potentiellement localisé).

%T Le temps mis pour répondre à la requête.

%u Utilisateur distant (de l’authentification; peut être faux si le code de retour de statut (%s) est 401)

%U Url demandée, n’inclue aucune chaîne de requête.

%v Nom canonique de ServerName du serveur qui répond à la requête.

%V Nom du serveur en fonction du paramètre UseCanonicalName.

%X Statut de la connexion une fois la réponse envoyée.

X = connexion annulée avant la réponse complète.

+ = la connexion peut être maintenue après l’envoi de la réponse.

- = la connexion sera fermée après l’envoi de la réponse.

%I Octets reçus, incluant l’entête et la requête, ne peut être nul. Vous devez activer //mod_logio// pour l’utiliser.

%O Octets envoyés, incluant l’entête, ne peut être nul. Vous devez activer //mod_logio// pour l’utiliser.

LogFormat “%v:%p %h %l %u %t “%r” %>s %O “%{Referer}i” “%{User-Agent}i”” vhost_combined
LogFormat “%a %l %u %t “%r” %>s %O “%{Referer}i” “%{User-Agent}i”” combined
LogFormat “%h %l %u %t “%r” %>s %O” common
LogFormat “%{Referer}i -> %U” referer
LogFormat “%{User-agent}i” agent
[/code]

AMHA, ce sujet est clos …

Je vous en serre cinq, un grand merci à vous deux … :wink: