LINUX.ORG.RU
ФорумAdmin

Fail2Ban v0.10.0a1 и ошибки iptables

 ,


0

1

Запустил сегодня новый Fail2Ban, смотрю лог, куча каких то ошибок, связанных с iptable, помогите разобраться как от них избавиться и куда копать?

Ошибки:

2016-08-04 09:10:58,763 fail2ban.utils          [2914]: ERROR   iptables -w -n -L INPUT | grep -q 'f2b-sshd[ \t]' -- stderr:
2016-08-04 09:10:58,763 fail2ban.utils          [2914]: ERROR    -- stderr: "iptables v1.4.8: option `-w' requires an argument"
2016-08-04 09:10:58,763 fail2ban.utils          [2914]: ERROR    -- stderr: "Try `iptables -h' or 'iptables --help' for more information."
2016-08-04 09:10:58,763 fail2ban.utils          [2914]: ERROR   iptables -w -n -L INPUT | grep -q 'f2b-sshd[ \t]' -- returned 1
2016-08-04 09:10:58,763 fail2ban.CommandAction  [2914]: ERROR   Invariant check failed. Trying to restore a sane environment
2016-08-04 09:10:58,774 fail2ban.utils          [2914]: ERROR   iptables -w -D INPUT -p tcp -m multiport --dports ssh -j f2b-sshd
iptables -w -F f2b-sshd
iptables -w -X f2b-sshd -- stderr:
2016-08-04 09:10:58,774 fail2ban.utils          [2914]: ERROR    -- stderr: "iptables v1.4.8: option `-w' requires an argument"
2016-08-04 09:10:58,774 fail2ban.utils          [2914]: ERROR    -- stderr: "Try `iptables -h' or 'iptables --help' for more information."
2016-08-04 09:10:58,774 fail2ban.utils          [2914]: ERROR    -- stderr: "iptables v1.4.8: option `-w' requires an argument"
2016-08-04 09:10:58,774 fail2ban.utils          [2914]: ERROR    -- stderr: "Try `iptables -h' or 'iptables --help' for more information."
2016-08-04 09:10:58,774 fail2ban.utils          [2914]: ERROR    -- stderr: "iptables v1.4.8: option `-w' requires an argument"
2016-08-04 09:10:58,775 fail2ban.utils          [2914]: ERROR    -- stderr: "Try `iptables -h' or 'iptables --help' for more information."
2016-08-04 09:10:58,775 fail2ban.utils          [2914]: ERROR   iptables -w -D INPUT -p tcp -m multiport --dports ssh -j f2b-sshd
iptables -w -F f2b-sshd
iptables -w -X f2b-sshd -- returned 2
2016-08-04 09:10:58,786 fail2ban.utils          [2914]: ERROR   ip6tables -w -D INPUT -p tcp -m multiport --dports ssh -j f2b-sshd
ip6tables -w -F f2b-sshd
ip6tables -w -X f2b-sshd -- stderr:
2016-08-04 09:10:58,786 fail2ban.utils          [2914]: ERROR    -- stderr: "ip6tables v1.4.8: option `-w' requires an argument"
2016-08-04 09:10:58,786 fail2ban.utils          [2914]: ERROR    -- stderr: "Try `ip6tables -h' or 'ip6tables --help' for more information."
2016-08-04 09:10:58,786 fail2ban.utils          [2914]: ERROR    -- stderr: "ip6tables v1.4.8: option `-w' requires an argument"
2016-08-04 09:10:58,786 fail2ban.utils          [2914]: ERROR    -- stderr: "Try `ip6tables -h' or 'ip6tables --help' for more information."
2016-08-04 09:10:58,786 fail2ban.utils          [2914]: ERROR    -- stderr: "ip6tables v1.4.8: option `-w' requires an argument"
2016-08-04 09:10:58,786 fail2ban.utils          [2914]: ERROR    -- stderr: "Try `ip6tables -h' or 'ip6tables --help' for more information."
2016-08-04 09:10:58,786 fail2ban.utils          [2914]: ERROR   ip6tables -w -D INPUT -p tcp -m multiport --dports ssh -j f2b-sshd


2016-08-04 09:10:58,786 fail2ban.actions        [2914]: ERROR   Failed to execute ban jail 'sshd' action 'iptables-multiport' info 'CallingMap({'ipjailmatches': <function <lambda> at 0xc747d0>, 'matches': u'Aug  4 09:08:28 p187523 sshd[2770]: Invalid user admin from 103.243.107.204\nAug  4 09:08:28 p187523 sshd[2770]: Failed none for invalid user admin from 103.243.107.204 port 65392 ssh2\nAug  4 09:08:28 p187523 sshd[2770]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=103.243.107.204 \nAug  4 09:08:30 p187523 sshd[2770]: Failed password for invalid user admin from 103.243.107.204 port 65392 ssh2\nAug  4 09:08:33 p187523 sshd[2772]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=103.243.107.204  user=root\nAug  4 09:08:35 p187523 sshd[2772]: Failed password for root from 103.243.107.204 port 51245 ssh2', 'ip': 103.243.107.204, 'ipmatches': <function <lambda> at 0xc746e0>, 'ipfailures': <function <lambda> at 0xc742a8>, 'time': 1470290915.0, 'failures': 6, 'ipjailfailures': <function <lambda> at 0xc74f50>})': Error stopping action
2016-08-04 09:10:58,787 fail2ban.actions        [2914]: NOTICE  [sshd] Ban 116.31.116.40

Весь лог файл: https://yadi.sk/i/kAf14xrMtuKBE



Последнее исправление: Parlixon (всего исправлений: 1)

Ответ на: комментарий от dzhazzz

А ничего что fail2ban через iptables работает (блокирует трафик)?

ТС, посмотри в /etc/fail2ban/action.d/, там собраны конфиги того, как fail2ban вызывает iptables (по идее нужен iptables-common.conf). Найди там опцию lockingopt, убери ключ "-w" (там есть описание что и почему в комменте рядом).

alozovskoy ★★★★★
()
Ответ на: комментарий от dzhazzz

ЛОЛ что? норм он работает, вставляет себе свои цепочки в начало INPUT. Да и все кастомизировать можно.

Bers666 ★★★★★
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.