]> gitweb.fluxo.info Git - puppet-nodo.git/commitdiff
Extlookup for firewall_ssl_ratelimit
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 20 Jan 2013 18:45:26 +0000 (16:45 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 20 Jan 2013 18:45:26 +0000 (16:45 -0200)
manifests/subsystems/firewall.pp
manifests/subsystems/monitor.pp

index a43662f384b9eb1c2351ccaa67006c565e319dfa..130e63875c5661e6e157b56e930b40af4119b67f 100644 (file)
@@ -2,16 +2,6 @@
 class firewall {
   class { 'shorewall': }
 
-  # SSL computational DoS mitigation
-  # See http://vincent.bernat.im/en/blog/2011-ssl-dos-mitigation.html
-  $firewall_ssl_ratelimit = $firewall_ssl_ratelimit ? {
-    ''      => $firewall_global_ssl_ratelimit ? {
-      ''      => '-',
-      default => $firewall_global_ssl_ratelimit,
-    },
-    default => $firewall_ssl_ratelimit,
-  }
-
   $rfc1918 = $shorewall_local_net ? {
     true    => true,
     false   => false,
@@ -120,13 +110,15 @@ class firewall {
     order           => 102,
   }
 
+  # SSL computational DoS mitigation
+  # See http://vincent.bernat.im/en/blog/2011-ssl-dos-mitigation.html
   shorewall::rule { 'https':
     action          => 'HTTPS/ACCEPT',
     source          => 'net',
     destination     => '$FW',
     proto           => '-',
     destinationport => '-',
-    ratelimit       => "$firewall_ssl_ratelimit",
+    ratelimit       => extlookup("firewall_ssl_ratelimit", '-'),
     order           => 103,
   }
 
index 5be350978ace2d199080cd78017701405805d7b6..2e598384ec393045eb1355523593b8fe8787b3be 100644 (file)
@@ -7,7 +7,7 @@ class monitor(
 
     if $type == 'vserver' {
       include nagios::target::fqdn
-        nagios::service::ping { "$fqdn": }
+      nagios::service::ping { "$fqdn": }
     }
 
     if $type == 'host' or $type == 'personal' {