mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-14 12:56:54 +00:00
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:
parent
2faf1a118c
commit
8c8d93a1e4
@ -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
|
||||
```
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user