Issue while installing Fail2Ban

DGXHQ

New Member
Aug 12, 2023
1
0
1
Hello,

i´ve installed ProxMox 7.4-16 and i´ve tried to setup Fail2Ban according to https://pve.proxmox.com/wiki/Fail2ban#Legacy_Option:_Using_rsyslog_Backend

when i run the test Command i get this error:
Code:
~ # fail2ban-regex /var/log/daemon.log /etc/fail2ban/filter.d/proxmox.conf


Running tests

=============


Use   failregex filter file : proxmox, basedir: /etc/fail2ban

Use         log file : /var/log/daemon.log

Use         encoding : UTF-8


Traceback (most recent call last):

  File "/usr/bin/fail2ban-regex", line 34, in <module>

    exec_command_line()

  File "/usr/lib/python3/dist-packages/fail2ban/client/fail2banregex.py", line 836, in exec_command_line

    if not fail2banRegex.start(args):

  File "/usr/lib/python3/dist-packages/fail2ban/client/fail2banregex.py", line 776, in start

    self.process(test_lines)

  File "/usr/lib/python3/dist-packages/fail2ban/client/fail2banregex.py", line 584, in process

    line_datetimestripped, ret, is_ignored = self.testRegex(line)

  File "/usr/lib/python3/dist-packages/fail2ban/client/fail2banregex.py", line 456, in testRegex

    found = self._filter.processLine(line, date)

  File "/usr/lib/python3/dist-packages/fail2ban/server/filter.py", line 613, in processLine

    timeMatch = self.dateDetector.matchTime(line)

  File "/usr/lib/python3/dist-packages/fail2ban/server/datedetector.py", line 368, in matchTime

    (line[distance] == self.__lastPos[2] and not self.__lastPos[2].isalnum())

IndexError: string index out of range

Do you have anything to sugest?

Thanks!
 
This is not a PVE related issue. A quick internet search indicates that this may be due to a formatting of the log, specifically date format in it.
I would recommend reviewing existing articles online that refer to the this error message, reviewing the log file and may be trying a smaller log sample to determine the lines that cause the issue.
After that, if you think fail2ban is not working as it should, you can open a bug with that team. Similar to this: https://github.com/fail2ban/fail2ban/issues/2967

good luck


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox