So far I’ve found a few tools that let me manage linux firewalls.
-
iptables
-
ufw
-
shorewall
-
ferm
I’m not skilled with any of them, and ufw is the only one I’ve really used. I know enough to block everything but the ports I actually use. I’m a bit fuzzy on firewalls because we have a very good hardware firewall in place that I don’t manage. Adding firewalls to each VM is me being extra careful.
Both iptables and ufw appear to operate by running commands on the command line. So I could do that via the command or shell module. That means I’d end up running the firewall commands every time I run my Ansible playbooks. And I think I’d end up restarting the firewall every time as well.
Both of those things don’t seem like good things to do. Am I right in that? Or would it be perfectly fine to run the commands and restart the firewall every time I run Ansible?
Shorewall and ferm appear to use config files to set the rules, then they run the iptables commands for you from them. At least I think that’s how they work. That would let me use templates for the config file. I like that. But I don’t like how complicated the files are. Both projects documentation is kind of hard to figure out where to start.
I did fine the start of a ufw module (https://groups.google.com/d/topic/ansible-project/I1Vd3oPBfFw/discussion), but it doesn’t look like it’s going anywhere.
What other options are there? What do you do?