Postfix in Fail2Ban sinnvoll einbinden

Ich machs kurz – versprochen. Folgenden Filter habe ich bei mir in Fail2Ban eingebaut.

Der Filter (/etc/fail2ban/filter.d/postfix.conf)


[Definition]
failregex = warning: (.*)\[<HOST>\]: SASL LOGIN authentication failed: authentication failure
            reject: RCPT from (.*)\[<HOST>\]: 554 5.1.1
            reject: RCPT from (.*)\[<HOST>\]: 450 4.7.1
            reject: RCPT from (.*)\[<HOST>\]: 554 5.7.1
ignoreregex =

 

Die Konfiguration (/etc/fail2ban/jail.conf) sollte entsprechend angepasst werden.

[postfix]
enabled  = true
port     = smtp,ssmtp
filter   = postfix
logpath  = /var/log/mail.log
bantime  = 6000
maxretry = 5

Final noch ein „service fail2ban restart“ – alles fein.

4 Gedanken zu „Postfix in Fail2Ban sinnvoll einbinden

  • Peter
    29. Januar 2014 um 17:47 Uhr

    Hallo,
    Wenn ich dieser Anleitung folge, muss ich feststellen, dass es nicht funktioniert.
    Fail2ban erkennt die regex als fehlerhaft und filtert daher keinen Eintrag aus dem mail.log

  • Olaf Uhrbach
    3. April 2014 um 08:31 Uhr

    diese Config geht !
    [Definition]
    failregex = warning: (.*)\[\]: SASL LOGIN authentication failed: authentication failure
    reject: RCPT from (.*)\[\]: 554 5.1.1
    reject: RCPT from (.*)\[\]: 450 4.7.1
    reject: RCPT from (.*)\[\]: 554 5.7.1
    ignoreregex =

  • Olaf Uhrbach
    3. April 2014 um 08:33 Uhr

    hoffe doch nun besser 🙂

    dieses geht !

    [Definition]
    failregex = warning: (.*)\[\]: SASL LOGIN authentication failed: authentication failure
    reject: RCPT from (.*)\[\]: 554 5.1.1
    reject: RCPT from (.*)\[\]: 450 4.7.1
    reject: RCPT from (.*)\[\]: 554 5.7.1
    ignoreregex =

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Pflichtfelder sind mit * gekennzeichnet.

*
*
Du kannst folgende <abbr title="HyperText Markup Language">HTML</abbr>-Tags und -Attribute verwenden: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>