From 169139273b80de2923f9bb52ea9228c96d89d600 Mon Sep 17 00:00:00 2001 From: Tommy Date: Wed, 3 Nov 2021 03:32:19 -0400 Subject: [PATCH] Added phpMyAdmin-syslog jail --- install.sh | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 36187d7..e1b06da 100644 --- a/install.sh +++ b/install.sh @@ -769,7 +769,8 @@ install_phpmyadmin(){ \$cfg['UploadDir'] = '/var/lib/phpMyAdmin/upload'; \$cfg['SaveDir'] = '/var/lib/phpMyAdmin/save'; \$cfg['CaptchaLoginPublicKey'] = '6LcJcjwUAAAAAO_Xqjrtj9wWufUpYRnK6BW8lnfn'; -\$cfg['CaptchaLoginPrivateKey'] = '6LcJcjwUAAAAALOcDJqAEYKTDhwELCkzUkNDQ0J5' +\$cfg['CaptchaLoginPrivateKey'] = '6LcJcjwUAAAAALOcDJqAEYKTDhwELCkzUkNDQ0J5'; +\$cfg['AuthLog'] = syslog ?> EOF chmod 755 /etc/phpMyAdmin @@ -799,7 +800,8 @@ EOF \$cfg['UploadDir'] = '/var/lib/phpmyadmin/upload'; \$cfg['SaveDir'] = '/var/lib/phpmyadmin/save'; \$cfg['CaptchaLoginPublicKey'] = '6LcJcjwUAAAAAO_Xqjrtj9wWufUpYRnK6BW8lnfn'; -\$cfg['CaptchaLoginPrivateKey'] = '6LcJcjwUAAAAALOcDJqAEYKTDhwELCkzUkNDQ0J5' +\$cfg['CaptchaLoginPrivateKey'] = '6LcJcjwUAAAAALOcDJqAEYKTDhwELCkzUkNDQ0J5'; +\$cfg['AuthLog'] = syslog ?> EOF chmod 755 /etc/phpmyadmin @@ -807,6 +809,20 @@ EOF chown -R www-data:www-data /var/www/pterodactyl chown -R www-data:www-data /var/lib/phpmyadmin/temp fi + + bash -c 'cat > /etc/fail2ban/jail.local' <<-'EOF' +[DEFAULT] +# Ban hosts for ten hours: +bantime = 36000 +# Override /etc/fail2ban/jail.d/00-firewalld.conf: +banaction = iptables-multiport +[sshd] +enabled = true +[phpmyadmin-syslog] +enable = true +maxentry = 15 +EOF + service fail2ban restart } ssl_certs(){ @@ -851,6 +867,7 @@ bantime = 36000 banaction = iptables-multiport [sshd] enabled = true + EOF service fail2ban restart