mirror of
https://github.com/YunoHost-Apps/homeassistant_ynh.git
synced 2024-09-03 19:26:16 +02:00
Be more precise on fail2ban rule
This commit is contained in:
parent
e46de3d5a2
commit
efbf604766
3 changed files with 5 additions and 2 deletions
|
@ -11,6 +11,9 @@ app_version=2023.4.1
|
||||||
py_required_version=3.10.11
|
py_required_version=3.10.11
|
||||||
pip_required="pip (<23.1,>=21.0)"
|
pip_required="pip (<23.1,>=21.0)"
|
||||||
|
|
||||||
|
# Fail2ban
|
||||||
|
failregex="^%(__prefix_line)s.*\[homeassistant.components.http.ban\] Login attempt or request with invalid authentication from.* \(<HOST>\).* Requested URL: ./auth/.*"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# PERSONAL HELPERS
|
# PERSONAL HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -65,7 +65,7 @@ yunohost service add $app --description="Home Assistant server" --log="$log_file
|
||||||
ynh_use_logrotate --logfile="$log_file"
|
ynh_use_logrotate --logfile="$log_file"
|
||||||
|
|
||||||
# Create a dedicated Fail2Ban config
|
# Create a dedicated Fail2Ban config
|
||||||
ynh_add_fail2ban_config --logpath="$log_file" --failregex="[homeassistant.components.http.ban] Login attempt or request with invalid authentication from <HOST> .* Requested URL: ./auth/"
|
ynh_add_fail2ban_config --logpath="$log_file" --failregex="$failregex"
|
||||||
|
|
||||||
# Grant sudo permissions to the user to manage his own systemd service
|
# Grant sudo permissions to the user to manage his own systemd service
|
||||||
myynh_create_dir "/etc/sudoers.d"
|
myynh_create_dir "/etc/sudoers.d"
|
||||||
|
|
|
@ -49,7 +49,7 @@ yunohost service add $app --description="Home Assistant server" --log="$log_file
|
||||||
|
|
||||||
ynh_use_logrotate --logfile="$log_file" --non-append
|
ynh_use_logrotate --logfile="$log_file" --non-append
|
||||||
|
|
||||||
ynh_add_fail2ban_config --logpath="$log_file" --failregex="[homeassistant.components.http.ban] Login attempt or request with invalid authentication from <HOST> .* Requested URL: ./auth/"
|
ynh_add_fail2ban_config --logpath="$log_file" --failregex="$failregex"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RECONFIGURE THE APP (UPDATE CONF, APPLY MIGRATIONS, ...)
|
# RECONFIGURE THE APP (UPDATE CONF, APPLY MIGRATIONS, ...)
|
||||||
|
|
Loading…
Add table
Reference in a new issue