Explorar o código

Improve ferm configuration to make possible to add firewall rules per user

Emmanuel Bouthenot %!s(int64=10) %!d(string=hai) anos
pai
achega
087271af01
Modificáronse 1 ficheiros con 10 adicións e 0 borrados
  1. 10 0
      roles/common/templates/ferm/ferm.conf.j2

+ 10 - 0
roles/common/templates/ferm/ferm.conf.j2

@@ -40,6 +40,16 @@ table filter {
         # connection tracking
         #mod state state INVALID DROP;
         mod state state (ESTABLISHED RELATED) ACCEPT;
+{% if firewall_private is defined %}
+{% for fwconf in firewall_private %}
+{% if fwconf.users is defined %}
+
+        # Private networks configuration
+        mod owner uid-owner ({{ fwconf.users | join(' ') }}) outerface {{ fwconf.interface }} ACCEPT;
+        outerface {{ fwconf.interface }} DROP;
+{% endif %}
+{% endfor %}
+{% endif %}
     }
 
     chain FORWARD {