Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[fail2ban] Bloquer ssh : POSSIBLE BREAK-IN ATTEMPT
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index French
View previous topic :: View next topic  
Author Message
jjay
Apprentice
Apprentice


Joined: 14 Sep 2004
Posts: 187
Location: Suresnes(92) / France

PostPosted: Tue Jan 16, 2007 12:29 am    Post subject: [fail2ban] Bloquer ssh : POSSIBLE BREAK-IN ATTEMPT Reply with quote

Hello,

Régulièrement j'ai les logs suivants sur mon serveur SSH :
Code:
Jan 15 20:56:00 genteway sshd[32553]: reverse mapping checking getaddrinfo for host66-87.pool8174.interbusiness.it [81.74.87.66] failed - POSSIBLE BREAK-IN ATTEMPT!


J'aimerai bloquer les IP responsables de ce log avec fail2ban mais ça ne marche pas. Je suis parti de la règle sshd que j'ai adaptée :
Code:
[Definition]

# Option:  failregex
# Notes.:  regex to match the password failures messages in the logfile.
# Values:  TEXT
#
failregex = (?:(?:Authentication failure|Failed [-/\w+]+) for(?: [iI](?:llegal|nvalid) user)?|[Ii](?:llegal|nvalid) user|ROOT LOGIN REFUSED) .*(?: from|FROM) (?:::f{4,6}:)?(?P<host>\S*)


Voici le résultat après adaptation :
Code:
[Definition]

# Option:  failregex
# Notes.:  regex to match the password failures messages in the logfile.
# Values:  TEXT
#
failregex = (\[(?P<host>\S*)\] failed - POSSIBLE BREAK-IN ATTEMPT)|(?:(?:Authentication failure|Failed [-/\w+]+) for(?: [iI](?:llegal|nvalid) user)?|[Ii](?:llegal|nvalid) user|ROOT LOGIN REFUSED) .*(?: from|FROM) (?:::f{4,6}:)?(?P<host>\S*)

Mais avec cette regle fail2ban ne fonctionne plus sur sshd et j'ai les logs suivants :
Code:
2007-01-16 00:29:35,238 fail2ban.filter : ERROR  No failregex is set
2007-01-16 00:29:35,239 fail2ban.filter : ERROR  No failregex is set
2007-01-16 00:29:35,240 fail2ban.filter : ERROR  No failregex is set
2007-01-16 00:29:35,241 fail2ban.filter : ERROR  No failregex is set
2007-01-16 00:29:35,242 fail2ban.filter : ERROR  No failregex is set
2007-01-16 00:29:35,243 fail2ban.filter : ERROR  No failregex is set
2007-01-16 00:29:35,244 fail2ban.filter : ERROR  No failregex is set
2007-01-16 00:29:35,245 fail2ban.filter : ERROR  No failregex is set


Merci de m'orienter vers la bonne solution

jjay
Back to top
View user's profile Send private message
kwenspc
Advocate
Advocate


Joined: 21 Sep 2003
Posts: 4954

PostPosted: Tue Jan 16, 2007 6:13 am    Post subject: Reply with quote

LostControl pourra certainement t'aider (et pourquoi pas inclure ta fonction dans le programme) puisqu'il en est l'auteur :)
Un ptit mp quoi
_________________
membre officieux du SAV Ati GEntoo
Back to top
View user's profile Send private message
zyprexa
Apprentice
Apprentice


Joined: 26 Dec 2004
Posts: 180

PostPosted: Tue Jan 16, 2007 6:24 am    Post subject: Reply with quote

Pour ma part, je te conseillerais de changer le port de ssh (si ce n'est pas déjà fait).

Ca a été une mesure suffisante pour éliminer 99% des tentatives chez moi, même si cela n'exclut pas l'usage de fail2ban.
_________________
enjoy
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index French All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum