From: Peter Palfrader Date: Tue, 30 Oct 2018 09:23:42 +0000 (+0100) Subject: Move logging and related/established out of ferm.conf into a dsa.d rule X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=4b7d074506e84ff1055e33b91d050ee82188241d;p=mirror%2Fdsa-puppet.git Move logging and related/established out of ferm.conf into a dsa.d rule --- diff --git a/modules/ferm/manifests/init.pp b/modules/ferm/manifests/init.pp index e939186df..f33c8ba8d 100644 --- a/modules/ferm/manifests/init.pp +++ b/modules/ferm/manifests/init.pp @@ -102,6 +102,11 @@ class ferm { rule => 'saddr ($MUNIN_IPS) NOP' } + file { '/etc/ferm/dsa.d/010-base.conf': + content => template('ferm/dsa.d-010-base.conf.erb'), + notify => Service['ferm'], + } + augeas { 'logrotate_ulogd2': context => '/files/etc/logrotate.d/ulogd2', changes => [ diff --git a/modules/ferm/templates/dsa.d-010-base.conf.erb b/modules/ferm/templates/dsa.d-010-base.conf.erb new file mode 100644 index 000000000..08f1af353 --- /dev/null +++ b/modules/ferm/templates/dsa.d-010-base.conf.erb @@ -0,0 +1,37 @@ +## +## 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 +## + +domain (ip ip6) { + table filter { + chain log_and_reject { + NFLOG nflog-prefix "REJECT: "; + proto tcp REJECT reject-with tcp-reset; + REJECT; + } + + chain log_or_drop { + mod hashlimit hashlimit-name nflogreject hashlimit-mode srcip hashlimit-burst 10 hashlimit 1/second jump log_and_reject; + mod hashlimit hashlimit-name nfloglogdrop hashlimit-mode srcip hashlimit-burst 10 hashlimit 1/second NFLOG nflog-prefix "DROP: "; + DROP; + } + + } +} +domain (ip ip6) { + 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; + } + } +} diff --git a/modules/ferm/templates/ferm.conf.erb b/modules/ferm/templates/ferm.conf.erb index 1981abbfb..9a2442875 100644 --- a/modules/ferm/templates/ferm.conf.erb +++ b/modules/ferm/templates/ferm.conf.erb @@ -7,39 +7,6 @@ @include 'conf.d/'; -domain (ip ip6) { - table filter { - chain log_and_reject { - NFLOG nflog-prefix "REJECT: "; - proto tcp REJECT reject-with tcp-reset; - REJECT; - } - - chain log_or_drop { - mod hashlimit hashlimit-name nflogreject hashlimit-mode srcip hashlimit-burst 10 hashlimit 1/second jump log_and_reject; - mod hashlimit hashlimit-name nfloglogdrop hashlimit-mode srcip hashlimit-burst 10 hashlimit 1/second NFLOG nflog-prefix "DROP: "; - DROP; - } - - } -} -domain (ip ip6) { - 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) {