-
I'm trying to ban IPs from logs like this:
Then I use AI to create and finally I modify the change part like this, in a new file postfix.local
And I have a new config
But it seems like not working. In which step I got it wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
The current postfix filter successfully matches the given message in aggressive mode. [postfix]
mode = aggressive
backend = auto
logpath = /var/log/mail.log
enabled = true As for the original issue - I have no time to check your filter changes, so to test it'd principally work simply use:
(and then see whether there are matches found for that REs) Otherwise take a look at 1st Q in FAQ in wiki :: How fail2ban works. And direct answer to question "What is the proper way to enhance the failregex for an existing service?": [postfix]
failregex = %(known/failregex)s
^^[^[]*\[<ADDR>\] ... some additional RE ... However if you want to use some interpolations declared in filter definition, you have to extend it in [Definition]
failregex = %(known/failregex)s
^^[^[]*\[<ADDR>\]%(_port)s... some additional RE ... |
Beta Was this translation helpful? Give feedback.
-
It doesn't say me which version you use.
My suggestion was to download only postfix filter and replace
If you copied the filter it shall definitely work (or at least show the RE in dump).
Nope. |
Beta Was this translation helpful? Give feedback.
-
Hi @sebres I changed the section And
The attacker use a group of hosts under a segment, with a low frequent. Is there an official way to change the IP record into /24? I asked AI, it suggested me to change the regex something like Is there an official way to optimize the detection and ban? Or if I should change the counter to a smaller one. |
Beta Was this translation helpful? Give feedback.
-
FWIW: I detected the same attacker (dictionary attack against postfix SMTPS authentication) and ended up by permanently adding 81.30.107.0/24 to my firewall's drop zone (system using firewalld). |
Beta Was this translation helpful? Give feedback.
It doesn't say me which version you use.
My suggestion was to download only postfix filter and replace
/etc/fail2ban/filter.d/postfix.conf
(or put it aspostfix.local
). The version of filter shall be compatible to stock 1.0 or 0.11 (but of course you must test it on your system, e. g. with fail2ban-regex).If you copied the filter it shall definitely work (or at least show the RE in dump).
Something is still wrong in your jail definition.