Current time: 05-03-2024, 02:01 AM Hello There, Guest! (LoginRegister)


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fail2Ban und dovecot
Author Message
Darkside2009 Offline
Junior Member
*

Posts: 80
Joined: Nov 2009
Reputation: 1
Post: #1
Fail2Ban und dovecot
seit einiger zeit sehe ich folgende einträge in der mail.log
Quote:Feb 17 04:05:43 server85195 postfix/smtpd[2543]: connect from 118-167-11-149.dynamic.hinet.net[118.167.11.149]
Feb 17 04:05:46 server85195 dovecot: Bad username "inna" from unknown ip to smtp server
Feb 17 04:05:46 server85195 dovecot: auth(default): dovecot: Bad username "inna" from unknown ip to smtp server
Feb 17 04:05:47 server85195 postfix/smtpd[2543]: warning: 118-167-11-149.dynamic.hinet.net[118.167.11.149]: SASL LOGIN authentication failed: UGFzc3dvcmQ6

wer kann mir dafür eine Failregex zeile geben die ich in der /fail2ban/filter.d/dovecot.conf eintragen kann, damit diese ip von fail2ban gesperrt wird ?

danke schon mal
(This post was last modified: 02-19-2010 03:49 AM by Darkside2009.)
02-19-2010 03:48 AM
Find all posts by this user Quote this message in a reply
TheCry Away
Member
***

Posts: 851
Joined: Oct 2008
Reputation: 21
Post: #2
RE: Fail2Ban und dovecot
http://wiki.dovecot.org/HowTo/Fail2Ban

Ich denke das ist doch das was Du suchst, oder?
02-19-2010 05:35 AM
Find all posts by this user Quote this message in a reply
Darkside2009 Offline
Junior Member
*

Posts: 80
Joined: Nov 2009
Reputation: 1
Post: #3
RE: Fail2Ban und dovecot
(02-19-2010 05:35 AM)TheCry Wrote:  http://wiki.dovecot.org/HowTo/Fail2Ban

Ich denke das ist doch das was Du suchst, oder?

das hatte ich auch schon gefunden. nur wenn ich das mit diesen einstellungen testen möchte, gibt es wieder fehler......

Quote:server85195:~# fail2ban-regex /var/log/mail.log /etc/fail2ban/filter.d/dovecot.conf

Running tests
=============

Use regex file : /etc/fail2ban/filter.d/dovecot.conf
Use log file : /var/log/mail.log


Results
=======

Failregex
|- Regular expressions:
| [1] (?: pop3-login|imap-login): (?:Authentication failure|Aborted login \(auth failed|Disconnected \(auth failed).*rip=(?P<host>\S*),.*
|
`- Number of matches:
[1] 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.
(This post was last modified: 02-19-2010 06:03 AM by Darkside2009.)
02-19-2010 05:46 AM
Find all posts by this user Quote this message in a reply
BeNe Offline
Moderator
*****
Moderators

Posts: 5,899
Joined: Jan 2007
Reputation: 68
Post: #4
RE: Fail2Ban und dovecot
Ist zwar schon fast ein Jahr her als ich darüber geschrieben habe,
aber schau es Dir einfach mal an.

--> http://www.deluxe-stylez.de/2009/03/05/d...an-sichern

Greez BeNe
02-19-2010 05:00 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Darkside2009 Offline
Junior Member
*

Posts: 80
Joined: Nov 2009
Reputation: 1
Post: #5
RE: Fail2Ban und dovecot
(02-19-2010 05:00 PM)BeNe Wrote:  Ist zwar schon fast ein Jahr her als ich darüber geschrieben habe,
aber schau es Dir einfach mal an.

--> http://www.deluxe-stylez.de/2009/03/05/d...an-sichern

Greez BeNe

Thx..... aber das hatte ich auch schon durch Freund Google gefunden. Mit diesen Einstellungen erhalte ich folgende ausgabe :
Quote:No 'host' group in '(?:imap|pop3)-login: Disconnected: user=<.*>, method=(?:LOGIN|PLAIN|(?:CRAM|DIGEST)-MD5), rip=, lip'
Cannot remove regular expression. Index 0 is not valid

Results
=======

Failregex
|- Regular expressions:
| [1] (?:imap|pop3)-login: Disconnected: user=<.*>, method=(?:LOGIN|PLAIN|(?:CRAM|DIGEST)-MD5), rip=, lip
|
`- Number of matches:
[1] 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.

Sieht so aus, das fail2ban garnicht auf die logausgabe greift die ich im ersten post eingefügt habe.
02-19-2010 06:32 PM
Find all posts by this user Quote this message in a reply
BeNe Offline
Moderator
*****
Moderators

Posts: 5,899
Joined: Jan 2007
Reputation: 68
Post: #6
RE: Fail2Ban und dovecot
Zum Post #3 nochmals.
Du schreibst von einem "Fehler". Sind denn solche Einträge in der jetzigen mail.conf enthalten ?

Habe grad eben mal das Standard REGEX aus dem Dovecot wiki genommen welches sauber bei mir funktioniert.

Greez BeNe
02-19-2010 08:32 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Darkside2009 Offline
Junior Member
*

Posts: 80
Joined: Nov 2009
Reputation: 1
Post: #7
RE: Fail2Ban und dovecot
(02-19-2010 08:32 PM)BeNe Wrote:  Zum Post #3 nochmals.
Du schreibst von einem "Fehler". Sind denn solche Einträge in der jetzigen mail.conf enthalten ?

Habe grad eben mal das Standard REGEX aus dem Dovecot wiki genommen welches sauber bei mir funktioniert.

Greez BeNe

" Fehler " ist evtl falsch ausgedrückt........
es geht sich darum, das fail2ban nicht auf die sachen reagiert wie in meinem 1. post zu sehen.

meine mail.conf sieht so aus :
Quote:# Fail2Ban configuration file
#
# Author: Cyril Jaquier
#
# $Revision: 660 $
#

[Definition]

# Option: actionstart
# Notes.: command executed once at the start of Fail2Ban.
# Values: CMD
#
actionstart = printf %%b "Hi,\n
The jail <name> has been started successfully.\n
Regards,\n
Fail2Ban"|mail -s "[Fail2Ban] <name>: started" <dest>

# Option: actionstop
# Notes.: command executed once at the end of Fail2Ban
# Values: CMD
#
actionstop = printf %%b "Hi,\n
The jail <name> has been stopped.\n
Regards,\n
Fail2Ban"|mail -s "[Fail2Ban] <name>: stopped" <dest>

# Option: actioncheck
# Notes.: command executed once before each actionban command
# Values: CMD
#
actioncheck =

# Option: actionban
# Notes.: command executed when banning an IP. Take care that the
# command is executed with Fail2Ban user rights.
# Tags: <ip> IP address
# <failures> number of failures
# <time> unix timestamp of the ban time
# Values: CMD
#
actionban = printf %%b "Hi,\n
The IP <ip> has just been banned by Fail2Ban after
<failures> attempts against <name>.\n
Regards,\n
Fail2Ban"|mail -s "[Fail2Ban] <name>: banned <ip>" <dest>

# Option: actionunban
# Notes.: command executed when unbanning an IP. Take care that the
# command is executed with Fail2Ban user rights.
# Tags: <ip> IP address
# <failures> number of failures
# <time> unix timestamp of the ban time
# Values: CMD
#
actionunban =

[Init]

# Defaut name of the chain
#
name = default

# Destination/Addressee of the mail
#
dest = root
(This post was last modified: 02-19-2010 10:34 PM by Darkside2009.)
02-19-2010 10:34 PM
Find all posts by this user Quote this message in a reply
BeNe Offline
Moderator
*****
Moderators

Posts: 5,899
Joined: Jan 2007
Reputation: 68
Post: #8
RE: Fail2Ban und dovecot
Was hat das mit der mail.conf zu tun ?
Oder wirst Du nur nicht per Mail von Fail2Ban informiert Rolleyes

Greez BeNe
02-19-2010 11:37 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Darkside2009 Offline
Junior Member
*

Posts: 80
Joined: Nov 2009
Reputation: 1
Post: #9
RE: Fail2Ban und dovecot
(02-19-2010 11:37 PM)BeNe Wrote:  Was hat das mit der mail.conf zu tun ?
Oder wirst Du nur nicht per Mail von Fail2Ban informiert Rolleyes

Greez BeNe

Sind denn solche Einträge in der jetzigen mail.conf enthalten ? <----- danach hast du doch gefragt ?? oder hab ich das falsch verstanden ???

es geht sich alleine darum, das fail2ban nicht greift und die ip bannt ....
Quote:Feb 17 04:05:43 server85195 postfix/smtpd[2543]: connect from 118-167-11-149.dynamic.hinet.net[118.167.11.149]
Feb 17 04:05:46 server85195 dovecot: Bad username "inna" from unknown ip to smtp server
Feb 17 04:05:46 server85195 dovecot: auth(default): dovecot: Bad username "inna" from unknown ip to smtp server
Feb 17 04:05:47 server85195 postfix/smtpd[2543]: warning: 118-167-11-149.dynamic.hinet.net[118.167.11.149]: SASL LOGIN authentication failed: UGFzc3dvcmQ6

es sieht so aus, das fail2ban da nichts mit anfangen und lässt es unberührt. alle 2 min. erscheinen solche einträge in der mail.log ( nachts in der zeit von 23.00 - 2.00 uhr )
immer mit einem anderen benutzernamen aber die gleiche ip.
02-20-2010 12:03 AM
Find all posts by this user Quote this message in a reply
TheCry Away
Member
***

Posts: 851
Joined: Oct 2008
Reputation: 21
Post: #10
RE: Fail2Ban und dovecot
Schau mal ob Dir hier was von hilft:
http://www.fail2ban.org/wiki/index.php/Talk:Dovecot
http://www.fail2ban.org/wiki/index.php/Dovecot
02-20-2010 03:40 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: