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.
This commit is contained in:
parent
fd82841c1f
commit
430c48200e
10 changed files with 26 additions and 0 deletions
|
@ -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 -%>
|
||||
|
|
|
@ -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 -%>
|
||||
|
|
|
@ -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 -%>
|
||||
|
|
|
@ -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 -%>
|
||||
|
|
|
@ -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 -%>
|
||||
|
|
|
@ -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 -%>
|
||||
|
|
|
@ -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 -%>
|
||||
|
|
|
@ -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 -%>
|
||||
|
|
|
@ -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 -%>
|
||||
|
|
|
@ -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 -%>
|
||||
|
|
Loading…
Reference in a new issue