Skip to content

Commit 7f15d47

Browse files
authored
Use SHA2 HMACs in OpenSSH for RHEL family 6.5+ (#146)
* Use SHA2 HMACs in OpenSSH for RHEL family 6.5+ Signed-off-by: Jason McNew <foonix@yahoo.com> * Since 6.x is no longer in EUS, use latest 6.x compatible config as baseline. Signed-off-by: Jason McNew <foonix@yahoo.com> * Explain why older RHEL6 HMACs are not recommended. Signed-off-by: Jason McNew <foonix@yahoo.com>
1 parent b3abc52 commit 7f15d47

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ Metrics/CyclomaticComplexity:
2323
Metrics/PerceivedComplexity:
2424
Max: 10
2525
Metrics/AbcSize:
26-
Max: 30
26+
Max: 31

libraries/ssh_crypto.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ def valid_macs # rubocop:disable Metrics/CyclomaticComplexity, Metrics/MethodLen
130130
macs66 = 'hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256'
131131
macs59 = 'hmac-sha2-512,hmac-sha2-256,hmac-ripemd160'
132132
macs53 = 'hmac-ripemd160,hmac-sha1'
133+
macs53_el65 = 'hmac-sha2-512,hmac-sha2-256'
133134
macs = macs59
134135

135136
# adjust MACs based on OS + release
@@ -153,7 +154,12 @@ def valid_macs # rubocop:disable Metrics/CyclomaticComplexity, Metrics/MethodLen
153154
when 'redhat', 'centos', 'oracle'
154155
case inspec.os[:release]
155156
when /^6\./
156-
macs = macs53
157+
# RedHat Enterprise Linux (and family) backported SHA2 support to their fork of OpenSSH 5.3 in RHEL 6.5.
158+
# See BZ#969565 at:
159+
# https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html-single/6.5_technical_notes/index#openssh
160+
# Because extended support (EUS) updates for 6.x minor releases is no longer available,
161+
# only the settings available for the supported (latest) 6.x release are recommended.
162+
macs = macs53_el65
157163
when /^7\./, /^8\./
158164
macs = macs66
159165
end

0 commit comments

Comments
 (0)