问题原文
原帖链接 · 3und80 · CC BY-SA 3.0
I have Fail2Ban running on my Centos Server. (Config below)
In my var/log/messages I noticed something really weird:
Jun 19 12:09:32 localhost fail2ban.actions: INFO [postfix] 114.43.245.205 already banned
I configured Fail2Ban to add the banned IP to iptables.
My jail.conf:
[postfix]
enabled = true
filter = postfix
action = iptables
port = smtp,ssmtp
filter = postfix
logpath = /var/log/maillog
bantime = 43200
maxretry = 2
My postfix.conf:
[INCLUDES]
before = common.conf
[Definition]
failregex = reject: RCPT from (.*)\[<HOST>\]: 550 5.1.1
reject: RCPT from (.*)\[<HOST>\]: 450 4.7.1
reject: RCPT from (.*)\[<HOST>\]: 554 5.7.1
reject: RCPT from (.*)\[<HOST>\]: (.*)@yahoo.com.tw
ignoreregex =
My question is how can anybody that has already been blocked in iptables still connect to the server?
社区高分解答
原帖链接 · JohannesB · CC BY-SA 4.0
If you are using Docker containers to run your application but fail2ban on the host you may run into this issue: https://github.com/fail2ban/fail2ban/issues/2292
Borrowing from the workarounds there, this might be fixable by configuring in you jail.local the line:
[YOUR-JAIL-NAME]
chain = DOCKER-USER
...
Or for Kubernetes
chain = KUBE-FIREWALL
See for more info: https://github.com/fail2ban/fail2ban/issues/2292#issuecomment-593216779
Another option might be in some cases be to use host networking instead of Docker Networking, see: https://docs.docker.com/network/host/
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
