Download fail2ban filter configurations

Added commands to download various fail2ban filter configurations for nginx and apache.
This commit is contained in:
科技lion 2025-09-28 14:27:56 +08:00 committed by GitHub
parent 38014e60dc
commit 3baf0acec1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2012,7 +2012,21 @@ web_security() {
1)
f2b_install_sshd
cd /etc/fail2ban/filter.d

# 下载 fail2ban-nginx-cc.conf
curl -sS -O ${gh_proxy}raw.githubusercontent.com/kejilion/sh/main/fail2ban-nginx-cc.conf

# 下载 linuxserver 的 nginx 相关 filter
curl -sS -O ${gh_proxy}raw.githubusercontent.com/linuxserver/fail2ban-confs/master/filter.d/nginx-418.conf
curl -sS -O ${gh_proxy}raw.githubusercontent.com/linuxserver/fail2ban-confs/master/filter.d/nginx-bad-request.conf
curl -sS -O ${gh_proxy}raw.githubusercontent.com/linuxserver/fail2ban-confs/master/filter.d/apache-badbots.conf
curl -sS -O ${gh_proxy}raw.githubusercontent.com/linuxserver/fail2ban-confs/master/filter.d/nginx-botsearch.conf
curl -sS -O ${gh_proxy}raw.githubusercontent.com/linuxserver/fail2ban-confs/master/filter.d/nginx-deny.conf
curl -sS -O ${gh_proxy}raw.githubusercontent.com/linuxserver/fail2ban-confs/master/filter.d/nginx-http-auth.conf
curl -sS -O ${gh_proxy}raw.githubusercontent.com/linuxserver/fail2ban-confs/master/filter.d/nginx-unauthorized.conf
curl -sS -O ${gh_proxy}raw.githubusercontent.com/linuxserver/fail2ban-confs/master/filter.d/php-url-fopen.conf


cd /etc/fail2ban/jail.d/
curl -sS -O ${gh_proxy}raw.githubusercontent.com/kejilion/config/main/fail2ban/nginx-docker-cc.conf
sed -i "/cloudflare/d" /etc/fail2ban/jail.d/nginx-docker-cc.conf