|
|
|
@ -1,3 +1,5 @@ |
|
|
|
|
# frozen_string_literal: true |
|
|
|
|
|
|
|
|
|
control 'Sudoers configuration' do |
|
|
|
|
title 'should match desired lines' |
|
|
|
|
|
|
|
|
@ -8,7 +10,9 @@ control 'Sudoers configuration' do |
|
|
|
|
its('mode') { should cmp '0440' } |
|
|
|
|
its('content') { should include 'Defaults:ADMINS !lecture' } |
|
|
|
|
its('content') { should include 'Defaults:johndoe !requiretty' } |
|
|
|
|
its('content') { should include 'Defaults@www1 log_year, logfile=/var/log/sudo.log' } |
|
|
|
|
its('content') do |
|
|
|
|
should include 'Defaults@www1 log_year, logfile=/var/log/sudo.log' |
|
|
|
|
end |
|
|
|
|
its('content') { should include 'Host_Alias WEBSERVERS = www1,www2,www3' } |
|
|
|
|
its('content') { should include 'User_Alias ADMINS = millert,dowdy,mikef' } |
|
|
|
|
its('content') { should include 'johndoe ALL=(ALL) ALL' } |
|
|
|
@ -17,7 +21,6 @@ control 'Sudoers configuration' do |
|
|
|
|
its('content') { should include '%sudo ALL=(nodejs) NOPASSWD: ALL' } |
|
|
|
|
its('content') { should include '+sysadmins ALL=(ALL) ALL' } |
|
|
|
|
its('content') { should include '#includedir /etc/sudoers.d' } |
|
|
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
describe file('/etc/sudoers.d/extra-file') do |
|
|
|
@ -43,5 +46,4 @@ control 'Sudoers configuration' do |
|
|
|
|
its('mode') { should cmp '0440' } |
|
|
|
|
its('content') { should include '+other_netgroup ALL=(ALL) ALL' } |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
end |
|
|
|
|