diff --git a/lib/resources/ssh_conf.rb b/lib/resources/ssh_conf.rb index c25749534..7f2bfc081 100644 --- a/lib/resources/ssh_conf.rb +++ b/lib/resources/ssh_conf.rb @@ -9,10 +9,12 @@ require 'utils/simpleconfig' module Inspec::Resources class SshConf < Inspec.resource(1) name 'ssh_config' - desc 'Use the sshd_config InSpec audit resource to test configuration data for the Open SSH daemon located at /etc/ssh/sshd_config on Linux and UNIX platforms. sshd---the Open SSH daemon---listens on dedicated ports, starts a daemon for each incoming connection, and then handles encryption, authentication, key exchanges, command execution, and data exchanges.' + desc 'Use the `ssh_config` InSpec audit resource to test OpenSSH client configuration data located at `/etc/ssh/ssh_config` on Linux and Unix platforms.' example " - describe sshd_config do - its('Protocol') { should eq '2' } + describe ssh_config do + its('cipher') { should contain '3des' } + its('port') { should eq '22' } + its('hostname') { should include('example.com') } end " @@ -83,9 +85,19 @@ module Inspec::Resources class SshdConf < SshConf name 'sshd_config' + desc 'Use the sshd_config InSpec audit resource to test configuration data for the Open SSH daemon located at /etc/ssh/sshd_config on Linux and UNIX platforms. sshd---the Open SSH daemon---listens on dedicated ports, starts a daemon for each incoming connection, and then handles encryption, authentication, key exchanges, command execution, and data exchanges.' + example " + describe sshd_config do + its('Protocol') { should eq '2' } + end + " def initialize(path = nil) super(path || '/etc/ssh/sshd_config') end + + def to_s + 'SSHD Configuration' + end end end