The discussion revolves around integrating Shorewall with Docker, as both assume exclusive control over the firewall configuration. codinghorror shares a solution using Shorewall’s extension scripts to save and restore Docker-related firewall rules, ensuring both systems coexist.
kpfleming expresses appreciation for Shorewall, while John_Davidson suggests updating the initial solution to address Docker’s changed iptables implementation. jdeyton provides further modifications to prepend rules instead of appending, making the solution more compatible with aggressive Shorewall rules.
By implementing these scripts and adjustments, users can successfully integrate Shorewall and Docker, maintaining both their firewall configurations and Docker’s port forwarding system.
As has been mentioned previously, we lurve us some Docker here at Discourse. We also lurve us some security, and I’ve recently been replacing our “artisinally handcrafted iptables firewall rules” with a Shorewall-managed configuration, which plays better with Puppet. Unfortunately, as it stands, like my twin three year olds, they don’t always play well. The…
Apologies for the thread necromancy, but since this was what got my own swarm services working with shorewall, someone else may find these additional notes handy.
The above scripts may or may not work as expected for your needs, and that’s because you when run iptables -S it gives you the rules back in an append format. If your shorewall rules are fairly aggressive like mine, a simple append means you’ll likely get a DROP long before you reach any of the Docker-specific iptables chains.
Here are my modifications to prepend the rules instead: