-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
action prevents block of ip #4
Comments
Hi Hoflz5, Could you show me your nginx-custom configuration? Anyway, if you see the IP address in the IPTABLE rules but it's not working, is weird. Looks like some iptables misconfiguration. Kind regards |
I'm using fail2ban v11. So the thing is that this works if I comment out the Telegram action as per below: /etc/fail2ban/filter.d/nginx-custom.conf
Jail.local with commented out action to verify that the jail works in a normal case: /etc/fail2ban/jail.local
Trying to exploit any of these, the IP ended up in the jail: sudo fail2ban-client status nginx-custom
Log shows a ban:
And also the iptables: sudo iptables -L -nv
Ban is now working. I cannot reach the site from this IP. BUT! Then enable the action in jail.local (telegram indentation is spaces)
Then restart fail2ban: Jail also shows banned:
iptable also shows banned (the only difference I can see is that pkts and bytes is 0 now:
Log now shows more rows for the new ban of this IP:
if I try to access the same url again, the site loads normally. So ban IS NOT working. I also get notification in the fail2ban log that the IP is already banned:
Also I'm having this warning when starting up the fail2ban service (both with and without Telegram): |
Hi Hoflz, There's another difference between those two IPTABLES output: the port 443. When you enable the action to send telegram messages, just the port 80 is configured:
but when this action is disabled, and an IP address get banned, the destination ports are: 80 and 443.
So, the most probably is that you need to set port 443 in the action configuration as follow:
Kind regards, |
Hmm, that is interesting.
|
When I add the code to my jail.local,
the IP is not stopped anymore. It is still in the iptable, but it I can still access the server from that ip. Any thoughts?
The text was updated successfully, but these errors were encountered: