From d78749fd8f9ae2482b8e31c74698362c5c1f2341 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Fri, 21 Nov 2014 18:19:07 -0500 Subject: Add a $hostkey_type variable that allows you to set which hostkey types you want to support in your sshd_config. We use the ssh_version fact to determine the default hostkey types. Only enable rsa and ed25519 for ssh versions greater or equal to 6.5, otherwise enable rsa and dsa. Some distributions, such as debian, also enable ecdsa as a hostkey type, but this is a known bad NIST curve, so we do not enable that by default (thus deviating from the stock sshd config) --- manifests/init.pp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'manifests') diff --git a/manifests/init.pp b/manifests/init.pp index 5a38293..2455887 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -49,6 +49,10 @@ class sshd( $shorewall_source = 'net', $sshkey_ipaddress = $::ipaddress, $manage_client = true, + $hostkey_type = versioncmp($::ssh_version, '6.5') ? { + /(^1|0)/ => [ 'rsa', 'ed25519' ], + /-1/ => [ 'rsa', 'dsa' ] + } ) { validate_bool($manage_shorewall) -- cgit v1.2.3