|
|
|
|
|
|
|
|
|
|
|
|
|
|
def service_name() |
|
|
def service_name() |
|
|
return case os[:family] |
|
|
return case os[:family] |
|
|
when 'redhat' then 'sshd' |
|
|
|
|
|
when 'debian', 'ubuntu' then 'ssh' |
|
|
when 'debian', 'ubuntu' then 'ssh' |
|
|
|
|
|
else 'sshd' |
|
|
|
|
|
end |
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def root_group() |
|
|
|
|
|
return case os[:family] |
|
|
|
|
|
when 'freebsd' then 'wheel' |
|
|
|
|
|
else 'root' |
|
|
end |
|
|
end |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
describe file('/etc/ssh/sshd_config') do |
|
|
describe file('/etc/ssh/sshd_config') do |
|
|
it { should be_mode 600 } |
|
|
it { should be_mode 600 } |
|
|
it { should be_owned_by 'root' } |
|
|
it { should be_owned_by 'root' } |
|
|
it { should be_grouped_into 'root' } |
|
|
|
|
|
|
|
|
it { should be_grouped_into root_group() } |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
describe file('/etc/ssh/ssh_config') do |
|
|
describe file('/etc/ssh/ssh_config') do |
|
|
it { should be_mode 644 } |
|
|
it { should be_mode 644 } |
|
|
it { should be_owned_by 'root' } |
|
|
it { should be_owned_by 'root' } |
|
|
it { should be_grouped_into 'root' } |
|
|
|
|
|
|
|
|
it { should be_grouped_into root_group() } |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
end |
|
|
end |