2 if $::hostname in [zandonai,zelenka] {
6 if (getfromhash($site::nodeinfo, 'hoster', 'name') == "aql") {
12 @ferm::rule { 'debconf17':
13 description => 'temporarily allow DC17 access',
14 rule => '&SERVICE_RANGE(tcp, 5432, ( 206.167.44.99/32 206.167.36.195/32 ))'
18 @ferm::rule { 'dsa-upsmon':
19 description => 'Allow upsmon access',
20 rule => '&SERVICE_RANGE(tcp, 3493, ( 82.195.75.64/26 192.168.43.0/24 ))'
24 @ferm::rule { 'listmaster-ontp-in':
25 description => 'ONTP has a broken mail setup',
28 rule => 'source 188.165.23.89/32 proto tcp dport 25 jump DROP',
30 @ferm::rule { 'listmaster-ontp-out':
31 description => 'ONTP has a broken mail setup',
34 rule => 'destination 78.8.208.246/32 proto tcp dport 25 jump DROP',
37 lotti,lully,loghost-grnet-01: {
38 @ferm::rule { 'dsa-syslog':
39 description => 'Allow syslog access',
40 rule => '&SERVICE_RANGE(tcp, 5140, $HOST_DEBIAN_V4)'
42 @ferm::rule { 'dsa-syslog-v6':
44 description => 'Allow syslog access',
45 rule => '&SERVICE_RANGE(tcp, 5140, $HOST_DEBIAN_V6)'
47 @ferm::rule { 'fastly-syslog':
48 description => 'Allow syslog access',
49 rule => '&SERVICE_RANGE(tcp, 5141, $HOST_FASTLY)'
53 @ferm::rule { 'dsa-hkp':
55 description => 'Allow hkp access',
56 rule => '&SERVICE(tcp, 11371)'
60 @ferm::rule { 'dsa-infinoted':
62 description => 'Allow infinoted access',
63 rule => '&SERVICE(tcp, 6523)'
67 @ferm::rule { 'dsa-finger':
69 description => 'Allow finger access',
70 rule => '&SERVICE(tcp, 79)'
72 @ferm::rule { 'dsa-ldap':
74 description => 'Allow ldap access',
75 rule => '&SERVICE(tcp, 389)'
77 @ferm::rule { 'dsa-ldaps':
79 description => 'Allow ldaps access',
80 rule => '&SERVICE(tcp, 636)'
84 @ferm::rule { 'dsa-bugs-search':
85 description => 'port 1978 for bugs-search from bug web frontends',
86 rule => '&SERVICE_RANGE(tcp, 1978, ( 140.211.166.26 209.87.16.39 ))'
92 # redirect snapshot into varnish
95 @ferm::rule { 'dsa-snapshot-varnish':
96 rule => '&SERVICE(tcp, 6081)',
98 @ferm::rule { 'dsa-nat-snapshot-varnish':
100 chain => 'PREROUTING',
101 rule => 'proto tcp daddr 193.62.202.30 dport 80 REDIRECT to-ports 6081',
105 @ferm::rule { 'dsa-snapshot-varnish':
106 rule => '&SERVICE(tcp, 6081)',
108 @ferm::rule { 'dsa-nat-snapshot-varnish':
110 chain => 'PREROUTING',
111 rule => 'proto tcp daddr 185.17.185.185 dport 80 REDIRECT to-ports 6081',
118 @ferm::rule { 'dsa-vrrp':
119 rule => 'proto vrrp daddr 224.0.0.18 jump ACCEPT',
121 @ferm::rule { 'dsa-conntrackd':
122 rule => 'interface vlan2 daddr 225.0.0.50 jump ACCEPT',
124 @ferm::rule { 'dsa-bind-notrack-in':
126 description => 'NOTRACK for nameserver traffic',
128 chain => 'PREROUTING',
129 rule => 'proto (tcp udp) daddr 5.153.231.24 dport 53 jump NOTRACK'
132 @ferm::rule { 'dsa-bind-notrack-out':
134 description => 'NOTRACK for nameserver traffic',
137 rule => 'proto (tcp udp) saddr 5.153.231.24 sport 53 jump NOTRACK'
140 @ferm::rule { 'dsa-bind-notrack-in6':
142 description => 'NOTRACK for nameserver traffic',
144 chain => 'PREROUTING',
145 rule => 'proto (tcp udp) daddr 2001:41c8:1000:21::21:24 dport 53 jump NOTRACK'
148 @ferm::rule { 'dsa-bind-notrack-out6':
150 description => 'NOTRACK for nameserver traffic',
153 rule => 'proto (tcp udp) saddr 2001:41c8:1000:21::21:24 sport 53 jump NOTRACK'
162 @ferm::rule { 'dsa-postgres-udd':
163 description => 'Allow postgress access',
164 # quantz, moszumanska, master, coccia
165 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 ))'
167 @ferm::rule { 'dsa-postgres-udd6':
169 description => 'Allow postgress access',
170 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 ))'
174 @ferm::rule { 'dsa-postgres-fasolo':
175 description => 'Allow postgress access',
176 rule => '&SERVICE_RANGE(tcp, 5433, ( 5.153.231.10/32 ))'
178 @ferm::rule { 'dsa-postgres-fasolo6':
180 description => 'Allow postgress access',
181 rule => '&SERVICE_RANGE(tcp, 5433, ( 2001:41c8:1000:21::21:10/128 ))'
184 @ferm::rule { 'dsa-postgres-backup':
185 description => 'Allow postgress access',
186 rule => '&SERVICE_RANGE(tcp, 5433, ( $HOST_PGBACKUPHOST_V4 ))'
188 @ferm::rule { 'dsa-postgres-backup6':
190 description => 'Allow postgress access',
191 rule => '&SERVICE_RANGE(tcp, 5433, ( $HOST_PGBACKUPHOST_V6 ))'
195 @ferm::rule { 'dsa-postgres-main':
196 description => 'Allow postgress access',
197 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 ))'
199 @ferm::rule { 'dsa-postgres-main6':
201 description => 'Allow postgress access',
202 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 ))'
204 @ferm::rule { 'dsa-postgres-dak':
205 description => 'Allow postgress access',
206 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 ))'
208 @ferm::rule { 'dsa-postgres-dak6':
210 description => 'Allow postgress access',
211 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 ))'
213 @ferm::rule { 'dsa-postgres-wannabuild':
215 description => 'Allow postgress access',
216 rule => '&SERVICE_RANGE(tcp, 5436, ( 5.153.231.18/32 209.87.16.38/32 ))'
218 @ferm::rule { 'dsa-postgres-wannabuild6':
220 description => 'Allow postgress access',
221 rule => '&SERVICE_RANGE(tcp, 5436, ( 2001:41c8:1000:21::21:18/128 2607:f8f0:614:1::1274:38/128 ))'
223 @ferm::rule { 'dsa-postgres-bacula':
225 description => 'Allow postgress access1',
226 rule => '&SERVICE_RANGE(tcp, 5437, ( 5.153.231.19/32 93.94.130.161/32 ))'
228 @ferm::rule { 'dsa-postgres-bacula6':
230 description => 'Allow postgress access1',
231 rule => '&SERVICE_RANGE(tcp, 5437, ( 2001:41c8:1000:21::21:19/128 2a02:158:380:280::161/128 ))'
234 @ferm::rule { 'dsa-postgres-backup':
235 description => 'Allow postgress access',
236 rule => '&SERVICE_RANGE(tcp, (5435 5436 5440), ( $HOST_PGBACKUPHOST_V4 ))'
238 @ferm::rule { 'dsa-postgres-backup6':
240 description => 'Allow postgress access',
241 rule => '&SERVICE_RANGE(tcp, (5435 5436 5440), ( $HOST_PGBACKUPHOST_V6 ))'
244 @ferm::rule { 'dsa-postgres-dedup':
246 description => 'Allow postgress access',
247 rule => '&SERVICE_RANGE(tcp, (5439), ( 5.153.231.17/32 ))'
249 @ferm::rule { 'dsa-postgres-dedup6':
251 description => 'Allow postgress access',
252 rule => '&SERVICE_RANGE(tcp, (5439), ( 2001:41c8:1000:21::21:17/128 ))'
255 @ferm::rule { 'dsa-postgres-debsources':
256 description => 'Allow postgress access',
257 rule => '&SERVICE_RANGE(tcp, (5440), ( 5.153.231.38/32 ))'
259 @ferm::rule { 'dsa-postgres-debsources6':
261 description => 'Allow postgress access',
262 rule => '&SERVICE_RANGE(tcp, (5440), ( 2001:41c8:1000:21::21:38/128 ))'
266 @ferm::rule { 'dsa-postgres-danzi':
268 description => 'Allow postgress access',
269 rule => '&SERVICE_RANGE(tcp, 5433, ( 206.12.19.0/24 209.87.16.0/24 5.153.231.18/32 ))'
271 @ferm::rule { 'dsa-postgres-danzi6':
273 description => 'Allow postgress access',
274 rule => '&SERVICE_RANGE(tcp, 5433, ( 2607:f8f0:610:4000::/64 2607:f8f0:614:1::/64 2001:41c8:1000:21::21:18/128 ))'
277 @ferm::rule { 'dsa-postgres2-danzi':
278 description => 'Allow postgress access2',
279 rule => '&SERVICE_RANGE(tcp, 5437, ( 206.12.19.0/24 209.87.16.0/24 ))'
281 @ferm::rule { 'dsa-postgres3-danzi':
282 description => 'Allow postgress access3',
283 rule => '&SERVICE_RANGE(tcp, 5436, ( 206.12.19.0/24 209.87.16.0/24 ))'
285 @ferm::rule { 'dsa-postgres4-danzi':
286 description => 'Allow postgress access4',
287 rule => '&SERVICE_RANGE(tcp, 5438, ( 206.12.19.0/24 209.87.16.0/24 ))'
290 @ferm::rule { 'dsa-postgres-backup':
291 description => 'Allow postgress access',
292 rule => '&SERVICE_RANGE(tcp, 5433, ( $HOST_PGBACKUPHOST_V4 ))'
294 @ferm::rule { 'dsa-postgres-backup6':
296 description => 'Allow postgress access',
297 rule => '&SERVICE_RANGE(tcp, 5433, ( $HOST_PGBACKUPHOST_V6 ))'
301 @ferm::rule { 'dsa-postgres-backup':
302 description => 'Allow postgress access',
303 rule => '&SERVICE_RANGE(tcp, 5432, ( $HOST_PGBACKUPHOST_V4 ))'
305 @ferm::rule { 'dsa-postgres-backup6':
307 description => 'Allow postgress access',
308 rule => '&SERVICE_RANGE(tcp, 5432, ( $HOST_PGBACKUPHOST_V6 ))'
312 @ferm::rule { 'dsa-postgres-backup':
313 description => 'Allow postgress access',
314 rule => '&SERVICE_RANGE(tcp, 5433, ( $HOST_PGBACKUPHOST_V4 ))'
316 @ferm::rule { 'dsa-postgres-backup6':
318 description => 'Allow postgress access',
319 rule => '&SERVICE_RANGE(tcp, 5433, ( $HOST_PGBACKUPHOST_V6 ))'
321 @ferm::rule { 'dsa-postgres-replication':
322 description => 'Allow postgress access',
323 rule => '&SERVICE_RANGE(tcp, 5433, ( 185.17.185.187/32 ))'
325 @ferm::rule { 'dsa-postgres-replication6':
327 description => 'Allow postgress access',
328 rule => '&SERVICE_RANGE(tcp, 5433, ( 2001:1af8:4020:b030:deb::187/128 ))'
332 @ferm::rule { 'dsa-postgres-snapshot':
333 description => 'Allow postgress access',
334 rule => '&SERVICE_RANGE(tcp, 5439, ( 185.17.185.176/28 ))'
336 @ferm::rule { 'dsa-postgres-snapshot6':
338 description => 'Allow postgress access',
339 rule => '&SERVICE_RANGE(tcp, 5439, ( 2001:1af8:4020:b030::/64 ))'
343 @ferm::rule { 'dsa-postgres-backup':
344 description => 'Allow postgress access',
345 rule => '&SERVICE_RANGE(tcp, 5432, ( $HOST_PGBACKUPHOST_V4 ))'
347 @ferm::rule { 'dsa-postgres-backup6':
349 description => 'Allow postgress access',
350 rule => '&SERVICE_RANGE(tcp, 5432, ( $HOST_PGBACKUPHOST_V6 ))'
354 @ferm::rule { 'dsa-postgres-backup':
355 description => 'Allow postgress access',
356 rule => '&SERVICE_RANGE(tcp, (5433 5441), ( $HOST_PGBACKUPHOST_V4 ))'
358 @ferm::rule { 'dsa-postgres-backup6':
360 description => 'Allow postgress access',
361 rule => '&SERVICE_RANGE(tcp, (5433 5441), ( $HOST_PGBACKUPHOST_V6 ))'
369 @ferm::rule { 'dsa-vpn':
370 description => 'Allow openvpn access',
371 rule => '&SERVICE(udp, 17257)'
373 @ferm::rule { 'dsa-routing':
374 description => 'forward chain',
376 rule => 'policy ACCEPT;
377 mod state state (ESTABLISHED RELATED) ACCEPT;
378 interface tun+ ACCEPT;
379 REJECT reject-with icmp-admin-prohibited
382 @ferm::rule { 'dsa-vpn-mark':
384 chain => 'PREROUTING',
385 rule => 'interface tun+ MARK set-mark 1',
387 @ferm::rule { 'dsa-vpn-nat':
389 chain => 'POSTROUTING',
390 rule => 'outerface !tun+ mod mark mark 1 MASQUERADE',
393 ubc-enc2bl01,ubc-enc2bl02,ubc-enc2bl09,ubc-enc2bl10: {
394 @ferm::rule { 'dsa-luca-fixme':
395 description => 'Allow ssh access from mnt and vpn networks',
396 rule => '&SERVICE_RANGE(tcp, 22, ( 172.29.40.0/22 172.29.203.0/24 ))',
404 @ferm::rule { 'dsa-tftp':
405 description => 'Allow tftp access',
406 rule => '&SERVICE_RANGE(udp, 69, ( 172.28.17.0/24 ))'
410 @ferm::rule { 'dsa-tftp':
411 description => 'Allow tftp access',
412 rule => '&SERVICE_RANGE(udp, 69, ( 82.195.75.64/26 192.168.43.0/24 ))'