From 8b304d501d052262dd6b725b9f84d7e634c67e9f Mon Sep 17 00:00:00 2001 From: root Date: Wed, 9 Nov 2022 13:27:04 +0000 Subject: ufw rules --- ufw.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 ufw.sh diff --git a/ufw.sh b/ufw.sh new file mode 100755 index 0000000..d08acc2 --- /dev/null +++ b/ufw.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +main() { + ufw --force reset + + + #ufw default allow incoming + ufw default deny incoming on enp2s0 + ufw default allow outgoing + ufw allow in on virbr0 + #ufw allow in on enp2s0 from 95.91.211.71 + + ufw allow in on enp2s0 to any port 22 + + # nginx + ufw allow in on enp2s0 to any port 80 + ufw allow in on enp2s0 to any port 443 + + # dovecot + ufw allow in on enp2s0 to any port 143 + ufw allow in on enp2s0 to any port 993 + ufw allow in on enp2s0 to any port 4190 + ufw allow in on enp2s0 to any port 12302 + + # postfix + ufw allow in on enp2s0 to any port 25 + ufw allow in on enp2s0 to any port 465 + ufw allow in on enp2s0 to any port 587 +} + +main -- cgit v1.2.3