Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions controls/ssh_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
command('ssh').exist?
end

ssh_version = command('ssh -V 2>&1 | cut -f1 -d" " | cut -f2 -d"_"').stdout.to_f
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we do this in a resource, so that we could reuse it for other test too in the future?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets do it once we need it?


control 'ssh-01' do
impact 1.0
title 'client: Check ssh_config owner, group and permissions.'
Expand Down Expand Up @@ -154,6 +156,7 @@
impact 1.0
title 'Client: Disable rhosts-based authentication'
desc 'Avoid rhosts-based authentication, as it opens more ways for an attacker to enter a system.'
only_if { ssh_version < 7.6 }
describe ssh_config do
its('RhostsRSAAuthentication') { should eq('no') }
end
Expand All @@ -163,6 +166,7 @@
impact 1.0
title 'Client: Enable RSA authentication'
desc 'Make sure RSA authentication is used by default.'
only_if { ssh_version < 7.6 }
describe ssh_config do
its('RSAAuthentication') { should eq('yes') }
end
Expand Down