We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 880a01d + 0761a51 commit 258245cCopy full SHA for 258245c
controls/sshd_spec.rb
@@ -520,3 +520,18 @@
520
its('commands.first') { should_not match(/-oHostKeyAlgorithms/) }
521
end
522
523
+
524
+control 'sshd-50' do
525
+ impact 1.0
526
+ title 'Server: RSA HostKey size'
527
+ desc 'Verifies, that RSA HostKey is not smaller than 4096 bit'
528
+ only_if('RSA HostKey is readable') do
529
+ File.readable?("#{sshd_custom_hostkeys_path}/ssh_host_rsa_key")
530
+ end
531
532
+ describe bash("test $(ssh-keygen -l -f #{sshd_custom_hostkeys_path}/ssh_host_rsa_key | awk '$1 < 4096 { print $1 }' | wc -l) -eq 0") do
533
+ its('exit_status') { should eq 0 }
534
+ its('stdout') { should eq '' }
535
+ its('stderr') { should eq '' }
536
537
+end
0 commit comments