merge SSH_SOURCES and SSH_V6_SOURCES
authorPeter Palfrader <peter@palfrader.org>
Sun, 22 Sep 2019 17:32:28 +0000 (19:32 +0200)
committerPeter Palfrader <peter@palfrader.org>
Sun, 22 Sep 2019 17:32:28 +0000 (19:32 +0200)
modules/ferm/templates/00-init.conf.erb
modules/ferm/templates/defs.conf.erb
modules/ferm/templates/me.conf.erb
modules/ssh/manifests/init.pp

index 2c3bb10..217fcf5 100644 (file)
@@ -1,2 +1 @@
 @def $SSH_SOURCES    = ();
-@def $SSH_V6_SOURCES = ();
index de43f76..2771f61 100644 (file)
@@ -73,8 +73,10 @@ end
 @def $weasel  = ($weasel 86.59.30.32/28); # anguilla2
 @def $weasel  = ($weasel 213.235.231.192/26); # sil-noreply
 @def $weasel  = ($weasel 141.201.0.0/16); # uni salzburg
-@def $weasel  = ($weasel 62.99.152.176/28); # campus sbg
 @def $weasel  = ($weasel 194.118.0.0/16 62.46.0.0/15); # A1 Telekom
+@def $weasel  = ($weasel 2001:826:408::/48); # unisbg
+@def $weasel  = ($weasel 2001:858:10f::/48); # anguilla
+
 @def $zobel   = ();
 @def $zobel   = ($zobel 87.139.82.80/32); # exit.credativ.com
 @def $zobel   = ($zobel 87.193.134.192/27); # credativ qsc
@@ -87,48 +89,32 @@ end
 @def $zobel   = ($zobel 195.49.152.0/22); # DG-i AS
 @def $zobel   = ($zobel 194.187.64.0/22); # DG-i AS
 @def $zobel   = ($zobel 88.99.108.200/29); # buri, dag, ...
+@def $zobel   = ($zobel 2001:6f8:1215::/48); # baldur
+@def $zobel   = ($zobel 2001:6f8:928::/48); # WS2
+@def $zobel   = ($zobel 2a01:198:549::/48); # WGS20
+@def $zobel   = ($zobel 2a01:198:6b2::/48); # AdS20
+@def $zobel   = ($zobel 2a02:158::/32);     # DG-i AS
+@def $zobel   = ($zobel 2003:5b:203b::/48); # credativ DTAG v6
+@def $zobel   = ($zobel 2a01:4f8:10a:1504::/64); # buri, dag, ....
+
 @def $luca    = ();
 @def $luca    = ($luca 162.210.192.22);  # jump snafu.emyr.net
+@def $luca    = ($luca 2604:9a00:2010:a041:4:ffff:a2d2:c016); # jump snafu.emyr.net
+
 @def $tfheen   = ();
 @def $tfheen   = ($tfheen 178.255.151.162); # vuizook
 @def $tfheen   = ($tfheen 51.174.0.0/15); # Altibox
+@def $tfheen   = ($tfheen 2a02:20c8:2640::/64); # vuizook
+@def $tfheen   = ($tfheen 2a01:798::/29); # Altibox
+
 @def $jcristau = ();
 @def $jcristau = ($jcristau 82.255.47.115/32); # home
 @def $jcristau = ($jcristau 62.210.122.202/32); # topinambour
-@def $master   = (82.195.75.110); # master.debian.org
-@def $people   = (5.153.231.30); # paradis.debian.org
-@def $DSA_IPS = ($weasel $zobel $luca $tfheen $jcristau $master $people);
-
-@def $weasel6    = ();
-@def $weasel6    = ($weasel6 2001:826:408::/48); # unisbg
-@def $weasel6    = ($weasel6 2001:858:10f::/48); # anguilla
-@def $zobel6     = ();
-@def $zobel6     = ($zobel6 2001:6f8:1215::/48); # baldur
-@def $zobel6     = ($zobel6 2001:6f8:928::/48); # WS2
-@def $zobel6     = ($zobel6 2a01:198:549::/48); # WGS20
-@def $zobel6     = ($zobel6 2a01:198:6b2::/48); # AdS20
-@def $zobel6     = ($zobel6 2a02:158::/32);     # DG-i AS
-@def $zobel6     = ($zobel6 2003:5b:203b::/48); # credativ DTAG v6
-@def $zobel6     = ($zobel6 2a01:4f8:10a:1504::/64); # buri, dag, ....
-@def $luca6      = ();
-@def $luca6      = ($luca6 2604:9a00:2010:a041:4:ffff:a2d2:c016); # jump snafu.emyr.net
-@def $tfheen6    = ();
-@def $tfheen6    = ($tfheen6 2a02:20c8:2640::/64); # vuizook
-@def $tfheen6    = ($tfheen6 2a01:798::/29); # Altibox
-@def $jcristau6  = ();
-@def $jcristau6  = ($jcristau6 2a01:e35:2ff2:f730::/61); # home
-@def $jcristau6  = ($jcristau6 2001:bc8:3f1d::/48); # topinambour
-@def $master6    = (2001:41b8:202:deb:216:36ff:fe40:4001); # master.debian.org
-@def $DSA_V6_IPS = ($weasel6 $zobel6 $luca6 $tfheen6 $jcristau6 $master6);
-
-@def $USER_joerg   = ();
-@def $USER_joerg   = ($USER_joerg 213.146.108.160/29);
-@def $USER_joerg   = ($USER_joerg 46.4.205.32);
-@def $USER_joerg6  = ();
-@def $USER_joerg6  = ($USER_joerg6 2a02:248:1005::/48);
-@def $USER_joerg6  = ($USER_joerg6 2a01:4f8:131:1520::6667);
-
-@def $BUILDD_SSH_ACCESS = ();
-@def $BUILDD_SSH_ACCESS = ($BUILDD_SSH_ACCESS 209.87.16.60); # wuiet
-@def $BUILDD_SSH_ACCESS = ($BUILDD_SSH_ACCESS 97.107.116.29); # master
-@def $BUILDD_SSH_ACCESS = ($BUILDD_SSH_ACCESS 82.195.75.110); # new-master
+@def $jcristau = ($jcristau 2a01:e35:2ff2:f730::/61); # home
+@def $jcristau = ($jcristau 2001:bc8:3f1d::/48); # topinambour
+
+@def $master   = (82.195.75.110 2001:41b8:202:deb:216:36ff:fe40:4001); # master.debian.org
+@def $people   = (5.153.231.30 2001:41c8:1000:21::21:30); # paradis.debian.org
+@def $draghi   = (82.195.75.106 2001:41b8:202:deb:1a1a:0:52c3:4b6a); # draghi.debian.org
+
+@def $DSA_IPS = ($weasel $zobel $luca $tfheen $jcristau $master $people $draghi);
index 33d0335..ef3b550 100644 (file)
@@ -18,34 +18,30 @@ if (nodeinfo['ldap'].has_key?('purpose')) then
        end
 end
 
-ssh4allowed = []
-ssh6allowed = []
+sshallowed = []
 
 should_restrict = restrict_ssh.include?(@hostname)
 
-
 if should_restrict then
        # draghi makes for a nice jumphost
-       ssh4allowed << %w{$DSA_IPS    $HOST_NAGIOS_V4   82.195.75.106}
-       ssh6allowed << %w{$DSA_V6_IPS $HOST_NAGIOS_V6   2001:41b8:202:deb:1a1a:0:52c3:4b6a}
+       sshallowed << %w{$DSA_IPS 82.195.75.106 2001:41b8:202:deb:1a1a:0:52c3:4b6a}
 
        if %w{draghi}.include?(@hostname) then
-               ssh4allowed << '$HOST_DEBIAN_V4'
-               ssh6allowed << '$HOST_DEBIAN_V6'
+               sshallowed << '$HOST_DEBIAN'
        end
 
        if %w{adayevskaya}.include?(@hostname) then
-                out << '@def $MFL_LOCAL = ( 130.83.226.60 );' # Michael Fladerer
-                ssh4allowed << '$MFL_LOCAL'
-               ssh4allowed << %w{$HOST_DEBIAN_V4}
-               ssh6allowed << %w{$HOST_DEBIAN_V6}
+               out << '@def $MFL_LOCAL = ( 130.83.226.60 );' # Michael Fladerer
+               sshallowed << '$MFL_LOCAL'
+               sshallowed << %w{$HOST_DEBIAN}
        end
 end
-ssh4allowed.length == 0 and ssh4allowed << '0.0.0.0/0'
-ssh6allowed.length == 0 and ssh6allowed << '::/0'
+if sshallowed.length == 0 then
+  sshallowed << '0.0.0.0/0'
+  sshallowed << '::/0'
+end
 
-out << "@def $SSH_SOURCES    = ( $SSH_SOURCES    #{ssh4allowed.join(' ')});"
-out << "@def $SSH_V6_SOURCES = ( $SSH_V6_SOURCES #{ssh6allowed.join(' ')});"
+out << "@def $SSH_SOURCES    = ( $SSH_SOURCES    #{sshallowed.join(' ')});"
 
 
 out.join("\n")
index 3021e3a..bd3600e 100644 (file)
@@ -15,6 +15,7 @@ class ssh {
   }
   ferm::rule { 'dsa-ssh-sources':
     description => 'Allow SSH from DSA',
+    domain      => '(ip ip6)',
     chain       => 'ssh',
     rule        => 'saddr ($SSH_SOURCES) ACCEPT'
   }