X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;ds=sidebyside;f=modules%2Froles%2Fmanifests%2Fsnapshot_web.pp;h=627ea9d183bb12d04ffad958e273ab43f72bfb99;hb=97927d5ad35af3af48b7a2d2f105aaf1802a8fcd;hp=e9fd9e3d4c8cdb7f283d77dc08bcb25d0b286dcc;hpb=dd6cf6aa396cb762a80e430b4e38d961a8e124b2;p=mirror%2Fdsa-puppet.git diff --git a/modules/roles/manifests/snapshot_web.pp b/modules/roles/manifests/snapshot_web.pp index e9fd9e3d4..627ea9d18 100644 --- a/modules/roles/manifests/snapshot_web.pp +++ b/modules/roles/manifests/snapshot_web.pp @@ -1,4 +1,8 @@ +# web service for snapshot.debian.org +# class roles::snapshot_web { + include roles::snapshot_secondary + include apache2 include apache2::rewrite @@ -26,7 +30,7 @@ class roles::snapshot_web { # 20181222, excessive number of requests # 208.91.68.213 # 198.11.128.0/18 - # running jugdo against snapshot + # running jigdo against snapshot # 159.226.95.0/24 # 84.204.194.0/24 # 211.13.205.0/24 @@ -44,7 +48,20 @@ class roles::snapshot_web { # 74.121.137.108 ferm::rule { 'dsa-snapshot-abusers': prio => '005', - rule => 'saddr (61.69.254.110 18.128.0.0/9 3.120.0.0/14 35.156.0.0/14 52.58.0.0/15 99.137.191.34 51.15.215.91 208.91.68.213 198.11.128.0/18 159.226.95.0/24 84.204.194.0/24 211.13.205.0/24 63.32.0.0/14 54.72.0.0/15 95.115.66.23 52.192.0.0/11 54.72.0.0/15 34.192.0.0/10 34.240.0.0/13 52.192.0.0/11 90.44.107.223 195.154.173.12 74.121.137.108) DROP', + rule => 'saddr (61.69.254.110 99.137.191.34 51.15.215.91 208.91.68.213 198.11.128.0/18 159.226.95.0/24 84.204.194.0/24 211.13.205.0/24 95.115.66.23 90.44.107.223 195.154.173.12 74.121.137.108) DROP', + } + + # rate limit accesses. The chain is set up by the apache module and allow happens at prio 90. + ferm::rule { 'dsa-http-snapshot-limit': + prio => '22', + description => 'rate limit for snapshot', + chain => 'http', + domain => '(ip ip6)', + rule => ' + mod hashlimit hashlimit-name HTTPDOSPRE hashlimit-mode srcip hashlimit-burst 10 hashlimit 6/minute jump ACCEPT; + mod recent name HTTPDOS update seconds 900 jump log_or_drop; + mod hashlimit hashlimit-name HTTPDOS hashlimit-mode srcip hashlimit-burst 200 hashlimit 30/minute jump ACCEPT; + mod recent name HTTPDOS set jump log_or_drop' } ensure_packages ( [