|
282 | 282 | end
|
283 | 283 | end
|
284 | 284 | end
|
| 285 | + |
| 286 | +control 'os-14' do |
| 287 | + impact 1.0 |
| 288 | + title 'Check owner and permissions for /etc/gshadow' |
| 289 | + desc 'Check periodically the owner and permissions for /etc/gshadow' |
| 290 | + describe file('/etc/gshadow') do |
| 291 | + it { should exist } |
| 292 | + it { should be_file } |
| 293 | + it { should be_owned_by 'root' } |
| 294 | + its('group') { should eq shadow_group } |
| 295 | + it { should_not be_executable } |
| 296 | + it { should_not be_writable.by('group') } |
| 297 | + it { should_not be_writable.by('other') } |
| 298 | + it { should_not be_readable.by('other') } |
| 299 | + end |
| 300 | +end |
| 301 | + |
| 302 | +control 'os-15' do |
| 303 | + impact 1.0 |
| 304 | + title 'Check owner and permissions for /etc/shadow-' |
| 305 | + desc 'Check periodically the owner and permissions for /etc/shadow-' |
| 306 | + only_if('/etc/shadow- exists') do |
| 307 | + file('/etc/shadow-').exist? |
| 308 | + end |
| 309 | + describe file('/etc/shadow-') do |
| 310 | + it { should be_file } |
| 311 | + it { should be_owned_by 'root' } |
| 312 | + its('group') { should eq shadow_group } |
| 313 | + it { should_not be_executable } |
| 314 | + it { should_not be_writable.by('group') } |
| 315 | + it { should_not be_writable.by('other') } |
| 316 | + it { should_not be_readable.by('other') } |
| 317 | + end |
| 318 | +end |
| 319 | + |
| 320 | +control 'os-16' do |
| 321 | + impact 1.0 |
| 322 | + title 'Check owner and permissions for /etc/gshadow-' |
| 323 | + desc 'Check periodically the owner and permissions for /etc/gshadow-' |
| 324 | + only_if('/etc/gshadow- exists') do |
| 325 | + file('/etc/gshadow-').exist? |
| 326 | + end |
| 327 | + describe file('/etc/gshadow-') do |
| 328 | + it { should be_file } |
| 329 | + it { should be_owned_by 'root' } |
| 330 | + its('group') { should eq shadow_group } |
| 331 | + it { should_not be_executable } |
| 332 | + it { should_not be_writable.by('group') } |
| 333 | + it { should_not be_writable.by('other') } |
| 334 | + it { should_not be_readable.by('other') } |
| 335 | + end |
| 336 | +end |
0 commit comments