Saltstack Official OpenSSH Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.2KB

  1. # Overide by Platform
  2. root_group =
  3. case platform[:family]
  4. when 'bsd'
  5. 'wheel'
  6. else
  7. 'root'
  8. end
  9. control 'openssh configuration' do
  10. title 'should match desired lines'
  11. describe file('/etc/ssh/sshd_config') do
  12. it { should be_file }
  13. its('mode') { should cmp '0644' }
  14. it { should be_owned_by 'root' }
  15. it { should be_grouped_into root_group }
  16. its('content') { should include 'ChallengeResponseAuthentication no' }
  17. its('content') { should include 'X11Forwarding yes' }
  18. its('content') { should include 'PrintMotd no' }
  19. its('content') { should include 'AcceptEnv LANG LC_*' }
  20. its('content') { should include 'Subsystem sftp /usr/lib/openssh/sftp-server' }
  21. its('content') { should include 'UsePAM yes' }
  22. end
  23. describe file('/etc/ssh/ssh_config') do
  24. it { should be_file }
  25. its('mode') { should cmp '0644' }
  26. it { should be_owned_by 'root' }
  27. it { should be_grouped_into root_group }
  28. its('content') { should include 'Host *' }
  29. its('content') { should include ' GSSAPIAuthentication yes' }
  30. its('content') { should include ' HashKnownHosts yes' }
  31. its('content') { should include ' SendEnv LANG LC_*' }
  32. end
  33. end