Update fail2ban.markdown (#3503)

Please update this reference according to the last additions made in the original topic :https://community.home-assistant.io/t/is-there-a-log-file-for-invalid-logins-blocking-hackers/2892/16
This commit is contained in:
jodur 2017-10-11 08:30:32 +02:00 committed by Fabian Affolter
parent 2faf1a118c
commit 8c8d93a1e4
No known key found for this signature in database
GPG Key ID: DDF3D6F44AAB1336

View File

@ -20,7 +20,7 @@ Then make sure logging is enabled in your `configuration.yaml` file for your Hom
logger:
default: critical
logs:
homeassistant.components.http: warning
homeassistant.components.http.ban: warning
```
Next we will be creating these three files :
@ -43,12 +43,9 @@ Contents of `/etc/fail2ban/filter.d/hass.local`:
before = common.conf
[Definition]
failregex = ^%(__prefix_line)s.*Login attempt or request with an invalid password from <HOST>.*$
failregex = ^%(__prefix_line)s.*Login attempt or request with invalid authentication from <HOST>.*$
ignoreregex =
[Init]
datepattern = ^%%y-%%m-%%d %%H:%%M:%%S
```
Contents of `/etc/fail2ban/jail.local` (Note that you'll need to change the `logpath` to match your logfile which will be different from the path listed.):
@ -58,7 +55,7 @@ Contents of `/etc/fail2ban/jail.local` (Note that you'll need to change the `log
enabled = true
filter = hass
action = iptables-allports[name=HASS]
logpath = /opt/hass-prod-cfg/home-assistant.log
logpath = /home/homeassistant/.homeassistant/home-assistant.log
maxretry = 5
```