]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/ferm/manifests/per-host.pp
Merge branch 'master' of git+ssh://puppet.debian.org/srv/puppet.debian.org/git/dsa...
[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 [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                 danzi: {
46                         @ferm::rule { 'dsa-postgres-danzi':
47                                 description     => 'Allow postgress access',
48                                 rule            => '&SERVICE_RANGE(tcp, 5433, ( 206.12.19.0/24 ))'
49                         }
50                         @ferm::rule { 'dsa-postgres-danzi6':
51                                 domain          => 'ip6',
52                                 description     => 'Allow postgress access',
53                                 rule            => '&SERVICE_RANGE(tcp, 5433, ( 2607:f8f0:610:4000::/64 ))'
54                         }
55
56                         @ferm::rule { 'dsa-postgres2-danzi':
57                                 description     => 'Allow postgress access2',
58                                 rule            => '&SERVICE_RANGE(tcp, 5437, ( 206.12.19.0/24 ))'
59                         }
60                         @ferm::rule { 'dsa-postgres3-danzi':
61                                 description     => 'Allow postgress access3',
62                                 rule            => '&SERVICE_RANGE(tcp, 5436, ( 206.12.19.0/24 ))'
63                         }
64                         @ferm::rule { 'dsa-postgres4-danzi':
65                                 description     => 'Allow postgress access4',
66                                 rule            => '&SERVICE_RANGE(tcp, 5438, ( 206.12.19.0/24 ))'
67                         }
68                 }
69                 abel,alwyn,rietz: {
70                         @ferm::rule { 'dsa-tftp':
71                                 description     => 'Allow tftp access',
72                                 rule            => '&SERVICE(udp, 69)'
73                         }
74                 }
75                 paganini: {
76                         @ferm::rule { 'dsa-dhcp':
77                                 description     => 'Allow dhcp access',
78                                 rule            => '&SERVICE(udp, 67)'
79                         }
80                         @ferm::rule { 'dsa-tftp':
81                                 description     => 'Allow tftp access',
82                                 rule            => '&SERVICE(udp, 69)'
83                         }
84                 }
85                 powell: {
86                         @ferm::rule { 'dsa-powell-v6-tunnel':
87                                 description     => 'Allow powell to use V6 tunnel broker',
88                                 rule            => 'proto ipv6 saddr 212.227.117.6 jump ACCEPT'
89                         }
90                         @ferm::rule { 'dsa-powell-btseed':
91                                 domain          => '(ip ip6)',
92                                 description     => 'Allow powell to seed BT',
93                                 rule            => 'proto tcp dport 8000:8100 jump ACCEPT'
94                         }
95                 }
96                 lotti,lully: {
97                         @ferm::rule { 'dsa-syslog':
98                                 description     => 'Allow syslog access',
99                                 rule            => '&SERVICE_RANGE(tcp, 5140, $HOST_DEBIAN_V4)'
100                         }
101                         @ferm::rule { 'dsa-syslog-v6':
102                                 domain          => 'ip6',
103                                 description     => 'Allow syslog access',
104                                 rule            => '&SERVICE_RANGE(tcp, 5140, $HOST_DEBIAN_V6)'
105                         }
106                 }
107                 kaufmann: {
108                         @ferm::rule { 'dsa-hkp':
109                                 domain          => '(ip ip6)',
110                                 description     => 'Allow hkp access',
111                                 rule            => '&SERVICE(tcp, 11371)'
112                         }
113                 }
114                 gombert: {
115                         @ferm::rule { 'dsa-infinoted':
116                                 domain          => '(ip ip6)',
117                                 description     => 'Allow infinoted access',
118                                 rule            => '&SERVICE(tcp, 6523)'
119                         }
120                 }
121                 draghi: {
122                         #@ferm::rule { 'dsa-bind':
123                         #    domain          => '(ip ip6)',
124                         #    description     => 'Allow nameserver access',
125                         #    rule            => '&TCP_UDP_SERVICE(53)'
126                         #}
127                         @ferm::rule { 'dsa-finger':
128                                 domain          => '(ip ip6)',
129                                 description     => 'Allow finger access',
130                                 rule            => '&SERVICE(tcp, 79)'
131                         }
132                         @ferm::rule { 'dsa-ldap':
133                                 domain          => '(ip ip6)',
134                                 description     => 'Allow ldap access',
135                                 rule            => '&SERVICE(tcp, 389)'
136                         }
137                         @ferm::rule { 'dsa-ldaps':
138                                 domain          => '(ip ip6)',
139                                 description     => 'Allow ldaps access',
140                                 rule            => '&SERVICE(tcp, 636)'
141                         }
142                 }
143                 cilea: {
144                         ferm::module { 'nf_conntrack_sip': }
145                         ferm::module { 'nf_conntrack_h323': }
146
147                         @ferm::rule { 'dsa-sip':
148                                 domain          => '(ip ip6)',
149                                 description     => 'Allow sip access',
150                                 rule            => '&TCP_UDP_SERVICE(5060)'
151                         }
152                         @ferm::rule { 'dsa-sipx':
153                                 domain          => '(ip ip6)',
154                                 description     => 'Allow sipx access',
155                                 rule            => '&TCP_UDP_SERVICE(5080)'
156                         }
157                 }
158                 unger: {
159                         @ferm::rule { 'dsa-notrack-dns-diamond-in':
160                                 domain      => 'ip',
161                                 description => 'NOTRACK for nameserver traffic',
162                                 table       => 'raw',
163                                 chain       => 'PREROUTING',
164                                 rule        => 'destination 82.195.75.108 proto (tcp udp) dport 53 jump NOTRACK'
165                         }
166                         @ferm::rule { 'dsa-notrack-dns-diamond-out':
167                                 domain      => 'ip',
168                                 description => 'NOTRACK for nameserver traffic',
169                                 table       => 'raw',
170                                 chain       => 'PREROUTING',
171                                 rule        => 'source 82.195.75.108 proto (tcp udp) sport 53 jump NOTRACK'
172                         }
173                 }
174                 default: {}
175         }
176
177         if $::hostname in [rautavaara,luchesi] {
178                 @ferm::rule { 'dsa-to-kfreebsd':
179                         description     => 'Traffic routed to kfreebsd hosts',
180                         chain           => 'to-kfreebsd',
181                         rule            => 'proto icmp ACCEPT;
182 source ($FREEBSD_SSH_ACCESS $HOST_NAGIOS_V4) proto tcp dport 22 ACCEPT;
183 source ($HOST_MAILRELAY_V4 $HOST_NAGIOS_V4) proto tcp dport 25 ACCEPT;
184 source ($HOST_MUNIN_V4 $HOST_NAGIOS_V4) proto tcp dport 4949 ACCEPT;
185 source ($HOST_NAGIOS_V4) proto tcp dport 5666 ACCEPT;
186 source ($HOST_NAGIOS_V4) proto udp dport ntp ACCEPT
187 '
188                 }
189                 @ferm::rule { 'dsa-from-kfreebsd':
190                         description     => 'Traffic routed from kfreebsd vlan/bridge',
191                         chain           => 'from-kfreebsd',
192                         rule            => 'proto icmp ACCEPT;
193 proto tcp dport (21 22 80 53 443) ACCEPT;
194 proto udp dport (53 123) ACCEPT;
195 proto tcp dport 8140 daddr 82.195.75.104 ACCEPT; # puppethost
196 proto tcp dport 5140 daddr (82.195.75.99 206.12.19.121) ACCEPT; # loghost
197 proto tcp dport 11371 daddr 82.195.75.107 ACCEPT; # keyring host
198 proto tcp dport (25 submission) daddr ($HOST_MAILRELAY_V4) ACCEPT
199 '
200                 }
201         }
202         case $::hostname {
203                 rautavaara: {
204                         @ferm::rule { 'dsa-routing':
205                                 description     => 'forward chain',
206                                 chain           => 'FORWARD',
207                                 rule            => 'def $ADDRESS_FASCH=194.177.211.201;
208 def $ADDRESS_FIELD=194.177.211.210;
209 def $FREEBSD_HOSTS=($ADDRESS_FASCH $ADDRESS_FIELD);
210
211 policy ACCEPT;
212 mod state state (ESTABLISHED RELATED) ACCEPT;
213 interface vlan11 outerface eth0 jump from-kfreebsd;
214 interface eth0 destination ($FREEBSD_HOSTS) jump to-kfreebsd;
215 ULOG ulog-prefix "REJECT FORWARD: ";
216 REJECT reject-with icmp-admin-prohibited
217 '
218                         }
219                 }
220                 luchesi: {
221                         @ferm::rule { 'dsa-routing':
222                                 description     => 'forward chain',
223                                 chain           => 'FORWARD',
224                                 rule            => 'def $ADDRESS_FANO=206.12.19.110;
225 def $ADDRESS_FINZI=206.12.19.111;
226 def $ADDRESS_FISCHER=206.12.19.112;
227 def $ADDRESS_FALLA=206.12.19.117;
228 def $FREEBSD_HOSTS=($ADDRESS_FANO $ADDRESS_FINZI $ADDRESS_FISCHER $ADDRESS_FALLA);
229
230 policy ACCEPT;
231 mod state state (ESTABLISHED RELATED) ACCEPT;
232 interface br0 outerface br0 ACCEPT;
233 interface br1 outerface br1 ACCEPT;
234
235 interface br2 outerface br0 jump from-kfreebsd;
236 interface br0 destination ($ADDRESS_FISCHER $ADDRESS_FALLA) proto tcp dport 22 ACCEPT;
237 interface br0 destination ($FREEBSD_HOSTS) jump to-kfreebsd;
238 ULOG ulog-prefix "REJECT FORWARD: ";
239 REJECT reject-with icmp-admin-prohibited
240 '
241                         }
242                 }
243                 default: {}
244         }
245
246         # redirect snapshot into varnish
247         case $::hostname {
248                 sibelius: {
249                         @ferm::rule { 'dsa-snapshot-varnish':
250                                 rule            => '&SERVICE(tcp, 6081)',
251                         }
252                         @ferm::rule { 'dsa-nat-snapshot-varnish':
253                                 table           => 'nat',
254                                 chain           => 'PREROUTING',
255                                 rule            => 'proto tcp daddr 193.62.202.30 dport 80 REDIRECT to-ports 6081',
256                         }
257                 }
258                 stabile: {
259                         @ferm::rule { 'dsa-snapshot-varnish':
260                                 rule            => '&SERVICE(tcp, 6081)',
261                         }
262                         @ferm::rule { 'dsa-nat-snapshot-varnish':
263                                 table           => 'nat',
264                                 chain           => 'PREROUTING',
265                                 rule            => 'proto tcp daddr 206.12.19.150 dport 80 REDIRECT to-ports 6081',
266                         }
267                 }
268                 default: {}
269         }
270 }