Skip to content

Instantly share code, notes, and snippets.

@scarolan
Created September 11, 2015 22:00
Show Gist options
  • Save scarolan/7d8083aaf5c4206d72a8 to your computer and use it in GitHub Desktop.
Save scarolan/7d8083aaf5c4206d72a8 to your computer and use it in GitHub Desktop.
control_group 'SSH Security' do
control 'SSH' do
it 'should be listening on port 22' do
expect(port(22)).to be_listening
end
it 'disables root logins over ssh' do
expect(file('/etc/ssh/sshd_config')).to contain('PermitRootLogin no')
end
it "PasswordAuthentication is disabled" do
expect(file('/etc/ssh/sshd_config')).to match(/PasswordAuthentication\s+no/)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment