Skip to content
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

[BUG] iptables-common.conf not in fail2ban v1.1.0 #575

Open
1 task done
davemidd opened this issue Jun 19, 2024 · 0 comments
Open
1 task done

[BUG] iptables-common.conf not in fail2ban v1.1.0 #575

davemidd opened this issue Jun 19, 2024 · 0 comments
Assignees
Labels

Comments

@davemidd
Copy link

davemidd commented Jun 19, 2024

Describe the bug

fail2ban v1.1.0 doesn't have iptables-common.conf. Instead, iptables.conf should be used.

To Reproduce

Install fail2ban add-on as per instructions.
Restart fail2ban.
fail2ban log shows:

2024-06-19 16:03:26,358 fail2ban.jail           [5122]: INFO    Jail 'nginxrepeatoffender' started
2024-06-19 16:03:26,368 fail2ban.utils          [5122]: ERROR   7ddbcddcf550 -- exec: <iptables> -N f2b-nginxrepeatoffender
<iptables> -A f2b-nginxrepeatoffender -j <returntype>
<iptables> -I <known/chain> -p tcp -j f2b-nginxrepeatoffender
sort -u /etc/fail2ban/nginx.repeatoffender -o /etc/fail2ban/nginx.repeatoffender
cat /etc/fail2ban/nginx.repeatoffender | while read IP; do iptables -I f2b-nginxrepeatoffender 1 -s $IP -j DROP; done
2024-06-19 16:03:26,369 fail2ban.utils          [5122]: ERROR   7ddbcddcf550 -- stderr: '/bin/sh: 1: cannot open iptables: No such file'
2024-06-19 16:03:26,369 fail2ban.utils          [5122]: ERROR   7ddbcddcf550 -- stderr: '/bin/sh: 3: Syntax error: newline unexpected'
2024-06-19 16:03:26,370 fail2ban.utils          [5122]: ERROR   7ddbcddcf550 -- returned 2
2024-06-19 16:03:26,370 fail2ban.actions        [5122]: ERROR   Failed to start jail 'nginxrepeatoffender' action 'nginxrepeatoffender': Error starting action Jail('nginxrepeatoffender')/nginxrepeatoffender: 'Script error'

Expected behavior

fail2ban should start without errors

Server (please complete the following information):

  • Operating System:

  • Ubuntu

  • Specify Exact Version of OS:

Linux aws-voxivo-redirect 6.8.0-1009-aws #9-Ubuntu SMP Fri May 17 14:39:23 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
  • Nginx Version [post output of sudo nginx -v]
nginx version: nginx/1.24.0 (Ubuntu)

Additional information

Fixed by changing [INCLUDES] for action.d/nginxrepeatoffender.conf to 'before = iptables.conf' (instead of iptables-common.conf)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants