2 if $::hostname in [zandonai,zelenka] {
6 if (getfromhash($site::nodeinfo, 'hoster', 'name') == "aql") {
12 @ferm::rule { 'dsa-upsmon':
13 description => 'Allow upsmon access',
14 rule => '&SERVICE_RANGE(tcp, 3493, ( 82.195.75.64/26 192.168.43.0/24 ))'
18 @ferm::rule { 'listmaster-ontp-in':
19 description => 'ONTP has a broken mail setup',
22 rule => 'source 188.165.23.89/32 proto tcp dport 25 jump DROP',
24 @ferm::rule { 'listmaster-ontp-out':
25 description => 'ONTP has a broken mail setup',
28 rule => 'destination 78.8.208.246/32 proto tcp dport 25 jump DROP',
31 lotti,lully,loghost-grnet-01: {
32 @ferm::rule { 'dsa-syslog':
33 description => 'Allow syslog access',
34 rule => '&SERVICE_RANGE(tcp, 5140, $HOST_DEBIAN_V4)'
36 @ferm::rule { 'dsa-syslog-v6':
38 description => 'Allow syslog access',
39 rule => '&SERVICE_RANGE(tcp, 5140, $HOST_DEBIAN_V6)'
41 @ferm::rule { 'fastly-syslog':
42 description => 'Allow syslog access',
43 rule => '&SERVICE_RANGE(tcp, 5141, $HOST_FASTLY)'
47 @ferm::rule { 'dsa-hkp':
49 description => 'Allow hkp access',
50 rule => '&SERVICE(tcp, 11371)'
54 @ferm::rule { 'dsa-infinoted':
56 description => 'Allow infinoted access',
57 rule => '&SERVICE(tcp, 6523)'
61 @ferm::rule { 'dsa-finger':
63 description => 'Allow finger access',
64 rule => '&SERVICE(tcp, 79)'
66 @ferm::rule { 'dsa-ldap':
68 description => 'Allow ldap access',
69 rule => '&SERVICE(tcp, 389)'
71 @ferm::rule { 'dsa-ldaps':
73 description => 'Allow ldaps access',
74 rule => '&SERVICE(tcp, 636)'
78 @ferm::rule { 'dsa-bugs-search':
79 description => 'port 1978 for bugs-search from bug web frontends',
80 rule => '&SERVICE_RANGE(tcp, 1978, ( 140.211.166.26 209.87.16.39 ))'
86 # redirect snapshot into varnish
89 @ferm::rule { 'dsa-snapshot-varnish':
90 rule => '&SERVICE(tcp, 6081)',
92 @ferm::rule { 'dsa-nat-snapshot-varnish':
94 chain => 'PREROUTING',
95 rule => 'proto tcp daddr 193.62.202.30 dport 80 REDIRECT to-ports 6081',
99 @ferm::rule { 'dsa-snapshot-varnish':
100 rule => '&SERVICE(tcp, 6081)',
102 @ferm::rule { 'dsa-nat-snapshot-varnish':
104 chain => 'PREROUTING',
105 rule => 'proto tcp daddr 185.17.185.185 dport 80 REDIRECT to-ports 6081',
112 @ferm::rule { 'dsa-vrrp':
113 rule => 'proto vrrp daddr 224.0.0.18 jump ACCEPT',
115 @ferm::rule { 'dsa-conntrackd':
116 rule => 'interface vlan2 daddr 225.0.0.50 jump ACCEPT',
118 @ferm::rule { 'dsa-bind-notrack-in':
120 description => 'NOTRACK for nameserver traffic',
122 chain => 'PREROUTING',
123 rule => 'proto (tcp udp) daddr 5.153.231.24 dport 53 jump NOTRACK'
126 @ferm::rule { 'dsa-bind-notrack-out':
128 description => 'NOTRACK for nameserver traffic',
131 rule => 'proto (tcp udp) saddr 5.153.231.24 sport 53 jump NOTRACK'
134 @ferm::rule { 'dsa-bind-notrack-in6':
136 description => 'NOTRACK for nameserver traffic',
138 chain => 'PREROUTING',
139 rule => 'proto (tcp udp) daddr 2001:41c8:1000:21::21:24 dport 53 jump NOTRACK'
142 @ferm::rule { 'dsa-bind-notrack-out6':
144 description => 'NOTRACK for nameserver traffic',
147 rule => 'proto (tcp udp) saddr 2001:41c8:1000:21::21:24 sport 53 jump NOTRACK'
156 @ferm::rule { 'dsa-postgres-udd':
157 description => 'Allow postgress access',
158 # quantz, moszumanska, master, coccia
159 rule => '&SERVICE_RANGE(tcp, 5452, ( 5.153.231.28/32 5.153.231.21/32 82.195.75.110/32 5.153.231.11/32 ))'
161 @ferm::rule { 'dsa-postgres-udd6':
163 description => 'Allow postgress access',
164 rule => '&SERVICE_RANGE(tcp, 5452, ( 2001:41c8:1000:21::21:28/128 2001:41b8:202:deb:216:36ff:fe40:4001/128 2001:41c8:1000:21::21:11/32 2001:41c8:1000:21::21:21/128 ))'
168 @ferm::rule { 'dsa-postgres-fasolo':
169 description => 'Allow postgress access',
170 rule => '&SERVICE_RANGE(tcp, 5433, ( 5.153.231.10/32 ))'
172 @ferm::rule { 'dsa-postgres-fasolo6':
174 description => 'Allow postgress access',
175 rule => '&SERVICE_RANGE(tcp, 5433, ( 2001:41c8:1000:21::21:10/128 ))'
178 @ferm::rule { 'dsa-postgres-backup':
179 description => 'Allow postgress access',
180 rule => '&SERVICE_RANGE(tcp, 5433, ( $HOST_PGBACKUPHOST_V4 ))'
182 @ferm::rule { 'dsa-postgres-backup6':
184 description => 'Allow postgress access',
185 rule => '&SERVICE_RANGE(tcp, 5433, ( $HOST_PGBACKUPHOST_V6 ))'
189 @ferm::rule { 'dsa-postgres-main':
190 description => 'Allow postgress access',
191 rule => '&SERVICE_RANGE(tcp, 5435, ( 5.153.231.23/32 5.153.231.25/32 209.87.16.38/32 5.153.231.26/32 5.153.231.18/32 5.153.231.28/32 5.153.231.249/32 5.153.231.29/32 5.153.231.43/32 5.153.231.33/32 ))'
193 @ferm::rule { 'dsa-postgres-main6':
195 description => 'Allow postgress access',
196 rule => '&SERVICE_RANGE(tcp, 5435, ( 2001:41c8:1000:21::21:23/128 2001:41c8:1000:21::21:25/128 2607:f8f0:614:1::1274:38/128 2001:41c8:1000:21::21:26/128 2001:41c8:1000:21::21:18/128 2001:41c8:1000:21::21:28/128 2001:41c8:1000:20::20:249/128 2001:41c8:1000:21::21:29/128 2001:41c8:1000:21::21:43/128 2001:41c8:1000:21::21:33/128 ))'
198 @ferm::rule { 'dsa-postgres-dak':
199 description => 'Allow postgress access',
200 rule => '&SERVICE_RANGE(tcp, 5434, ( 5.153.231.11/32 5.153.231.28/32 209.87.16.26/32 5.153.231.21/32 5.153.231.18/32 5.153.231.29/32 128.31.0.69/32 ))'
202 @ferm::rule { 'dsa-postgres-dak6':
204 description => 'Allow postgress access',
205 rule => '&SERVICE_RANGE(tcp, 5434, ( 2001:41c8:1000:21::21:11/128 2001:41c8:1000:21::21:28/128 2607:f8f0:614:1::1274:26/128 2001:41c8:1000:21::21:21/128 2001:41c8:1000:21::21:18/128 2001:41c8:1000:21::21:29/128 ))'
207 @ferm::rule { 'dsa-postgres-wannabuild':
209 description => 'Allow postgress access',
210 rule => '&SERVICE_RANGE(tcp, 5436, ( 5.153.231.18/32 209.87.16.38/32 ))'
212 @ferm::rule { 'dsa-postgres-wannabuild6':
214 description => 'Allow postgress access',
215 rule => '&SERVICE_RANGE(tcp, 5436, ( 2001:41c8:1000:21::21:18/128 2607:f8f0:614:1::1274:38/128 ))'
217 @ferm::rule { 'dsa-postgres-bacula':
219 description => 'Allow postgress access1',
220 rule => '&SERVICE_RANGE(tcp, 5437, ( 5.153.231.19/32 93.94.130.161/32 ))'
222 @ferm::rule { 'dsa-postgres-bacula6':
224 description => 'Allow postgress access1',
225 rule => '&SERVICE_RANGE(tcp, 5437, ( 2001:41c8:1000:21::21:19/128 2a02:158:380:280::161/128 ))'
228 @ferm::rule { 'dsa-postgres-backup':
229 description => 'Allow postgress access',
230 rule => '&SERVICE_RANGE(tcp, (5435 5436 5440), ( $HOST_PGBACKUPHOST_V4 ))'
232 @ferm::rule { 'dsa-postgres-backup6':
234 description => 'Allow postgress access',
235 rule => '&SERVICE_RANGE(tcp, (5435 5436 5440), ( $HOST_PGBACKUPHOST_V6 ))'
238 @ferm::rule { 'dsa-postgres-dedup':
240 description => 'Allow postgress access',
241 rule => '&SERVICE_RANGE(tcp, (5439), ( 5.153.231.17/32 ))'
243 @ferm::rule { 'dsa-postgres-dedup6':
245 description => 'Allow postgress access',
246 rule => '&SERVICE_RANGE(tcp, (5439), ( 2001:41c8:1000:21::21:17/128 ))'
249 @ferm::rule { 'dsa-postgres-debsources':
250 description => 'Allow postgress access',
251 rule => '&SERVICE_RANGE(tcp, (5440), ( 5.153.231.38/32 ))'
253 @ferm::rule { 'dsa-postgres-debsources6':
255 description => 'Allow postgress access',
256 rule => '&SERVICE_RANGE(tcp, (5440), ( 2001:41c8:1000:21::21:38/128 ))'
260 @ferm::rule { 'dsa-postgres-danzi':
262 description => 'Allow postgress access',
263 rule => '&SERVICE_RANGE(tcp, 5433, ( 206.12.19.0/24 209.87.16.0/24 5.153.231.18/32 ))'
265 @ferm::rule { 'dsa-postgres-danzi6':
267 description => 'Allow postgress access',
268 rule => '&SERVICE_RANGE(tcp, 5433, ( 2607:f8f0:610:4000::/64 2607:f8f0:614:1::/64 2001:41c8:1000:21::21:18/128 ))'
271 @ferm::rule { 'dsa-postgres2-danzi':
272 description => 'Allow postgress access2',
273 rule => '&SERVICE_RANGE(tcp, 5437, ( 206.12.19.0/24 209.87.16.0/24 ))'
275 @ferm::rule { 'dsa-postgres3-danzi':
276 description => 'Allow postgress access3',
277 rule => '&SERVICE_RANGE(tcp, 5436, ( 206.12.19.0/24 209.87.16.0/24 ))'
279 @ferm::rule { 'dsa-postgres4-danzi':
280 description => 'Allow postgress access4',
281 rule => '&SERVICE_RANGE(tcp, 5438, ( 206.12.19.0/24 209.87.16.0/24 ))'
284 @ferm::rule { 'dsa-postgres-backup':
285 description => 'Allow postgress access',
286 rule => '&SERVICE_RANGE(tcp, 5433, ( $HOST_PGBACKUPHOST_V4 ))'
288 @ferm::rule { 'dsa-postgres-backup6':
290 description => 'Allow postgress access',
291 rule => '&SERVICE_RANGE(tcp, 5433, ( $HOST_PGBACKUPHOST_V6 ))'
295 @ferm::rule { 'dsa-postgres-backup':
296 description => 'Allow postgress access',
297 rule => '&SERVICE_RANGE(tcp, 5432, ( $HOST_PGBACKUPHOST_V4 ))'
299 @ferm::rule { 'dsa-postgres-backup6':
301 description => 'Allow postgress access',
302 rule => '&SERVICE_RANGE(tcp, 5432, ( $HOST_PGBACKUPHOST_V6 ))'
306 @ferm::rule { 'dsa-postgres-backup':
307 description => 'Allow postgress access',
308 rule => '&SERVICE_RANGE(tcp, 5433, ( $HOST_PGBACKUPHOST_V4 ))'
310 @ferm::rule { 'dsa-postgres-backup6':
312 description => 'Allow postgress access',
313 rule => '&SERVICE_RANGE(tcp, 5433, ( $HOST_PGBACKUPHOST_V6 ))'
315 @ferm::rule { 'dsa-postgres-replication':
316 description => 'Allow postgress access',
317 rule => '&SERVICE_RANGE(tcp, 5433, ( 185.17.185.187/32 ))'
319 @ferm::rule { 'dsa-postgres-replication6':
321 description => 'Allow postgress access',
322 rule => '&SERVICE_RANGE(tcp, 5433, ( 2001:1af8:4020:b030:deb::187/128 ))'
326 @ferm::rule { 'dsa-postgres-snapshot':
327 description => 'Allow postgress access',
328 rule => '&SERVICE_RANGE(tcp, 5439, ( 185.17.185.176/28 ))'
330 @ferm::rule { 'dsa-postgres-snapshot6':
332 description => 'Allow postgress access',
333 rule => '&SERVICE_RANGE(tcp, 5439, ( 2001:1af8:4020:b030::/64 ))'
341 @ferm::rule { 'dsa-vpn':
342 description => 'Allow openvpn access',
343 rule => '&SERVICE(udp, 17257)'
345 @ferm::rule { 'dsa-routing':
346 description => 'forward chain',
348 rule => 'policy ACCEPT;
349 mod state state (ESTABLISHED RELATED) ACCEPT;
350 interface tun+ ACCEPT;
351 REJECT reject-with icmp-admin-prohibited
354 @ferm::rule { 'dsa-vpn-mark':
356 chain => 'PREROUTING',
357 rule => 'interface tun+ MARK set-mark 1',
359 @ferm::rule { 'dsa-vpn-nat':
361 chain => 'POSTROUTING',
362 rule => 'outerface !tun+ mod mark mark 1 MASQUERADE',
365 ubc-enc2bl01,ubc-enc2bl02,ubc-enc2bl09,ubc-enc2bl10: {
366 @ferm::rule { 'dsa-luca-fixme':
367 description => 'Allow ssh access from mnt and vpn networks',
368 rule => '&SERVICE_RANGE(tcp, 22, ( 172.29.40.0/22 172.29.203.0/24 ))',
376 @ferm::rule { 'dsa-tftp':
377 description => 'Allow tftp access',
378 rule => '&SERVICE_RANGE(udp, 69, ( 172.28.17.0/24 ))'
382 @ferm::rule { 'dsa-tftp':
383 description => 'Allow tftp access',
384 rule => '&SERVICE_RANGE(udp, 69, ( 82.195.75.64/26 192.168.43.0/24 ))'