Use this role to configure pf on OpenBSD or iptables on Debian derived distributions. Only simple incoming rules are currently supported. The configuration defaults to denying all incoming connections.
This role will work on OpenBSD and Debian derived systems.
Fill firewall_rules with an array of hashes to configure incoming rules. The hash supports the following variables:
allowwhether this is an allow or deny rule, can be either true or falseprotowill default totcpbut can also beudporicmpfor examplesourcelist of source ip addresses that are allowed/deniedportthe destination port on the server
None.
The following playbook will allow all icmp traffic and will allow ssh access from 192.168.0.10.
- hosts: servers
vars:
firewall_rules:
- proto: icmp
- port: 22
source:
- 192.168.0.10
roles:
- ivaldi.firewall
BSD
Developed by Frank Groeneveld for use by Ivaldi.