2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-13 16:56:33 +00:00

fix(config): Fix fail2ban filter (#1308)

* Add missing nginx-proxy filter

* Add all nginx log files to fail2ban filter, regardless of frappe site

* Adds per site nginx logs in /var/log
This commit is contained in:
Orsiris de Jong 2022-07-27 11:28:53 +02:00 committed by GitHub
parent 1e0054bc14
commit 94a25d3da7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 3 deletions

View File

@ -113,6 +113,11 @@ server {
{% endfor -%}
# logs in var
access_log /var/log/nginx/{{ site_name }}_access.log main;
error_log /var/log/nginx/{{ site_name }}_error.log;
# optimizations
sendfile on;
keepalive_timeout 15;

View File

@ -1,5 +1,5 @@
---
fail2ban_nginx_access_log: /var/log/nginx/access.log
fail2ban_nginx_access_log: /var/log/nginx/*access.log
maxretry: 6
bantime: 600
findtime: 600
findtime: 600

View File

@ -5,7 +5,10 @@
vars_files:
- ../defaults/main.yml
tasks:
- name: Setup filter
template: src="../templates/nginx-proxy-filter.conf.j2" dest="/etc/fail2ban/filter.d/nginx-proxy.conf"
- name: Setup jail
template: src="../templates/nginx-proxy-jail.conf.j2" dest="/etc/fail2ban/jail.d/nginx-proxy.conf"
- name: restart service
service: name=fail2ban state=restarted
service: name=fail2ban state=restarted