Skip to content

Commit aa4eb82

Browse files
artem-sidorenkochris-rock
authored andcommitted
Avoid checking deprecated optinos for OpenSSH >=7.6 (#110)
E.g. on Ubuntu 18.04 SSH protocol version 1 was removed from OpenSSH 7.6: - https://www.openssh.com/txt/release-7.6 - https://www.openssh.com/txt/release-7.5 Signed-off-by: Artem Sidorenko <artem@posteo.de>
1 parent d396c76 commit aa4eb82

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

controls/ssh_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
command('ssh').exist?
2323
end
2424

25+
ssh_version = command('ssh -V 2>&1 | cut -f1 -d" " | cut -f2 -d"_"').stdout.to_f
26+
2527
control 'ssh-01' do
2628
impact 1.0
2729
title 'client: Check ssh_config owner, group and permissions.'
@@ -154,6 +156,7 @@
154156
impact 1.0
155157
title 'Client: Disable rhosts-based authentication'
156158
desc 'Avoid rhosts-based authentication, as it opens more ways for an attacker to enter a system.'
159+
only_if { ssh_version < 7.6 }
157160
describe ssh_config do
158161
its('RhostsRSAAuthentication') { should eq('no') }
159162
end
@@ -163,6 +166,7 @@
163166
impact 1.0
164167
title 'Client: Enable RSA authentication'
165168
desc 'Make sure RSA authentication is used by default.'
169+
only_if { ssh_version < 7.6 }
166170
describe ssh_config do
167171
its('RSAAuthentication') { should eq('yes') }
168172
end

0 commit comments

Comments
 (0)