Skip to content

Commit

Permalink
Merge pull request #5010 from matejak/fix_sshd_ciphers_macs
Browse files Browse the repository at this point in the history
Fix RHEL7 rules sshd_use_strong_macs and sshd_use_strong_ciphers.
  • Loading branch information
jan-cerny committed Nov 15, 2019
2 parents 8656925 + 32c5bdb commit f254745
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# platform = multi_platform_all

{{{ bash_sshd_config_set(parameter="Ciphers", value="aes128-ctr,aes192-ctr,aes256-ctr,chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com") }}}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{{ oval_sshd_config(parameter="Ciphers", value="((chacha20-poly1305@openssh\.com|aes256-gcm@openssh\.com|aes128-gcm@openssh\.com|aes256-ctr|aes128-ctr),?)") }}}
{{{ oval_sshd_config(parameter="Ciphers", value="((aes128-ctr|aes192-ctr|aes256-ctr|chacha20-poly1305@openssh\.com|aes256-gcm@openssh\.com|aes128-gcm@openssh\.com),?)+") }}}
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ description: |-
Counter (CTR) mode is also preferred over cipher-block chaining (CBC) mode.
The following line in <tt>/etc/ssh/sshd_config</tt>
demonstrates use of those ciphers:
<pre>Ciphers aes128-ctr,aes192-ctr,aes256-ctr</pre>
<pre>chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes128-ctr</pre>
<pre>Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr</pre>
The man page <tt>sshd_config(5)</tt> contains a list of supported ciphers.
rationale: |-
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# platform = multi_platform_rhel,multi_platform_fedora
# profiles = e8

sed -i 's/^\s*Ciphers\s.*//i' /etc/ssh/sshd_config
echo "Ciphers aes256-ctr" >> /etc/ssh/sshd_config

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# platform = multi_platform_rhel,multi_platform_fedora
# profiles = e8

sed -i 's/^\s*Ciphers\s/# &/i' /etc/ssh/sshd_config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# platform = multi_platform_all

{{{ bash_sshd_config_set(parameter="MACs", value="hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,hmac-ripemd160") }}}

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# platform = multi_platform_rhel,multi_platform_fedora
# profiles = e8

sed -i 's/^\s*MACs\s.*//i' /etc/ssh/sshd_config
echo "MACs hmac-sha2-512" >> /etc/ssh/sshd_config

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# platform = multi_platform_rhel,multi_platform_fedora
# profiles = e8

sed -i 's/^\s*MACs\s/# &/i' /etc/ssh/sshd_config

0 comments on commit f254745

Please sign in to comment.