]> git.donarmstrong.com Git - dsa-puppet.git/commitdiff
how bad can this go
authorStephen Gran <steve@lobefin.net>
Sat, 20 Feb 2010 20:20:29 +0000 (20:20 +0000)
committerStephen Gran <steve@lobefin.net>
Sat, 20 Feb 2010 20:20:29 +0000 (20:20 +0000)
Signed-off-by: Stephen Gran <steve@lobefin.net>
modules/ferm/files/defs.conf [new file with mode: 0644]
modules/ferm/manifests/init.pp
modules/ferm/templates/me.conf.erb

diff --git a/modules/ferm/files/defs.conf b/modules/ferm/files/defs.conf
new file mode 100644 (file)
index 0000000..329d7ed
--- /dev/null
@@ -0,0 +1,28 @@
+@def &SERVICE($proto, $port) = {
+ domain (ip ip6) chain INPUT proto $proto dport $port ACCEPT;
+}
+
+@def &V4_SERVICE($proto, $port) = {
+ domain ip chain INPUT proto $proto dport $port ACCEPT;
+}
+
+@def &V6_SERVICE($proto, $port) = {
+ domain ip6 chain INPUT proto $proto dport $port ACCEPT;
+}
+
+@def &V4_SERVICE_RANGE($proto, $port, $srange) = {
+ domain ip chain INPUT proto $proto dport $port saddr $srange ACCEPT;
+}
+
+@def &V6_SERVICE_RANGE($proto, $port, $srange) = {
+ domain ip6 chain INPUT proto $proto dport $port saddr $srange ACCEPT;
+}
+
+@def $HOST_MUNIN  = (192.25.206.57 192.25.206.33);
+@def $HOST_NAGIOS = (192.25.206.57 192.25.206.33);
+
+@def $sgran  = (91.103.132.25 2001:4b10:100b::dead:f00d);
+@def $weasel = ();
+@def $zobel  = ();
+@def $luca   = ();
+@def $DSA_IPS = ($sgran $weasel $zobel $luca);
index ee9ce77c72366d30f9d095db5d5e9a2f71bc47f3..5bedd6c9f37b45945c590aed42ad4889923cd133 100644 (file)
@@ -27,11 +27,15 @@ class ferm {
                         content => template("ferm/me.conf.erb"),
                         require => Package["ferm"],
                         notify  => Exec["ferm restart"];
+                "/etc/ferm/conf.d/defs.conf":
+                        source  => "puppet:///ferm/defs.conf",
+                        require => Package["ferm"],
+                        notify  => Exec["ferm restart"];
         }
 
         ferm::rule { "dsa-ssh":
                 description     => "Allow SSH from DSA",
-                rule            => "proto tcp mod state state (NEW) dport (ssh) @subchain 'ssh' { saddr (\$SSH_SOURCES) ACCEPT; }"
+                rule            => "domain (ip ip6) proto tcp mod state state (NEW) dport (ssh) @subchain 'ssh' { saddr (\$SSH_SOURCES) ACCEPT; }"
         }
 
         exec { "ferm restart":
index 085704bbbb3e3d91b6b6febfcdebe544a142bcc6..4c12bd55e7dd289562aaf4c4dc3bebce78509f2f 100644 (file)
@@ -9,11 +9,11 @@
 sshallowed = []
 
 case hostname
-  when 'logtest01' then sshallowed << [ '91.103.132.25', '91.103.132.49' ]
+  when 'logtest01' then sshallowed << [ '$DSA_IPS' ]
 end
 
 if sshallowed.length == 0
-  sshallowed << '0.0.0.0'
+  sshallowed = [ '0.0.0.0' ]
 end
 
 sshallowed.join(' ')