1 { pkgs, lib, config, ... }:
3 inherit (builtins) hasAttr readFile;
4 inherit (pkgs.lib) unlinesAttrs;
5 inherit (config.users) users;
6 inherit (config.services) shorewall shorewall6;
12 DNS(ACCEPT) $FW net {user=${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.julm.name}}
19 IRCS(ACCEPT) $FW net {user=${users.julm.name}}
20 NTP(ACCEPT) $FW net {user=${users.systemd-timesync.name}}
36 ACCEPT net $FW {proto=tcp, dport=8080}
40 SSH(ACCEPT) net $FW {rate=s:1/min:10}
58 #ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
59 # PORT(S) PORT(S) LIMIT GROUP
64 #ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
65 # PORT(S) PORT(S) LIMIT GROUP
70 #ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
71 # PORT(S) PORT(S) LIMIT GROUP
72 PARAM - - udp 60000-61000
77 services.shorewall = {
81 ${readFile "${shorewall.package}/etc-example/shorewall/shorewall.conf"}
89 # DOC: shorewall-zones(5)
96 # DOC: shorewall-interfaces(5)
98 net enp1s0 arp_filter,nosmurfs,routefilter=1,tcpflags
99 lan enp2s0 arp_filter,nosmurfs,routefilter=1,tcpflags
100 unused enp3s0 arp_filter,nosmurfs,routefilter=1,tcpflags
103 # DOC: shorewall-policy(5)
108 # WARNING: the following policy must be last
112 # DOC: shorewall-rules(5)
126 services.shorewall6 = {
128 configs = macros // {
129 "shorewall6.conf" = ''
130 ${readFile "${shorewall6.package}/etc-example/shorewall6/shorewall6.conf"}
138 # DOC: shorewall-zones(5)
145 # DOC: shorewall-interfaces(5)
147 net enp1s0 nosmurfs,tcpflags
148 lan enp2s0 nosmurfs,tcpflags
149 unused enp3s0 nosmurfs,tcpflags
152 # DOC: shorewall-policy(5)
157 # WARNING: the following policy must be last
161 # DOC: shorewall-rules(5)