Add port-knocking feature?
Posted: 24 Feb 2010, 13:19
One of my favorite methods of getting into a firewall once something has gone wrong -- and the easiest method I've found for locking *everything* down yet allowing an administrator access from a dynamic location ... is "port knocking".
I run "knockd", a daemon that watches for a unique sequence of port requests. Any other port request in any sequence other than what I require, will fail. However, when the ports are knocked in the sequence I preset, the server is opened to me for a period of time I specify.
This works by the knockd server changing the iptables rules on-the-fly, to allow access to the successful port-knocker.
This has been an extremely easy and effective method I've used for years, on many servers, with tremendous reliability and never a single issue.
I'm now testing csf -- and because csf already runs its own persistent daemon and because it should be the only thing touching the iptables -- it makes sense that csf could include a knockd server, with a simple configuration option to enable it. For example (proposed configuration option for csf):
PORT_KNOCK_ENABLE="1"
PORT_KNOCK_OPEN_TIME="60"
PORT_KNOCK1="10000:TCP"
PORT_KNOCK2="20000:UDP"
PORT_KNOCK3="15000:UDP"
PORT_KNOCK4="25000:TCP"
This would essentially setup the knock daemon to listen for a TCP request on port 10000, then UDP on 20000 and 15000, then TCP on 25000.
If, and only if, that specific sequence occurs (without any other port requests in between), then the origin IP is opened for 60 seconds, in this case.
Is this something you'd consider for csf?
I run "knockd", a daemon that watches for a unique sequence of port requests. Any other port request in any sequence other than what I require, will fail. However, when the ports are knocked in the sequence I preset, the server is opened to me for a period of time I specify.
This works by the knockd server changing the iptables rules on-the-fly, to allow access to the successful port-knocker.
This has been an extremely easy and effective method I've used for years, on many servers, with tremendous reliability and never a single issue.
I'm now testing csf -- and because csf already runs its own persistent daemon and because it should be the only thing touching the iptables -- it makes sense that csf could include a knockd server, with a simple configuration option to enable it. For example (proposed configuration option for csf):
PORT_KNOCK_ENABLE="1"
PORT_KNOCK_OPEN_TIME="60"
PORT_KNOCK1="10000:TCP"
PORT_KNOCK2="20000:UDP"
PORT_KNOCK3="15000:UDP"
PORT_KNOCK4="25000:TCP"
This would essentially setup the knock daemon to listen for a TCP request on port 10000, then UDP on 20000 and 15000, then TCP on 25000.
If, and only if, that specific sequence occurs (without any other port requests in between), then the origin IP is opened for 60 seconds, in this case.
Is this something you'd consider for csf?