]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/ferm/manifests/per-host.pp
rsync on glinka
[dsa-puppet.git] / modules / ferm / manifests / per-host.pp
1 class ferm::per-host {
2         if $::hostname in [ancina,zandonai,zelenka] {
3                 include ferm::zivit
4         }
5
6         if $::hostname in [glinka,klecker,merikanto,powell,ravel,rietz,senfl,sibelius,stabile] {
7                 ferm::rule { 'dsa-rsync':
8                         domain      => '(ip ip6)',
9                         description => 'Allow rsync access',
10                         rule        => '&SERVICE(tcp, 873)'
11                 }
12         }
13
14         case $::hostname {
15                 piatti,samosa: {
16                         @ferm::rule { 'dsa-udd-stunnel':
17                                 description  => 'port 8080 for udd stunnel',
18                                 rule         => '&SERVICE_RANGE(tcp, http-alt, ( 192.25.206.16 70.103.162.29 217.196.43.134 ))'
19                         }
20                 }
21                 ullmann: {
22                         @ferm::rule { 'dsa-postgres-udd':
23                                 description     => 'Allow postgress access',
24                                 # quantz, wagner, master
25                                 rule            => '&SERVICE_RANGE(tcp, 5452, ( 206.12.19.122/32 217.196.43.134/32 217.196.43.132/32 82.195.75.110/32 ))'
26                         }
27                         @ferm::rule { 'dsa-postgres-udd6':
28                                 domain          => '(ip6)',
29                                 description     => 'Allow postgress access',
30                                 # quantz
31                                 rule            => '&SERVICE_RANGE(tcp, 5452, ( 2607:f8f0:610:4000:216:36ff:fe40:3860/128 2001:41b8:202:deb:216:36ff:fe40:4001/128 ))'
32                         }
33                 }
34                 grieg: {
35                         @ferm::rule { 'dsa-postgres-ullmann':
36                                 description     => 'Allow postgress access',
37                                 rule            => '&SERVICE_RANGE(tcp, 5433, ( 206.12.19.141/32 ))'
38                         }
39                         @ferm::rule { 'dsa-postgres-ullmann6':
40                                 domain          => '(ip6)',
41                                 description     => 'Allow postgress access',
42                                 rule            => '&SERVICE_RANGE(tcp, 5433, ( 2607:f8f0:610:4000:6564:a62:ce0c:138d/128 ))'
43                         }
44                 }
45                 czerny,clementi: {
46                         @ferm::rule { 'dsa-upsmon':
47                                 description     => 'Allow upsmon access',
48                                 rule            => '&SERVICE_RANGE(tcp, 3493, ( 82.195.75.64/26 192.168.43.0/24 ))'
49                         }
50                 }
51                 danzi: {
52                         @ferm::rule { 'dsa-postgres-danzi':
53                                 description     => 'Allow postgress access',
54                                 rule            => '&SERVICE_RANGE(tcp, 5433, ( 206.12.19.0/24 ))'
55                         }
56                         @ferm::rule { 'dsa-postgres-danzi6':
57                                 domain          => 'ip6',
58                                 description     => 'Allow postgress access',
59                                 rule            => '&SERVICE_RANGE(tcp, 5433, ( 2607:f8f0:610:4000::/64 ))'
60                         }
61
62                         @ferm::rule { 'dsa-postgres2-danzi':
63                                 description     => 'Allow postgress access2',
64                                 rule            => '&SERVICE_RANGE(tcp, 5437, ( 206.12.19.0/24 ))'
65                         }
66                         @ferm::rule { 'dsa-postgres3-danzi':
67                                 description     => 'Allow postgress access3',
68                                 rule            => '&SERVICE_RANGE(tcp, 5436, ( 206.12.19.0/24 ))'
69                         }
70                         @ferm::rule { 'dsa-postgres4-danzi':
71                                 description     => 'Allow postgress access4',
72                                 rule            => '&SERVICE_RANGE(tcp, 5438, ( 206.12.19.0/24 ))'
73                         }
74                 }
75                 abel,alwyn,rietz: {
76                         @ferm::rule { 'dsa-tftp':
77                                 description     => 'Allow tftp access',
78                                 rule            => '&SERVICE(udp, 69)'
79                         }
80                 }
81                 paganini: {
82                         @ferm::rule { 'dsa-dhcp':
83                                 description     => 'Allow dhcp access',
84                                 rule            => '&SERVICE(udp, 67)'
85                         }
86                         @ferm::rule { 'dsa-tftp':
87                                 description     => 'Allow tftp access',
88                                 rule            => '&SERVICE(udp, 69)'
89                         }
90                 }
91                 powell: {
92                         @ferm::rule { 'dsa-powell-v6-tunnel':
93                                 description     => 'Allow powell to use V6 tunnel broker',
94                                 rule            => 'proto ipv6 saddr 212.227.117.6 jump ACCEPT'
95                         }
96                         @ferm::rule { 'dsa-powell-btseed':
97                                 domain          => '(ip ip6)',
98                                 description     => 'Allow powell to seed BT',
99                                 rule            => 'proto tcp dport 8000:8100 jump ACCEPT'
100                         }
101                 }
102                 lotti,lully: {
103                         @ferm::rule { 'dsa-syslog':
104                                 description     => 'Allow syslog access',
105                                 rule            => '&SERVICE_RANGE(tcp, 5140, $HOST_DEBIAN_V4)'
106                         }
107                         @ferm::rule { 'dsa-syslog-v6':
108                                 domain          => 'ip6',
109                                 description     => 'Allow syslog access',
110                                 rule            => '&SERVICE_RANGE(tcp, 5140, $HOST_DEBIAN_V6)'
111                         }
112                 }
113                 kaufmann: {
114                         @ferm::rule { 'dsa-hkp':
115                                 domain          => '(ip ip6)',
116                                 description     => 'Allow hkp access',
117                                 rule            => '&SERVICE(tcp, 11371)'
118                         }
119                 }
120                 gombert: {
121                         @ferm::rule { 'dsa-infinoted':
122                                 domain          => '(ip ip6)',
123                                 description     => 'Allow infinoted access',
124                                 rule            => '&SERVICE(tcp, 6523)'
125                         }
126                 }
127                 draghi: {
128                         #@ferm::rule { 'dsa-bind':
129                         #    domain          => '(ip ip6)',
130                         #    description     => 'Allow nameserver access',
131                         #    rule            => '&TCP_UDP_SERVICE(53)'
132                         #}
133                         @ferm::rule { 'dsa-finger':
134                                 domain          => '(ip ip6)',
135                                 description     => 'Allow finger access',
136                                 rule            => '&SERVICE(tcp, 79)'
137                         }
138                         @ferm::rule { 'dsa-ldap':
139                                 domain          => '(ip ip6)',
140                                 description     => 'Allow ldap access',
141                                 rule            => '&SERVICE(tcp, 389)'
142                         }
143                         @ferm::rule { 'dsa-ldaps':
144                                 domain          => '(ip ip6)',
145                                 description     => 'Allow ldaps access',
146                                 rule            => '&SERVICE(tcp, 636)'
147                         }
148                 }
149                 cilea: {
150                         ferm::module { 'nf_conntrack_sip': }
151                         ferm::module { 'nf_conntrack_h323': }
152
153                         @ferm::rule { 'dsa-sip':
154                                 domain          => '(ip ip6)',
155                                 description     => 'Allow sip access',
156                                 rule            => '&TCP_UDP_SERVICE(5060)'
157                         }
158                         @ferm::rule { 'dsa-sipx':
159                                 domain          => '(ip ip6)',
160                                 description     => 'Allow sipx access',
161                                 rule            => '&TCP_UDP_SERVICE(5080)'
162                         }
163                 }
164                 unger: {
165                         @ferm::rule { 'dsa-notrack-dns-diamond-in':
166                                 domain      => 'ip',
167                                 description => 'NOTRACK for nameserver traffic',
168                                 table       => 'raw',
169                                 chain       => 'PREROUTING',
170                                 rule        => 'destination 82.195.75.108 proto (tcp udp) dport 53 jump NOTRACK'
171                         }
172                         @ferm::rule { 'dsa-notrack-dns-diamond-out':
173                                 domain      => 'ip',
174                                 description => 'NOTRACK for nameserver traffic',
175                                 table       => 'raw',
176                                 chain       => 'PREROUTING',
177                                 rule        => 'source 82.195.75.108 proto (tcp udp) sport 53 jump NOTRACK'
178                         }
179                 }
180                 default: {}
181         }
182
183         if $::hostname in [rautavaara,luchesi] {
184                 @ferm::rule { 'dsa-to-kfreebsd':
185                         description     => 'Traffic routed to kfreebsd hosts',
186                         chain           => 'to-kfreebsd',
187                         rule            => 'proto icmp ACCEPT;
188 source ($FREEBSD_SSH_ACCESS $HOST_NAGIOS_V4) proto tcp dport 22 ACCEPT;
189 source ($HOST_MAILRELAY_V4 $HOST_NAGIOS_V4) proto tcp dport 25 ACCEPT;
190 source ($HOST_MUNIN_V4 $HOST_NAGIOS_V4) proto tcp dport 4949 ACCEPT;
191 source ($HOST_NAGIOS_V4) proto tcp dport 5666 ACCEPT;
192 source ($HOST_NAGIOS_V4) proto udp dport ntp ACCEPT
193 '
194                 }
195                 @ferm::rule { 'dsa-from-kfreebsd':
196                         description     => 'Traffic routed from kfreebsd vlan/bridge',
197                         chain           => 'from-kfreebsd',
198                         rule            => 'proto icmp ACCEPT;
199 proto tcp dport (21 22 80 53 443) ACCEPT;
200 proto udp dport (53 123) ACCEPT;
201 proto tcp dport 8140 daddr 82.195.75.104 ACCEPT; # puppethost
202 proto tcp dport 5140 daddr (82.195.75.99 206.12.19.121) ACCEPT; # loghost
203 proto tcp dport 11371 daddr 82.195.75.107 ACCEPT; # keyring host
204 proto tcp dport (25 submission) daddr ($HOST_MAILRELAY_V4) ACCEPT
205 '
206                 }
207         }
208         case $::hostname {
209                 rautavaara: {
210                         @ferm::rule { 'dsa-routing':
211                                 description     => 'forward chain',
212                                 chain           => 'FORWARD',
213                                 rule            => 'def $ADDRESS_FASCH=194.177.211.201;
214 def $ADDRESS_FIELD=194.177.211.210;
215 def $FREEBSD_HOSTS=($ADDRESS_FASCH $ADDRESS_FIELD);
216
217 policy ACCEPT;
218 mod state state (ESTABLISHED RELATED) ACCEPT;
219 interface vlan11 outerface eth0 jump from-kfreebsd;
220 interface eth0 destination ($FREEBSD_HOSTS) jump to-kfreebsd;
221 ULOG ulog-prefix "REJECT FORWARD: ";
222 REJECT reject-with icmp-admin-prohibited
223 '
224                         }
225                 }
226                 luchesi: {
227                         @ferm::rule { 'dsa-routing':
228                                 description     => 'forward chain',
229                                 chain           => 'FORWARD',
230                                 rule            => 'def $ADDRESS_FANO=206.12.19.110;
231 def $ADDRESS_FINZI=206.12.19.111;
232 def $ADDRESS_FISCHER=206.12.19.112;
233 def $ADDRESS_FALLA=206.12.19.117;
234 def $FREEBSD_HOSTS=($ADDRESS_FANO $ADDRESS_FINZI $ADDRESS_FISCHER $ADDRESS_FALLA);
235
236 policy ACCEPT;
237 mod state state (ESTABLISHED RELATED) ACCEPT;
238 interface br0 outerface br0 ACCEPT;
239 interface br1 outerface br1 ACCEPT;
240
241 interface br2 outerface br0 jump from-kfreebsd;
242 interface br0 destination ($ADDRESS_FISCHER $ADDRESS_FALLA) proto tcp dport 22 ACCEPT;
243 interface br0 destination ($FREEBSD_HOSTS) jump to-kfreebsd;
244 ULOG ulog-prefix "REJECT FORWARD: ";
245 REJECT reject-with icmp-admin-prohibited
246 '
247                         }
248                 }
249                 default: {}
250         }
251
252         # redirect snapshot into varnish
253         case $::hostname {
254                 sibelius: {
255                         @ferm::rule { 'dsa-snapshot-varnish':
256                                 rule            => '&SERVICE(tcp, 6081)',
257                         }
258                         @ferm::rule { 'dsa-nat-snapshot-varnish':
259                                 table           => 'nat',
260                                 chain           => 'PREROUTING',
261                                 rule            => 'proto tcp daddr 193.62.202.30 dport 80 REDIRECT to-ports 6081',
262                         }
263                 }
264                 stabile: {
265                         @ferm::rule { 'dsa-snapshot-varnish':
266                                 rule            => '&SERVICE(tcp, 6081)',
267                         }
268                         @ferm::rule { 'dsa-nat-snapshot-varnish':
269                                 table           => 'nat',
270                                 chain           => 'PREROUTING',
271                                 rule            => 'proto tcp daddr 206.12.19.150 dport 80 REDIRECT to-ports 6081',
272                         }
273                 }
274                 default: {}
275         }
276 }