Skip to content

Commit 55ba8f7

Browse files
committed
change CRYPTO_POLICY check for ssh client
this check needs to work also when not root. Also we don't want to depend on settings in sshd config. This tests now runs on almost all systems and serves as an verification for the static configuration checks. Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>
1 parent fd13122 commit 55ba8f7

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

controls/ssh_spec.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,12 @@
231231
control 'ssh-22' do
232232
impact 1.0
233233
title 'Client: CRYPTO_POLICY'
234-
desc 'Verifies, that we are not running CRYPTO_POLICY and our settings from ssh_config are effective'
235-
only_if('OS has CRYPTO_POLICY') do
236-
file('/etc/sysconfig/sshd').exist? && file('/etc/sysconfig/sshd').content.match?(/CRYPTO_POLICY/)
234+
desc 'Verifies, that we are not running CRYPTO_POLICY and our settings from ssh_config are effective (affects el8+ and fedora)'
235+
only_if('ssh client supports -G option') do
236+
bash('ssh -G localhost').exit_status.equal?(0)
237237
end
238238

239239
describe bash('ssh -G localhost') do
240-
its('exit_status') { should eq 0 }
241240
its('stdout') { should match('ciphers ' + ssh_crypto.valid_ciphers) }
242241
its('stdout') { should match('kexalgorithms ' + ssh_crypto.valid_kexs) }
243242
its('stdout') { should match('macs ' + ssh_crypto.valid_macs) }

0 commit comments

Comments
 (0)