]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/ferm/manifests/per-host.pp
add start of a postfix module to hang firewall rules/monitoring/etc off
[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 [chopin,franck,gluck,kassia,klecker,lobos,morricone,ravel,ries,rietz,saens,schein,santoro,steffani,valente,villa,wieck,stabile,bizet] {
7                 include ferm::ftp
8         }
9
10         case $::hostname {
11                 piatti,samosa: {
12                         @ferm::rule { 'dsa-udd-stunnel':
13                                 description  => 'port 8080 for udd stunnel',
14                                 rule         => '&SERVICE_RANGE(tcp, http-alt, ( 192.25.206.16 70.103.162.29 217.196.43.134 ))'
15                         }
16                 }
17                 danzi: {
18                         @ferm::rule { 'dsa-postgres-danzi':
19                                 description     => 'Allow postgress access',
20                                 rule            => '&SERVICE_RANGE(tcp, 5433, ( 206.12.19.0/24 ))'
21                         }
22                         @ferm::rule { 'dsa-postgres2-danzi':
23                                 description     => 'Allow postgress access2',
24                                 rule            => '&SERVICE_RANGE(tcp, 5437, ( 206.12.19.0/24 ))'
25                         }
26                         @ferm::rule { 'dsa-postgres3-danzi':
27                                 description     => 'Allow postgress access2',
28                                 rule            => '&SERVICE_RANGE(tcp, 5436, ( 206.12.19.0/24 ))'
29                         }
30                 }
31                 abel,alwyn,rietz: {
32                         @ferm::rule { 'dsa-tftp':
33                                 description     => 'Allow tftp access',
34                                 rule            => '&SERVICE(udp, 69)'
35                         }
36                 }
37                 paganini: {
38                         @ferm::rule { 'dsa-dhcp':
39                                 description     => 'Allow dhcp access',
40                                 rule            => '&SERVICE(udp, 67)'
41                         }
42                         @ferm::rule { 'dsa-tftp':
43                                 description     => 'Allow tftp access',
44                                 rule            => '&SERVICE(udp, 69)'
45                         }
46                 }
47                 handel: {
48                         @ferm::rule { 'dsa-puppet':
49                                 description     => 'Allow puppet access',
50                                 rule            => '&SERVICE_RANGE(tcp, 8140, $HOST_DEBIAN_V4)'
51                         }
52                         @ferm::rule { 'dsa-puppet-v6':
53                                 domain          => 'ip6',
54                                 description     => 'Allow puppet access',
55                                 rule            => '&SERVICE_RANGE(tcp, 8140, $HOST_DEBIAN_V6)'
56                         }
57                 }
58                 powell: {
59                         @ferm::rule { 'dsa-powell-v6-tunnel':
60                                 description     => 'Allow powell to use V6 tunnel broker',
61                                 rule            => 'proto ipv6 saddr 212.227.117.6 jump ACCEPT'
62                         }
63                         @ferm::rule { 'dsa-powell-btseed':
64                                 domain          => '(ip ip6)',
65                                 description     => 'Allow powell to seed BT',
66                                 rule            => 'proto tcp dport 8000:8100 jump ACCEPT'
67                         }
68                 }
69                 heininen,lotti: {
70                         @ferm::rule { 'dsa-syslog':
71                                 description     => 'Allow syslog access',
72                                 rule            => '&SERVICE_RANGE(tcp, 5140, $HOST_DEBIAN_V4)'
73                         }
74                         @ferm::rule { 'dsa-syslog-v6':
75                                 domain          => 'ip6',
76                                 description     => 'Allow syslog access',
77                                 rule            => '&SERVICE_RANGE(tcp, 5140, $HOST_DEBIAN_V6)'
78                         }
79                 }
80                 kaufmann: {
81                         @ferm::rule { 'dsa-hkp':
82                                 domain          => '(ip ip6)',
83                                 description     => 'Allow hkp access',
84                                 rule            => '&SERVICE(tcp, 11371)'
85                         }
86                 }
87                 gombert: {
88                         @ferm::rule { 'dsa-infinoted':
89                                 domain          => '(ip ip6)',
90                                 description     => 'Allow infinoted access',
91                                 rule            => '&SERVICE(tcp, 6523)'
92                         }
93                 }
94                 draghi: {
95                         #@ferm::rule { 'dsa-bind':
96                         #    domain          => '(ip ip6)',
97                         #    description     => 'Allow nameserver access',
98                         #    rule            => '&TCP_UDP_SERVICE(53)'
99                         #}
100                         @ferm::rule { 'dsa-finger':
101                                 domain          => '(ip ip6)',
102                                 description     => 'Allow finger access',
103                                 rule            => '&SERVICE(tcp, 79)'
104                         }
105                         @ferm::rule { 'dsa-ldap':
106                                 domain          => '(ip ip6)',
107                                 description     => 'Allow ldap access',
108                                 rule            => '&SERVICE(tcp, 389)'
109                         }
110                         @ferm::rule { 'dsa-ldaps':
111                                 domain          => '(ip ip6)',
112                                 description     => 'Allow ldaps access',
113                                 rule            => '&SERVICE(tcp, 636)'
114                         }
115                 }
116                 cilea: {
117                         ferm::module { 'nf_conntrack_sip': }
118                         ferm::module { 'nf_conntrack_h323': }
119
120                         @ferm::rule { 'dsa-sip':
121                                 domain          => '(ip ip6)',
122                                 description     => 'Allow sip access',
123                                 rule            => '&TCP_UDP_SERVICE(5060)'
124                         }
125                         @ferm::rule { 'dsa-sipx':
126                                 domain          => '(ip ip6)',
127                                 description     => 'Allow sipx access',
128                                 rule            => '&TCP_UDP_SERVICE(5080)'
129                         }
130                 }
131                 scelsi: {
132                         @ferm::rule { 'dc11-icecast':
133                                 domain          => '(ip ip6)',
134                                 description     => 'Allow icecast access',
135                                 rule            => '&SERVICE(tcp, 8000)'
136                         }
137                 }
138                 default: {}
139         }
140
141         if $::hostname in [rautavaara,luchesi] {
142                 @ferm::rule { 'dsa-to-kfreebsd':
143                         description     => 'Traffic routed to kfreebsd hosts',
144                         chain           => 'to-kfreebsd',
145                         rule            => 'proto icmp ACCEPT;
146 source ($FREEBSD_SSH_ACCESS $HOST_NAGIOS_V4) proto tcp dport 22 ACCEPT;
147 source ($HOST_MAILRELAY_V4 $HOST_NAGIOS_V4) proto tcp dport 25 ACCEPT;
148 source ($HOST_MUNIN_V4 $HOST_NAGIOS_V4) proto tcp dport 4949 ACCEPT;
149 source ($HOST_NAGIOS_V4) proto tcp dport 5666 ACCEPT;
150 source ($HOST_NAGIOS_V4) proto udp dport ntp ACCEPT
151 '
152                 }
153                 @ferm::rule { 'dsa-from-kfreebsd':
154                         description     => 'Traffic routed from kfreebsd vlan/bridge',
155                         chain           => 'from-kfreebsd',
156                         rule            => 'proto icmp ACCEPT;
157 proto tcp dport (21 22 80 53 443) ACCEPT;
158 proto udp dport (53 123) ACCEPT;
159 proto tcp dport 8140 daddr 82.195.75.104 ACCEPT; # puppethost
160 proto tcp dport 5140 daddr (82.195.75.98 206.12.19.121) ACCEPT; # loghost
161 proto tcp dport 11371 daddr 82.195.75.107 ACCEPT; # keyring host
162 proto tcp dport (25 submission) daddr ($HOST_MAILRELAY_V4) ACCEPT
163 '
164                 }
165         }
166         case $::hostname {
167                 rautavaara: {
168                         @ferm::rule { 'dsa-routing':
169                                 description     => 'forward chain',
170                                 chain           => 'FORWARD',
171                                 rule            => 'def $ADDRESS_FASCH=194.177.211.201;
172 def $ADDRESS_FIELD=194.177.211.210;
173 def $FREEBSD_HOSTS=($ADDRESS_FASCH $ADDRESS_FIELD);
174
175 policy ACCEPT;
176 mod state state (ESTABLISHED RELATED) ACCEPT;
177 interface vlan11 outerface eth0 jump from-kfreebsd;
178 interface eth0 destination ($FREEBSD_HOSTS) jump to-kfreebsd;
179 ULOG ulog-prefix "REJECT FORWARD: ";
180 REJECT reject-with icmp-admin-prohibited
181 '
182                         }
183                 }
184                 luchesi: {
185                         @ferm::rule { 'dsa-routing':
186                                 description     => 'forward chain',
187                                 chain           => 'FORWARD',
188                                 rule            => 'def $ADDRESS_FANO=206.12.19.110;
189 def $ADDRESS_FINZI=206.12.19.111;
190 def $FREEBSD_HOSTS=($ADDRESS_FANO $ADDRESS_FINZI);
191
192 policy ACCEPT;
193 mod state state (ESTABLISHED RELATED) ACCEPT;
194 interface br0 outerface br0 ACCEPT;
195 interface br1 outerface br1 ACCEPT;
196
197 interface br2 outerface br0 jump from-kfreebsd;
198 interface br0 destination ($FREEBSD_HOSTS) jump to-kfreebsd;
199 ULOG ulog-prefix "REJECT FORWARD: ";
200 REJECT reject-with icmp-admin-prohibited
201 '
202                         }
203                 }
204                 default: {}
205         }
206
207         # redirect snapshot into varnish
208         case $::hostname {
209                 sibelius: {
210                         @ferm::rule { 'dsa-snapshot-varnish':
211                                 rule            => '&SERVICE(tcp, 6081)',
212                         }
213                         @ferm::rule { 'dsa-nat-snapshot-varnish':
214                                 table           => 'nat',
215                                 chain           => 'PREROUTING',
216                                 rule            => 'proto tcp daddr 193.62.202.30 dport 80 REDIRECT to-ports 6081',
217                         }
218                 }
219                 stabile: {
220                         @ferm::rule { 'dsa-snapshot-varnish':
221                                 rule            => '&SERVICE(tcp, 6081)',
222                         }
223                         @ferm::rule { 'dsa-nat-snapshot-varnish':
224                                 table           => 'nat',
225                                 chain           => 'PREROUTING',
226                                 rule            => 'proto tcp daddr 206.12.19.150 dport 80 REDIRECT to-ports 6081',
227                         }
228                 }
229                 default: {}
230         }
231
232         if $::rsyncd {
233                 include ferm::rsync
234         }
235 }