opscode-cookbooks/iptables — pull request #4 by paigeadele (2013-04-05 22:59:48+00:00)
Title: you can haaaaazzzzzzz .... omg can you ever haz. this is my favorite by ...

...far... easily the most useful thing I've ever written imho. Please Please Please, read the readme file its gonna tell you far more than what I can tell you right off the top of my head at the moment. This really is my favorite cookbook next to my DNS cookbook, actually I have an "ssh script" cookbook that creates something to this effect:

#!/bin/bash
LOCALHOST="127.0.0.1"
ssh -l root -L${LOCALHOST}:4141:127.0.0.1:4040 -L${LOCALHOST}:8999:127.0.0.1:80 -L${LOCALHOST}:9000:127.0.0.1:81 -L${LOCALHOST}:9001:127.0.0.1:82 -L${LOCALHOST}:9002:servicenetip1:80 -L${LOCALHOST}:8091:servicenetip2:8091 -L${LOCALHOST}:8092:servicenetip3:8091 -L${LOCALHOST}:8093:servicenetip4:8091 -L${LOCALHOST}:3306:servicenetip5:3306 -L${LOCALHOST}:3307:servicenetip6:3306 -L${LOCALHOST}:3308:servicenetip7:3306 ectectect

its a very tedious script but it works really really well and nobody can access those addresses except the chef server on rackspace's servicenet (or so, thats the intended purpose of all of this anyway...) basically, the intended purpose is nobody can even ssh to my chef server except me from our work IP and me from my home IP, and I HAVE to ssh to that server to get to ssh to any of the other servers.....really tedious but once you have the hang of it and understand it all well it's really a life saver.