Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scripts/chce_firewall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#

sudo apt update
sudo apt install ufw
sudo apt install ufw ipset

sudo ufw default deny incoming
sudo ufw default allow outgoing
Expand Down Expand Up @@ -49,4 +49,4 @@ ipset create scanned_ports hash:ip,port family inet hashsize 32768 maxelem 65536
iptables -A INPUT -m state --state INVALID -j DROP
iptables -A INPUT -m state --state NEW -m set ! --match-set scanned_ports src,dst -m hashlimit --hashlimit-above 1/hour --hashlimit-burst 5 --hashlimit-mode srcip --hashlimit-name portscan --hashlimit-htable-expire 10000 -j SET --add-set port_scanners src --exist
iptables -A INPUT -m state --state NEW -m set --match-set port_scanners src -j DROP
iptables -A INPUT -m state --state NEW -j SET --add-set scanned_ports src,dst
iptables -A INPUT -m state --state NEW -j SET --add-set scanned_ports src,dst
Loading