48 lines
1.0 KiB
Plaintext
48 lines
1.0 KiB
Plaintext
# /etc/fail2ban/jail.local - Versão Limpa e Corrigida
|
|
#
|
|
# Este ficheiro contém APENAS as nossas modificações.
|
|
# Todas as outras configurações são herdadas do /etc/fail2ban/jail.conf.
|
|
|
|
[DEFAULT]
|
|
bantime = 1h
|
|
findtime = 10m
|
|
maxretry = 5
|
|
ignoreip = 127.0.0.1/8 ::1 10.10.253.0/24 10.11.0.0/24
|
|
|
|
# --- JAILS PADRÃO QUE QUEREMOS ATIVAR/MODIFICAR ---
|
|
|
|
[sshd]
|
|
enabled = true
|
|
# Correção para o Debian 12, que usa systemd para os logs do SSH
|
|
backend = systemd
|
|
|
|
# --- AS NOSSAS JAILS PERSONALIZADAS PARA O NGINX ---
|
|
|
|
[nginx-json-attacks]
|
|
enabled = true
|
|
port = http,https
|
|
# Usa o filtro nginx-json-attacks
|
|
filter = nginx-json-attacks
|
|
logpath = /var/log/nginx/access.log
|
|
maxretry = 5
|
|
findtime = 30s
|
|
bantime = 2h
|
|
|
|
[nginx-ddos]
|
|
enabled = true
|
|
port = http,https
|
|
# Usa o filtro nginx-json-ddos
|
|
filter = nginx-json-ddos
|
|
logpath = /var/log/nginx/access.log
|
|
maxretry = 100
|
|
findtime = 60s
|
|
bantime = 1h
|
|
|
|
[recidive]
|
|
enabled = true
|
|
logpath = /var/log/fail2ban.log
|
|
banaction = %(banaction_allports)s
|
|
bantime = 1w
|
|
findtime = 1d
|
|
maxretry = 3
|