Fail2ban filter for sabnzbd?
Posted: May 11th, 2022, 2:24 am
Just wondering if anyone has written a fail2ban filter for sabnzbd they could share?
Code: Select all
server {
# SABNZBD Congig for reverse proxy
listen 443 ssl; # managed by Certbot
server_name sitename.domain.tld
ssl_certificate /etc/letsencrypt/live/sitename.domain.tld/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/sitename.domain.tld/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
root /var/www;
location /{
proxy_pass http://127.0.0.1:5211/; # Local sabnzbdplus ip and non SSL port
}
}
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
server {
if ($host = sitename.domain.tld) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80 ;
server_name sitename.domain.tld;
return 404; # managed by Certbot
}
Code: Select all
[sabnzbd]
enabled = true
port = http,https
filter = sabnzbd
logpath = /home/sabnzbduser/.sabnzbd/logs/sabnzbd.log
maxretry = 4
findtime = 3600
bantime = 172800
Code: Select all
#
# Fail2Ban for SABNZBD via NGINX Reverse Proxy
#
[Definition]
failregex = ^.*Unsuccessful login attempt from 127.0.0.1 \(X-Forwarded-For: <HOST>.*$
^.*API key incorrect, Use the API key from Config-\>General in your 3rd party program: 127.0.0.1 \(X-Forwarded-For: <HOST>.*$