Hello,
I am trying to use fail2ban with the OpenVPN plugin (the normal one, not the NAS).
As there is no rule for OpenVPN, I have created one
The problem I have is that there is no protocol rule when I create the rule.
I have made it manually
1) Create a file
/etc/fail2ban/filter.d/openvpn.conf
[Definition]
failregex = <HOST>:\d{1,5} TLS Auth Error
<HOST>:\d{1,5} VERIFY ERROR:
<HOST>:\d{1,5} TLS Error: TLS handshake failed
<HOST>:\d{1,5} [ECONNREFUSED]: Connection refused
2) Edit the file
/etc/fail2ban/jail.conf
The line protocol = udp is not there. When it is not there the rule doesn't work.
I have to add the line manually (Only the field is missing when I configure a jail)
[OpenVPN]
enabled = yes
protocol = udp
port = 1294
filter = openvpn
logpath = /var/log/openvpn.log
bantime = -1
maxretry = 3
3) After that, I must restart the service fail2bal
service fail2ban stop
service fail2ban start
Am I missing something (the rule is erased everytime I change something).
Thank you
Marc