ferm – for Easy Rule Making

ferm is a tool to maintain complex firewalls, without having the trouble to rewrite the complex rules over and over again. ferm allows the entire firewall rule set to be stored in a separate file, and to be loaded with one command. The firewall configuration resembles structured programming-like language, which can contain levels and lists.

http://ferm.foo-projects.org/
https://github.com/cxcv/ferm
https://github.com/nickjj/ansible-ferm