Skip to content

Commit d116c65

Browse files
jodurfabaff
authored andcommitted
Update fail2ban.markdown (home-assistant#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
1 parent 263db7b commit d116c65

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

source/_cookbook/fail2ban.markdown

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Then make sure logging is enabled in your `configuration.yaml` file for your Hom
2020
logger:
2121
default: critical
2222
logs:
23-
homeassistant.components.http: warning
23+
homeassistant.components.http.ban: warning
2424
```
2525
2626
Next we will be creating these three files :
@@ -43,12 +43,9 @@ Contents of `/etc/fail2ban/filter.d/hass.local`:
4343
before = common.conf
4444
4545
[Definition]
46-
failregex = ^%(__prefix_line)s.*Login attempt or request with an invalid password from <HOST>.*$
46+
failregex = ^%(__prefix_line)s.*Login attempt or request with invalid authentication from <HOST>.*$
4747
4848
ignoreregex =
49-
50-
[Init]
51-
datepattern = ^%%y-%%m-%%d %%H:%%M:%%S
5249
```
5350

5451
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
5855
enabled = true
5956
filter = hass
6057
action = iptables-allports[name=HASS]
61-
logpath = /opt/hass-prod-cfg/home-assistant.log
58+
logpath = /home/homeassistant/.homeassistant/home-assistant.log
6259
maxretry = 5
6360
```
6461

0 commit comments

Comments
 (0)