chiark / gitweb /
local.m4: Add the `hippotat' network.
[firewall] / vampire.m4
1 ### -*-sh-*-
2 ###
3 ### Firewall configuration for vampire
4 ###
5 ### (c) 2008 Mark Wooding
6 ###
7
8 ###----- Licensing notice ---------------------------------------------------
9 ###
10 ### This program is free software; you can redistribute it and/or modify
11 ### it under the terms of the GNU General Public License as published by
12 ### the Free Software Foundation; either version 2 of the License, or
13 ### (at your option) any later version.
14 ###
15 ### This program is distributed in the hope that it will be useful,
16 ### but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 ### GNU General Public License for more details.
19 ###
20 ### You should have received a copy of the GNU General Public License
21 ### along with this program; if not, write to the Free Software Foundation,
22 ### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23
24 ###--------------------------------------------------------------------------
25 ### vampire-specific rules.
26
27 m4_divert(86)m4_dnl
28 ## Externally visible services.
29 allowservices inbound tcp \
30         ident \
31         ssh \
32         tor_public tor_directory i2p
33 allowservices inbound udp \
34         tripe \
35         gnutella_svc \
36         i2p
37
38 ## Extend some services to local untrusted hosts.
39 clearchain inbound-untrusted
40 run iptables -A inbound -j inbound-untrusted -s $net_inet_untrusted
41 run ip6tables -A inbound -j inbound-untrusted -s $net_inet6_untrusted
42
43 allowservices inbound-untrusted tcp \
44         dns \
45         lpd \
46         netbios_ssn microsoft_ds
47 allowservices inbound-untrusted udp \
48         dns \
49         tftp
50
51 ## Provide syslog for evolution.
52 run iptables -A inbound -j ACCEPT \
53         -s 172.29.198.2 \
54         -p udp --destination-port $port_syslog
55
56 ## Watch outgoing Tor usage.
57 run iptables -A OUTPUT -m multiport \
58         -p tcp --source-ports $port_tor_public,$port_tor_directory
59
60 ## Other interesting things.
61 dnsresolver inbound
62 dnsserver inbound
63 ntpclient inbound $ntp_servers
64
65 ## Provide NTP service to untrusted clients.
66 iptables -A inbound -p udp -j ACCEPT \
67         --source-port 123 --destination-port 123 \
68         -s 172.29.198.0/23
69 ip6tables -A inbound -p udp -j ACCEPT \
70         --source-port 123 --destination-port 123 \
71         -s 2001:ba8:1d9::/48
72 ip6tables -A inbound -p udp -j ACCEPT \
73         --source-port 123 --destination-port 123 \
74         -s 2001:8b0:c92::/48
75
76 m4_divert(-1)
77 ###----- That's all, folks --------------------------------------------------