1 { pkgs, lib, config, ... }:
3 inherit (builtins) hasAttr readFile;
4 inherit (pkgs.lib) unlinesAttrs;
5 inherit (config) users;
6 inherit (config.services) shorewall shorewall6;
12 DNS(ACCEPT) $FW net {user=${users.users.unbound.name}}
13 DNS(ACCEPT) $FW net:217.70.177.40 # for knot to notify ns6.gandi.net
14 DNS(ACCEPT) $FW net:78.192.65.63 # for knot to notify ns0.muarf.org
16 HKP(ACCEPT) $FW net {user=${users.users.julm.name}}
36 SSH(ACCEPT) net $FW {rate=s:1/min:10}
54 #ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
55 # PORT(S) PORT(S) LIMIT GROUP
60 #ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
61 # PORT(S) PORT(S) LIMIT GROUP
62 PARAM - - udp 60000-61000
67 services.shorewall = {
71 ${readFile "${shorewall.package}/etc-example/shorewall/shorewall.conf"}
79 # DOC: shorewall-zones(5)
86 # DOC: shorewall-interfaces(5)
88 net enp1s0 arp_filter,nosmurfs,routefilter=1,tcpflags
89 lan enp2s0 arp_filter,nosmurfs,routefilter=1,tcpflags
90 unused enp3s0 arp_filter,nosmurfs,routefilter=1,tcpflags
93 # DOC: shorewall-policy(5)
98 # WARNING: the following policy must be last
102 # DOC: shorewall-rules(5)
116 services.shorewall6 = {
118 configs = macros // {
119 "shorewall6.conf" = ''
120 ${readFile "${shorewall6.package}/etc-example/shorewall6/shorewall6.conf"}
128 # DOC: shorewall-zones(5)
135 # DOC: shorewall-interfaces(5)
137 net enp1s0 nosmurfs,tcpflags
138 lan enp2s0 nosmurfs,tcpflags
139 unused enp3s0 nosmurfs,tcpflags
142 # DOC: shorewall-policy(5)
147 # WARNING: the following policy must be last
151 # DOC: shorewall-rules(5)