sous-chefs / firewall

Development repository for the firewall cookbook
https://supermarket.chef.io/cookbooks/firewall
Apache License 2.0
99 stars 150 forks source link

Windows firewall port range #110

Closed nwesoccer closed 8 years ago

nwesoccer commented 9 years ago

Seems like the method port_to_s causes the netsh advfirewall firewall command to be incorrectly formatted.

Example: netsh advfirewall firewall add rule name="The Traffic" description="The Traffic" dir=in service=any protocol=tcp localip=any localport=1000:1500 interfacetype=any remoteip=any remoteport=any action=allow

when it should be

netsh advfirewall firewall add rule name="The Traffic" description="The Traffic" dir=in service=any protocol=tcp localip=any localport=1000-1500 interfacetype=any remoteip=any remoteport=any action=allow

notice the dash between the port range first port and last port instead of the colon. This colon causes this error STDOUT: A specified port value is not valid.

I would do a Pull-Request, but I'm not sure exactly how to change the code. We could add an if windows check in the port_to_s method, or is there a way to say if using windows firewall, or maybe a way to override the method...?

martinb3 commented 8 years ago

Howdy! I'm not sure if it's just fortuitous timing or if you're working together, but #111 just was submitted as a fix for this issue. As soon as we have testing, I'll merge it. Thanks for the report!!

svanharmelen commented 8 years ago

Well, I guess it's just fortuitous timing as we don't work together :grinning:

nwesoccer commented 8 years ago

Nice! Thanks!

martinb3 commented 8 years ago

Merged in #111.