]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/ferm/templates/ferm.conf.erb
Remove /var/run/iptables-ferm.checksum /var/run/ip6tables-ferm.checksum in a pre...
[dsa-puppet.git] / modules / ferm / templates / ferm.conf.erb
1 ##
2 ## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
3 ## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
4 ##
5
6 # -*- shell-script -*-
7
8 @include 'conf.d/';
9
10 <% if @lsbmajdistrelease >= '8' -%>
11 domain (ip ip6) {
12         table filter {
13               chain log_and_reject {
14                       NFLOG nflog-prefix "REJECT: ";
15                       proto tcp REJECT reject-with tcp-reset;
16                       REJECT;
17               }
18
19               chain log_or_drop {
20                       mod hashlimit hashlimit-name nflogreject  hashlimit-mode srcip hashlimit-burst 10 hashlimit 1/second jump log_and_reject;
21                       mod hashlimit hashlimit-name nfloglogdrop hashlimit-mode srcip hashlimit-burst 10 hashlimit 1/second NFLOG nflog-prefix "DROP: ";
22                       DROP;
23               }
24
25         }
26 }
27 <% else -%>
28 domain ip {
29         table filter {
30               chain log_and_reject {
31                       ULOG ulog-prefix "REJECT: ";
32                       proto tcp REJECT reject-with tcp-reset;
33                       REJECT;
34               }
35
36               chain log_or_drop {
37                       mod hashlimit hashlimit-name ulogreject  hashlimit-mode srcip hashlimit-burst 10 hashlimit 1/second jump log_and_reject;
38                       mod hashlimit hashlimit-name uloglogdrop hashlimit-mode srcip hashlimit-burst 10 hashlimit 1/second ULOG ulog-prefix "DROP: ";
39                       DROP;
40               }
41
42         }
43 }
44 domain ip6 {
45         table filter {
46               chain log_and_reject {
47                       LOG log-prefix "REJECT: ";
48                       proto tcp REJECT reject-with tcp-reset;
49                       REJECT;
50               }
51
52               chain log_or_drop {
53                       mod hashlimit hashlimit-name logreject  hashlimit-mode srcip hashlimit-burst 10 hashlimit 1/second jump log_and_reject;
54                       mod hashlimit hashlimit-name loglogdrop hashlimit-mode srcip hashlimit-burst 10 hashlimit 1/second LOG log-prefix "DROP: ";
55                       DROP;
56               }
57         }
58 }
59 <% end -%>
60 domain (ip ip6) {
61         table filter {
62               chain INPUT {
63                       policy ACCEPT;
64                       mod state state (ESTABLISHED RELATED) ACCEPT;
65                       interface lo ACCEPT;
66                       proto icmp ACCEPT;
67                       # some of our hosts (e.g. villa and lobos) do ipv6 via tunnels (proto 41)
68                       # this requires we allow proto ipv6 to work in all cases.
69                       # without this, ipv6 connectivity only works once the host itself
70                       # created some ipv6 connectivity to some place.
71                       proto ipv6 ACCEPT;
72                       mod state state (INVALID) DROP;
73               }
74         }
75 }
76
77 @include 'dsa.d/';
78
79 domain (ip ip6) {
80         chain INPUT {
81                 proto (tcp udp) mod multiport destination-ports (135 137 138 139 445 1026 1027 1433) DROP;
82                 jump log_or_drop;
83         }
84 }
85
86 @hook pre "umask 0177; rm -f /var/run/iptables-ferm.checksum /var/run/ip6tables-ferm.checksum";
87 @hook post "umask 0177; iptables-save | sed -e 's/\[.*//' -e 's/^#.*//' | sha256sum > /var/run/iptables-ferm.checksum";
88 @hook post "umask 0177; ip6tables-save | sed -e 's/\[.*//' -e 's/^#.*//' | sha256sum > /var/run/ip6tables-ferm.checksum";
89 # vim:set et: