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

Tune some parameters for RedHat system #82

Merged
merged 1 commit into from
Nov 7, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions controls/os_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
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_umask = attribute('login_defs_umask', default: os.redhat? ? '077' : '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')
login_defs_passwarnage = attribute('login_defs_passwarnage', default: '7', description: 'Default password warnage (days) to set in login.defs')
Expand Down Expand Up @@ -96,10 +95,19 @@
it { should be_owned_by 'root' }
its('group') { should eq shadow_group }
it { should_not be_executable }
it { should be_writable.by('owner') }
it { should be_readable.by('owner') }
it { should_not be_readable.by('other') }
end
if os.redhat?
describe file('/etc/shadow') do
it { should_not be_writable.by('owner') }
it { should_not be_readable.by('owner') }
end
else
describe file('/etc/shadow') do
it { should be_writable.by('owner') }
it { should be_readable.by('owner') }
end
end
if os.debian? || os.suse?
describe file('/etc/shadow') do
it { should be_readable.by('group') }
Expand Down Expand Up @@ -176,9 +184,9 @@
it { should_not be_writable }
end
describe login_defs do
its('SYS_UID_MIN') { should eq '100' }
its('SYS_UID_MIN') { should eq '201' }
its('SYS_UID_MAX') { should eq '999' }
its('SYS_GID_MIN') { should eq '100' }
its('SYS_GID_MIN') { should eq '201' }
its('SYS_GID_MAX') { should eq '999' }
end
only_if { os.redhat? }
Expand Down