Hello,
I successfully installed fail2bain fail2ban_0.9.6-2 using this post on the current osmc version (mar 2018)
and followed this post to monitor ssl accesses to domoticz Setup fail2ban - Domoticz
this is my /etc/fail2ban/jail.d/jail.local
[DEFAULT]
default_backend = systemd
backend = systemd
[sshd]
enabled = true
[domoticz]
enabled = true
port = 443
filter = domoticz
logpath = /tmp/domoticz.txt
maxretry = 5
findtime = 3600
Still using the domoticz.com post I created a /etc/fail2ban/filter.d/domoticz.conf failreg definition :
failregex = Error: Failed login attempt from for user ‘.’ !
Error: Failed login attempt from for '.’ !
Error: [Web:8080] Failed authentication attempt, ignoring client request (remote address: )
Error: [web:443] Failed authentication attempt, ignoring client request (remote address: )
tested the config manually with a sammple log, then with the real domoticz log :
fail2ban-regex /tmp/domoticz.txt /etc/fail2ban/filter.d/domoticz.conf
worked fine : Lines: 9538 lines, 0 ignored, 61 matched, 9477 missed
Trouble is, when I enable the service, no ip is banned, and the process is consuming 20-40% CPU
fail2ban log looks fine to me :
2018-03-20 13:55:23,202 fail2ban.server [29051]: INFO Changed logging target to /var/log/fail2ban.log for Fail2ban v0.9.6
2018-03-20 13:55:23,204 fail2ban.database [29051]: INFO Connected to fail2ban persistent database ‘/var/lib/fail2ban/fail2ban.sqlite3’
2018-03-20 13:55:23,212 fail2ban.jail [29051]: INFO Creating new jail ‘sshd’
2018-03-20 13:55:23,267 fail2ban.jail [29051]: INFO Jail ‘sshd’ uses systemd {}
2018-03-20 13:55:23,353 fail2ban.jail [29051]: INFO Initiated ‘systemd’ backend
2018-03-20 13:55:23,356 fail2ban.filter [29051]: INFO Set findtime = 600
2018-03-20 13:55:23,359 fail2ban.actions [29051]: INFO Set banTime = 600
2018-03-20 13:55:23,359 fail2ban.filter [29051]: INFO Set maxRetry = 5
2018-03-20 13:55:23,361 fail2ban.filter [29051]: INFO Set jail log file encoding to ANSI_X3.4-1968
2018-03-20 13:55:23,362 fail2ban.filter [29051]: INFO Set maxlines = 10
2018-03-20 13:55:23,721 fail2ban.filtersystemd [29051]: INFO Added journal match for: ‘_SYSTEMD_UNIT=sshd.service + _COMM=sshd’
2018-03-20 13:55:23,754 fail2ban.jail [29051]: INFO Creating new jail ‘domoticz’
2018-03-20 13:55:23,755 fail2ban.jail [29051]: INFO Jail ‘domoticz’ uses systemd {}
2018-03-20 13:55:23,766 fail2ban.jail [29051]: INFO Initiated ‘systemd’ backend
2018-03-20 13:55:23,769 fail2ban.filter [29051]: INFO Set findtime = 3600
2018-03-20 13:55:23,775 fail2ban.actions [29051]: INFO Set banTime = 1000
2018-03-20 13:55:23,777 fail2ban.filter [29051]: INFO Set maxRetry = 3
2018-03-20 13:55:23,779 fail2ban.filter [29051]: INFO Set jail log file encoding to ANSI_X3.4-1968
2018-03-20 13:55:23,829 fail2ban.jail [29051]: INFO Jail ‘sshd’ started
2018-03-20 13:55:23,831 fail2ban.filtersystemd [29051]: NOTICE Jail started without ‘journalmatch’ set. Jail regexs will be checked against all journal entries, which is not advised for performance reasons.
2018-03-20 13:55:23,843 fail2ban.jail [29051]: INFO Jail ‘domoticz’ started
That is, until I tried the DEBUG mode, and got this message repeated constantly
[29051]: DEBUG Read systemd journal entry: ‘2018-03-20T13:53:36.481418osmc kernel: [73497.021350] WARN::dwc_otg_handle_mode_mismatch_intr:68: Mode Mismatch Interrupt: currently in Host mode\n’
What could be wrong ? Any help would be greatly appreciated