X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fferm%2Ffiles%2Fferm.conf;h=4159c0a7becdb02486aef49d0284e6f05e9dcf4c;hb=d2ad2858c9a22a1c514626060da4152741277740;hp=166d51702eda404dd10ec08abad0678a2f1769b7;hpb=098142b23269577558d17545033c302ab73b215e;p=mirror%2Fdsa-puppet.git diff --git a/modules/ferm/files/ferm.conf b/modules/ferm/files/ferm.conf index 166d51702..4159c0a7b 100644 --- a/modules/ferm/files/ferm.conf +++ b/modules/ferm/files/ferm.conf @@ -1,18 +1,68 @@ +## +## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE. +## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git +## + # -*- shell-script -*- -# -# Configuration file for ferm(1). -# @include 'conf.d/'; +domain ip { + table filter { + chain log_and_reject { + ULOG ulog-prefix "REJECT: "; + proto tcp REJECT reject-with tcp-reset; + REJECT; + } + + chain log_or_drop { + mod hashlimit hashlimit-name ulogreject hashlimit-mode srcip hashlimit-burst 10 hashlimit 1/second jump log_and_reject; + mod hashlimit hashlimit-name uloglogdrop hashlimit-mode srcip hashlimit-burst 10 hashlimit 1/second ULOG ulog-prefix "DROP: "; + DROP; + } + + } +} +domain ip6 { + table filter { + chain log_and_reject { + LOG log-prefix "REJECT: "; + proto tcp REJECT reject-with tcp-reset; + REJECT; + } + + chain log_or_drop { + mod hashlimit hashlimit-name logreject hashlimit-mode srcip hashlimit-burst 10 hashlimit 1/second jump log_and_reject; + mod hashlimit hashlimit-name loglogdrop hashlimit-mode srcip hashlimit-burst 10 hashlimit 1/second LOG log-prefix "DROP: "; + DROP; + } + } +} domain (ip ip6) { - chain INPUT { - policy DROP; - mod state state (ESTABLISHED RELATED) ACCEPT; - interface lo ACCEPT; - proto icmp ACCEPT; - proto (tcp udp) mod state state (INVALID) DROP; - } + table filter { + chain INPUT { + policy ACCEPT; + mod state state (ESTABLISHED RELATED) ACCEPT; + interface lo ACCEPT; + proto icmp ACCEPT; + # some of our hosts (e.g. villa and lobos) do ipv6 via tunnels (proto 41) + # this requires we allow proto ipv6 to work in all cases. + # without this, ipv6 connectivity only works once the host itself + # created some ipv6 connectivity to some place. + proto ipv6 ACCEPT; + mod state state (INVALID) DROP; + } + } } @include 'dsa.d/'; + +domain (ip ip6) { + chain INPUT { + proto (tcp udp) mod multiport destination-ports (135 137 138 139 445 1026 1027 1433) DROP; + jump log_or_drop; + } +} + +@hook post "umask 0177; iptables-save | sed -e 's/\[.*//' -e 's/^#.*//' | sha256sum > /var/run/iptables-ferm.checksum"; +# vim:set et: