From d116c65d9eacaf6ca852247fc18c3b946a7ea4f0 Mon Sep 17 00:00:00 2001 From: jodur Date: Wed, 11 Oct 2017 08:30:32 +0200 Subject: [PATCH] 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 --- source/_cookbook/fail2ban.markdown | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/source/_cookbook/fail2ban.markdown b/source/_cookbook/fail2ban.markdown index 8eed73efb0c..505fad6272d 100644 --- a/source/_cookbook/fail2ban.markdown +++ b/source/_cookbook/fail2ban.markdown @@ -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 .*$ +failregex = ^%(__prefix_line)s.*Login attempt or request with invalid authentication from .*$ 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 ```