Created
April 17, 2013 19:52
-
-
Save jasonruyle/5407227 to your computer and use it in GitHub Desktop.
Securing mongodb and redis on ubuntu
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
# Run in a shell for each service | |
port="6379" # REDIS Port: 6379 | |
#port="27017" # MONGO Port: 27017 | |
server="servername.com" | |
iptables -A INPUT -s $servername.com -p tcp -m tcp --dport $port -j ACCEPT | |
iptables -A INPUT -s localhost -p tcp -m tcp --dport $port -j ACCEPT | |
iptables -A INPUT -p tcp -m tcp --dport $port -j DROP | |
# Control your Rules with iptables -L |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment