aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbinary <me@rgoncalves.se>2020-11-19 14:15:32 +0100
committerbinary <me@rgoncalves.se>2020-11-19 14:15:32 +0100
commitf6e22aca8e3559e244c855244f723434556b9aa7 (patch)
treebc099e2ba5ac77e4d8006ab4b4a4f6f50c027e9c
parentfbdb7576ed311a62a4cbf3e73bd858908ff31e18 (diff)
downloadinfrastructure-f6e22aca8e3559e244c855244f723434556b9aa7.tar.gz
Compact the final configuration
-rw-r--r--roles/pf/templates/pf.conf.j223
1 files changed, 9 insertions, 14 deletions
diff --git a/roles/pf/templates/pf.conf.j2 b/roles/pf/templates/pf.conf.j2
index 42b0bea..73971af 100644
--- a/roles/pf/templates/pf.conf.j2
+++ b/roles/pf/templates/pf.conf.j2
@@ -1,17 +1,15 @@
{# pf ~~ templates/pf.conf.j2 #}
# pf ~~ /etc/pf.conf
+# managed by Ansible
-# *
-# common config. by Ansible
-# *
-
+# common configuration
set block-policy drop
set loginterface egress
set skip on { lo tun0 }
-
block all
+# host services
{% for service in services %}
pass in quick on egress proto {{ service["proto"] }} to port {{ service["port"] }}
{% endfor %}
@@ -28,23 +26,20 @@ pass in on egress proto { {{ service.proto }} } from any to any port {{ service.
{##}
{% endfor %}
-# *
-# sub-config. by Ansible
-# *
-
+{#
{% if hypervisor is defined and vms is defined %}
# hypervisor network passthrough
{% for i in range(vms | length + 5) %}
set skip on tap{{ i }}
{% endfor %}
{% endif %}
+#}
-{% include "templates/" + inventory_hostname + "/etc/pf.conf.j2" ignore missing %}
-
-# *
-# out. interface by Ansible
-# *
+# wireguard
+pass in on egress inet proto udp from any to any port 50000
+pass out quick on egress inet from (tun0:network) nat-to (egress:0)
+# output network
pass out quick inet
pass in proto { icmp, icmp6 } all
remember that computers suck.