openssh-formula/test/integration/default/controls/config_spec.rb
Daniel Dehennin 2cfb5a74f3 fix(inspec): make rubocop happy
* test/integration/default/controls/services_spec.rb: favor modifier
  if usage when having a single-line body.

* test/integration/default/controls/config_spec.rb: add frozen string
  literal comment.

* test/integration/default/controls/packages_spec.rb: ditoo.

* test/integration/default/controls/services_spec.rb: ditoo.
2020-07-17 16:31:46 +02:00

39 lines
1.2 KiB
Ruby

# frozen_string_literal: true
# Overide by Platform
root_group =
case platform[:family]
when 'bsd'
'wheel'
else
'root'
end
control 'openssh configuration' do
title 'should match desired lines'
describe file('/etc/ssh/sshd_config') do
it { should be_file }
its('mode') { should cmp '0644' }
it { should be_owned_by 'root' }
it { should be_grouped_into root_group }
its('content') { should include 'ChallengeResponseAuthentication no' }
its('content') { should include 'X11Forwarding yes' }
its('content') { should include 'PrintMotd no' }
its('content') { should include 'AcceptEnv LANG LC_*' }
its('content') { should include 'Subsystem sftp /usr/lib/openssh/sftp-server' }
its('content') { should include 'UsePAM yes' }
end
describe file('/etc/ssh/ssh_config') do
it { should be_file }
its('mode') { should cmp '0644' }
it { should be_owned_by 'root' }
it { should be_grouped_into root_group }
its('content') { should include 'Host *' }
its('content') { should include ' GSSAPIAuthentication yes' }
its('content') { should include ' HashKnownHosts yes' }
its('content') { should include ' SendEnv LANG LC_*' }
end
end