Тема: [Рішення] [Fail2ban] [Fedora Server] ERROR
ПРОБЛЕМА
2015-04-21 14:49:18,432 fail2ban.action [5911]: ERROR ipset create fail2ban-recidive hash:ip timeout 86400
firewall-cmd --direct --add-rule ipv4 filter INPUT 0 -p all -m multiport --dports all -m set --match-set fail2ban-recidive src -j REJECT --reject-with icmp-port-unreachable -- stdout: "\x1b[91mError: COMMAND_FAILED: '/sbin/iptables -w -t filter -I INPUT_direct 12 -p all -m multiport --dports all -m set --match-set fail2ban-recidive src -j REJECT --reject-with icmp-port-unreachable' failed: iptables v1.4.21: multiport needs `-p tcp', `-p udp', `-p udplite', `-p sctp' or `-p dccp'\nTry `iptables -h' or 'iptables --help' for more information.\x1b[00m\n"
2015-04-21 14:49:18,439 fail2ban.action [5911]: ERROR ipset create fail2ban-recidive hash:ip timeout 86400
firewall-cmd --direct --add-rule ipv4 filter INPUT 0 -p all -m multiport --dports all -m set --match-set fail2ban-recidive src -j REJECT --reject-with icmp-port-unreachable -- stderr: ''
2015-04-21 14:49:18,444 fail2ban.action [5911]: ERROR ipset create fail2ban-recidive hash:ip timeout 86400
firewall-cmd --direct --add-rule ipv4 filter INPUT 0 -p all -m multiport --dports all -m set --match-set fail2ban-recidive src -j REJECT --reject-with icmp-port-unreachable -- returned 13
РІШЕННЯ
Додати виділенні строки:
[recidive]
enabled = true
port = 0:65535
protocol = tcpТак, як firewall-cmd не підтримує all для параметрів port та protocol.
ПРОБЛЕМА
2015-04-21 14:29:01,502 fail2ban [4084]: CRITICAL Unhandled exception in Fail2Ban:
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/fail2ban/server/jailthread.py", line 64, in run_with_except_hook
run(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/fail2ban/server/filtersystemd.py", line 244, in run
*self.formatJournalEntry(logentry))
File "/usr/lib/python2.7/site-packages/fail2ban/server/filtersystemd.py", line 172, in formatJournalEntry
'SYSLOG_PID', logentry.get['_PID']))
TypeError: 'builtin_function_or_method' object has no attribute '__getitem__'
РІШЕННЯ
Замінити:
if logentry.get('SYSLOG_PID') or logentry.get('_PID'): logelements[-1] += ("[%i]" % logentry.get('SYSLOG_PID', logentry['_PID']))
на:
if logentry.get('SYSLOG_PID') or logentry.get('_PID'): logelements[-1] += ("[%i]" % logentry.get('SYSLOG_PID', logentry.get('_PID')))