summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2015-05-01 13:48:19 -0400
committerMicah Anderson <micah@riseup.net>2015-05-04 15:42:26 -0400
commit430c48200eeacf11fd3980f162ffa1994c2d0dd0 (patch)
tree20d743d7475ae67cd7aa986cc416c5712ad21783
parentfd82841c1f03d22acf4ed448cd22743a785f573e (diff)
Implement KexAlgorithms settings, based on Key exchange section of
https://stribika.github.io/2015/01/04/secure-secure-shell.html Note, that on some systems it is uncertain if they will have a new enough version of openssh installed, so on those a version test is done to see before setting them.
-rw-r--r--templates/sshd_config/CentOS_6.erb3
-rw-r--r--templates/sshd_config/CentOS_7.erb3
-rw-r--r--templates/sshd_config/Debian_jessie.erb1
-rw-r--r--templates/sshd_config/Debian_sid.erb1
-rw-r--r--templates/sshd_config/Debian_wheezy.erb3
-rw-r--r--templates/sshd_config/FreeBSD.erb3
-rw-r--r--templates/sshd_config/Gentoo.erb3
-rw-r--r--templates/sshd_config/OpenBSD.erb3
-rw-r--r--templates/sshd_config/Ubuntu.erb3
-rw-r--r--templates/sshd_config/Ubuntu_lucid.erb3
10 files changed, 26 insertions, 0 deletions
diff --git a/templates/sshd_config/CentOS_6.erb b/templates/sshd_config/CentOS_6.erb
index 97e9a5b..f27e567 100644
--- a/templates/sshd_config/CentOS_6.erb
+++ b/templates/sshd_config/CentOS_6.erb
@@ -151,6 +151,9 @@ AllowGroups <%= s %>
<%- end -%>
<% if scope.lookupvar('sshd::hardened') == 'yes' -%>
+<% if (scope.function_versioncmp([scope.lookupvar('::ssh_version'),'6.5'])) >= 0 -%>
+KexAlgorithms curve25519-sha256@libssh.org
+<% end -%>
Ciphers aes256-ctr
MACs hmac-sha1
<% end -%>
diff --git a/templates/sshd_config/CentOS_7.erb b/templates/sshd_config/CentOS_7.erb
index cad9f59..c6ecd06 100644
--- a/templates/sshd_config/CentOS_7.erb
+++ b/templates/sshd_config/CentOS_7.erb
@@ -165,6 +165,9 @@ AllowGroups <%= s %>
# CheckHostIP no
<% if scope.lookupvar('sshd::hardened') == 'yes' -%>
+<% if (scope.function_versioncmp([scope.lookupvar('::ssh_version'),'6.5'])) >= 0 -%>
+KexAlgorithms curve25519-sha256@libssh.org
+<% end -%>
Ciphers aes256-ctr
MACs hmac-sha1
<% end -%>
diff --git a/templates/sshd_config/Debian_jessie.erb b/templates/sshd_config/Debian_jessie.erb
index ada3891..19d4327 100644
--- a/templates/sshd_config/Debian_jessie.erb
+++ b/templates/sshd_config/Debian_jessie.erb
@@ -112,6 +112,7 @@ AllowGroups <%= s %>
<%- end -%>
<% if scope.lookupvar('sshd::hardened') == 'yes' -%>
+KexAlgorithms curve25519-sha256@libssh.org
Ciphers aes256-ctr
MACs hmac-sha1
<% end -%>
diff --git a/templates/sshd_config/Debian_sid.erb b/templates/sshd_config/Debian_sid.erb
index ada3891..19d4327 100644
--- a/templates/sshd_config/Debian_sid.erb
+++ b/templates/sshd_config/Debian_sid.erb
@@ -112,6 +112,7 @@ AllowGroups <%= s %>
<%- end -%>
<% if scope.lookupvar('sshd::hardened') == 'yes' -%>
+KexAlgorithms curve25519-sha256@libssh.org
Ciphers aes256-ctr
MACs hmac-sha1
<% end -%>
diff --git a/templates/sshd_config/Debian_wheezy.erb b/templates/sshd_config/Debian_wheezy.erb
index 4633c09..e8465ea 100644
--- a/templates/sshd_config/Debian_wheezy.erb
+++ b/templates/sshd_config/Debian_wheezy.erb
@@ -115,6 +115,9 @@ AllowGroups <%= s %>
<%- end -%>
<% if scope.lookupvar('sshd::hardened') == 'yes' -%>
+<% if (scope.function_versioncmp([scope.lookupvar('::ssh_version'),'6.5'])) >= 0 -%>
+KexAlgorithms curve25519-sha256@libssh.org
+<% end -%>
Ciphers aes256-ctr
MACs hmac-sha1
<% end -%>
diff --git a/templates/sshd_config/FreeBSD.erb b/templates/sshd_config/FreeBSD.erb
index f5bd439..8655c53 100644
--- a/templates/sshd_config/FreeBSD.erb
+++ b/templates/sshd_config/FreeBSD.erb
@@ -153,6 +153,9 @@ AllowGroups <%= s %>
<%- end -%>
<% if scope.lookupvar('sshd::hardened') == 'yes' -%>
+<% if (scope.function_versioncmp([scope.lookupvar('::ssh_version'),'6.5'])) >= 0 -%>
+KexAlgorithms curve25519-sha256@libssh.org
+<% end -%>
Ciphers aes256-ctr
MACs hmac-sha1
<% end -%>
diff --git a/templates/sshd_config/Gentoo.erb b/templates/sshd_config/Gentoo.erb
index 6e51b4c..1508d70 100644
--- a/templates/sshd_config/Gentoo.erb
+++ b/templates/sshd_config/Gentoo.erb
@@ -148,6 +148,9 @@ AllowGroups <%= s %>
<%- end -%>
<% if scope.lookupvar('sshd::hardened') == 'yes' -%>
+<% if (scope.function_versioncmp([scope.lookupvar('::ssh_version'),'6.5'])) >= 0 -%>
+KexAlgorithms curve25519-sha256@libssh.org
+<% end -%>
Ciphers aes256-ctr
MACs hmac-sha1
<% end -%>
diff --git a/templates/sshd_config/OpenBSD.erb b/templates/sshd_config/OpenBSD.erb
index 7577bac..591d980 100644
--- a/templates/sshd_config/OpenBSD.erb
+++ b/templates/sshd_config/OpenBSD.erb
@@ -129,6 +129,9 @@ AllowGroups <%= s %>
# ForceCommand cvs server
<% if scope.lookupvar('sshd::hardened') == 'yes' -%>
+<% if (scope.function_versioncmp([scope.lookupvar('::ssh_version'),'6.5'])) >= 0 -%>
+KexAlgorithms curve25519-sha256@libssh.org
+<% end -%>
Ciphers aes256-ctr
MACs hmac-sha1
<% end -%>
diff --git a/templates/sshd_config/Ubuntu.erb b/templates/sshd_config/Ubuntu.erb
index d42fac1..28ee5f6 100644
--- a/templates/sshd_config/Ubuntu.erb
+++ b/templates/sshd_config/Ubuntu.erb
@@ -116,6 +116,9 @@ AllowGroups <%= s %>
<%- end -%>
<% if scope.lookupvar('sshd::hardened') == 'yes' -%>
+<% if (scope.function_versioncmp([scope.lookupvar('::ssh_version'),'6.5'])) >= 0 -%>
+KexAlgorithms curve25519-sha256@libssh.org
+<% end -%>
Ciphers aes256-ctr
MACs hmac-sha1
<% end -%>
diff --git a/templates/sshd_config/Ubuntu_lucid.erb b/templates/sshd_config/Ubuntu_lucid.erb
index 1ed8fd7..36f787b 100644
--- a/templates/sshd_config/Ubuntu_lucid.erb
+++ b/templates/sshd_config/Ubuntu_lucid.erb
@@ -119,6 +119,9 @@ AllowGroups <%= s %>
PrintMotd <%= scope.lookupvar('sshd::print_motd') %>
<% if scope.lookupvar('sshd::hardened') == 'yes' -%>
+<% if (scope.function_versioncmp([scope.lookupvar('::ssh_version'),'6.5'])) >= 0 -%>
+KexAlgorithms curve25519-sha256@libssh.org
+<% end -%>
Ciphers aes256-ctr
MACs hmac-sha1
<% end -%>