From bed6a32aaac7d56008660d4b1515275c3204e2df Mon Sep 17 00:00:00 2001 From: Bram Prieshof Date: Wed, 11 Mar 2020 10:49:51 +0100 Subject: [PATCH] Add 'CoreModules/generic/conf.sh' --- CoreModules/generic/conf.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 CoreModules/generic/conf.sh diff --git a/CoreModules/generic/conf.sh b/CoreModules/generic/conf.sh new file mode 100644 index 0000000..f0a6d11 --- /dev/null +++ b/CoreModules/generic/conf.sh @@ -0,0 +1,27 @@ +##------------## +# Fail2Ban # +##------------## + +sed -i 's/root@localhost/'$email'/g' /etc/fail2ban/jail.conf +wget -q -t7 "$repo"/raw/branch/"$branch"/config/fail2ban/sshd.local -O /etc/fail2ban/jail.d/sshd.local +if [[ $CMS == "Nextcloud" ]]; then +wget -q -t7 "$repo"/raw/branch/"$branch"/config/fail2ban/nextcloud.conf -O /etc/fail2ban/filter.d/nextcloud.conf +wget -q -t7 "$repo"/raw/branch/"$branch"/config/fail2ban/nextcloud.local -O /etc/fail2ban/jail.d/nextcloud.local +fi +if [[ $CMS == "Wordpress" ]]; then +wget -q -t7 "$repo"/raw/branch/"$branch"/config/fail2ban/wordpress.conf -O /etc/fail2ban/filter.d/wordpress.conf +wget -q -t7 "$repo"/raw/branch/"$branch"/config/fail2ban/wordpress.local -O /etc/fail2ban/jail.d/wordpress.local +fi + + +##-------## +# UFW # +##-------## + +sed -i '/IPV6=/c\IPV6=yes' /etc/default/ufw +ufw default deny incoming > $OUTPUT 2>&1 +ufw default allow outgoing > $OUTPUT 2>&1 +ufw allow 80/tcp > $OUTPUT 2>&1 +ufw allow 443/tcp > $OUTPUT 2>&1 +ufw limit 4242/tcp > $OUTPUT 2>&1 +echo "y" | ufw enable > $OUTPUT 2>&1 \ No newline at end of file