From 3baf0acec11b8e508468a34acf0776362c48cc98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=91=E6=8A=80lion?= <131984541+kejilion@users.noreply.github.com> Date: Sun, 28 Sep 2025 14:27:56 +0800 Subject: [PATCH] Download fail2ban filter configurations Added commands to download various fail2ban filter configurations for nginx and apache. --- kejilion.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/kejilion.sh b/kejilion.sh index 8e49521..420d9ba 100644 --- a/kejilion.sh +++ b/kejilion.sh @@ -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