X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Ffail2ban%2Fmanifests%2Finit.pp;h=f4f7b9fd08d2f7c9bb64a8645e3d53c0eee961ba;hb=8e73118c48c6ce00092efbb09bfde05c355933fe;hp=74a650b41527c261c19588e733e5aa0cff20cdf0;hpb=10df4a161694d92106eddd599d2f895e73622f1d;p=mirror%2Fdsa-puppet.git diff --git a/modules/fail2ban/manifests/init.pp b/modules/fail2ban/manifests/init.pp index 74a650b41..f4f7b9fd0 100644 --- a/modules/fail2ban/manifests/init.pp +++ b/modules/fail2ban/manifests/init.pp @@ -12,27 +12,34 @@ class fail2ban { notify => Service['fail2ban'], } - @ferm::conf { 'f2b': + ferm::conf { 'f2b': content => @(EOF), @hook post "type fail2ban-client > /dev/null && (fail2ban-client ping > /dev/null && fail2ban-client reload > /dev/null ) || true"; @hook flush "type fail2ban-client > /dev/null && (fail2ban-client ping > /dev/null && fail2ban-client reload > /dev/null ) || true"; | EOF } - @ferm::rule { 'dsa-f2b-setup': + ferm::rule { 'dsa-f2b-setup1': prio => '005', description => 'f2b master rule', - chain => 'INPUT', + chain => 'dsa-f2b', domain => '(ip ip6)', - rule => 'saddr 0/0 @subchain "dsa-f2b" {}', + rule => '', notarule => true, } + ferm::rule { 'dsa-f2b-setup2': + prio => '005', + description => 'f2b master rule', + chain => 'INPUT', + domain => '(ip ip6)', + rule => 'jump dsa-f2b', + } # XXX Maybe this will be automatically done in buster, it is certainly needed in stretch. So maybe: versioncmp($::lsbmajdistrelease, '9') <= 0 - concat::fragment { 'dsa-puppet-stuff--fail2ban-cleanup': - target => '/etc/cron.d/dsa-puppet-stuff', + concat::fragment { 'puppet-crontab--fail2ban-cleanup': + target => '/etc/cron.d/puppet-crontab', content => @(EOF) - 17 * * * * root python3 -c "import sys, logging; logging.basicConfig(stream=sys.stdout, level=logging.INFO); from fail2ban.server.database import Fail2BanDb; db = Fail2BanDb('/var/lib/fail2ban/fail2ban.sqlite3'); db.purge(); db._db.cursor().execute('VACUUM')" + 17 * * * * root chronic python3 -c "import sys, logging; logging.basicConfig(stream=sys.stdout, level=logging.INFO); from fail2ban.server.database import Fail2BanDb; db = Fail2BanDb('/var/lib/fail2ban/fail2ban.sqlite3'); db.purge(); db._db.cursor().execute('VACUUM')" | EOF }