Created
June 2, 2017 10:27
-
-
Save mrverrall/ac6aa97c427faf7ebab1616018115ff5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Local and established are just fine | |
-A INPUT -i lo -j ACCEPT | |
-A INPUT -d 127.0.0.0/8 ! -i lo -j REJECT --reject-with icmp-port-unreachable | |
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT | |
# SSH Rate Limiting | |
-I INPUT -p tcp --dport 22 -m state --state NEW -m recent --set | |
-I INPUT -p tcp --dport 22 -m state --state NEW -m recent --update --seconds 60 --hitcount 3 -j DROP | |
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT | |
# Pings | |
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT | |
# To hell with the rest | |
-A INPUT -j REJECT --reject-with icmp-port-unreachable | |
-A FORWARD -j REJECT --reject-with icmp-port-unreachable | |
-A OUTPUT -j ACCEPT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment