Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add logdir-check #81

Merged
merged 1 commit into from
Oct 31, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions controls/os_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@
# author: Dominik Richter
# author: Patrick Muench

log_dir_group = case os[:family]
when 'debian', 'redhat', 'fedora'
'root'
when 'ubuntu'
os[:release] == '14.04' ? 'syslog' : 'root'
end

login_defs_umask = attribute('login_defs_umask', default: '027', description: 'Default umask to set in login.defs')
login_defs_passmaxdays = attribute('login_defs_passmaxdays', default: '60', description: 'Default password maxdays to set in login.defs')
login_defs_passmindays = attribute('login_defs_passmindays', default: '7', description: 'Default password mindays to set in login.defs')
Expand Down Expand Up @@ -236,3 +243,14 @@
its(:content) { should match 'install vfat /bin/true' }
end
end

control 'os-11' do
impact 1.0
title 'Protect log-directory'
desc 'The log-directory /var/log should belong to root'
describe file('/var/log') do
it { should be_directory }
it { should be_owned_by 'root' }
it { should be_grouped_into log_dir_group }
end
end