Docker-mailserver: fail2ban script output incorrect

Created on 4 Nov 2020  路  2Comments  路  Source: tomav/docker-mailserver

Context

I noticed today, that the output from the fail2ban script is a bit weired:

root@mail:/# fail2ban
iptables: No chain/target/match by that name.
iptables: No chain/target/match by that name.
Banned in postfix-sasl:
Banned in postfix-sasl:
Banned in postfix-sasl: 58.57.4.238
Banned in postfix-sasl:
iptables: No chain/target/match by that name.
Banned in sshd:
Banned in sshd:
Banned in sshd: 58.57.4.238
Banned in sshd:

My iptables at the time:

root@mail:/# iptables -L -n
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
f2b-postfix-sasl  tcp  --  0.0.0.0/0            0.0.0.0/0

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Chain f2b-postfix-sasl (1 references)
target     prot opt source               destination
DROP       all  --  58.57.4.238          0.0.0.0/0
RETURN     all  --  0.0.0.0/0            0.0.0.0/0

As you can see, only one IP is blocked in the f2b-postfix-sasl chain.
However the script reports a lot of empty lines "Banned in " + also falsely reports the IP banned in the sshd chain.

I copied over the version before the refactoring #1654, which outputs correctly:

root@mail:/# bash fail2ban.old
iptables: No chain/target/match by that name.
iptables: No chain/target/match by that name.
Banned in postfix-sasl: 58.57.4.238
iptables: No chain/target/match by that name.

What is affected by this bug?

/usr/local/bin/fail2ban

When does this occur?

always

Actual Behavior

Incorrect output

Expected behavior (i.e. solution)


Same output as before the refactoring.

Solution

None yet. I will take a closer look by the end of the week. @aendeavor do you have an idea what could be the cause?

bug priority 2 [MEDIUM] script related

All 2 comments

Probably due to sloppy work on my side. I will look at this too when I have time. Thanks @casperklein for noticing!

I'm working on it and may have a fix this evening noon. Prepare for review:D

Was this page helpful?
0 / 5 - 0 ratings