1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/freshrss_ynh.git synced 2024-09-03 18:36:33 +02:00

Add fail2ban for the API

This commit is contained in:
lapineige 2021-04-20 09:50:32 +02:00 committed by GitHub
parent f5b50f41bb
commit 8e9addbb9e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -170,6 +170,12 @@ set_permissions
# reconfigure application with latest parameters
sudo -u $app $final_path/cli/reconfigure.php --default_user $admin --auth_type http_auth --environment production --base_url https://$domain$path_url --title FreshRSS --api_enabled --db-type mysql --db-host localhost --db-user $db_name --db-password $db_pwd --db-base $db_name
#=================================================
# SETUP FAIL2BAN
#=================================================
ynh_script_progression --message="Adding fail2ban configuration..."
ynh_add_fail2ban_config_temp "/var/log/nginx/$domain-access.log" ".* - - .*\/api\/[a-z]*(.php)\/accounts\/ClientLogin\?Email=[a-z]*&Passwd=[a-z]* HTTP.* 401 .*" 12 # 10 retries should be enough to permit some tests with (for instance) an app client
#=================================================
# SETUP SSOWAT
#=================================================