Skip to content

Commit d4b987f

Browse files
committed
change CRYPTO_POLICY check für sshd
this check needs to run without root privileges and don't depend on external programs. Now also checks more systems, but this is not problematic, since options are not set there. Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>
1 parent 55ba8f7 commit d4b987f

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

controls/sshd_spec.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -508,14 +508,14 @@
508508
impact 1.0
509509
title 'Server: CRYPTO_POLICY'
510510
desc 'Verifies, that we are not running CRYPTO_POLICY and our settings from sshd_config are effective'
511-
only_if('OS has CRYPTO_POLICY') do
512-
file('/etc/sysconfig/sshd').exist? && file('/etc/sysconfig/sshd').content.match?(/CRYPTO_POLICY/)
511+
only_if('sshd with options is running') do
512+
processes('sshd -D').exists?
513513
end
514514

515-
describe bash("pgrep -af 'sshd -D'") do
516-
its('exit_status') { should eq 0 }
517-
its('stdout') { should_not match('-oCiphers') }
518-
its('stdout') { should_not match('-oKexAlgorithms') }
519-
its('stdout') { should_not match('-oHostKeyAlgorithms') }
515+
describe processes('sshd -D') do
516+
its('entries.length') { should eq 1 }
517+
its('commands.first') { should_not match(/-oCiphers/) }
518+
its('commands.first') { should_not match(/-oKexAlgorithms/) }
519+
its('commands.first') { should_not match(/-oHostKeyAlgorithms/) }
520520
end
521521
end

0 commit comments

Comments
 (0)