|
218 | 218 | end
|
219 | 219 | end
|
220 | 220 |
|
| 221 | +control 'os-03c' do |
| 222 | + impact 1.0 |
| 223 | + title 'Check owner and permissions for /etc/group' |
| 224 | + desc 'Check periodically the owner and permissions for /etc/group' |
| 225 | + describe file('/etc/group') do |
| 226 | + it { should exist } |
| 227 | + it { should be_file } |
| 228 | + it { should be_owned_by 'root' } |
| 229 | + its('group') { should eq 'root' } |
| 230 | + it { should_not be_executable } |
| 231 | + it { should be_writable.by('owner') } |
| 232 | + it { should_not be_writable.by('group') } |
| 233 | + it { should_not be_writable.by('other') } |
| 234 | + it { should be_readable.by('owner') } |
| 235 | + it { should be_readable.by('group') } |
| 236 | + it { should be_readable.by('other') } |
| 237 | + end |
| 238 | +end |
| 239 | + |
| 240 | +control 'os-03d' do |
| 241 | + impact 1.0 |
| 242 | + title 'Check owner and permissions for /etc/passwd-' |
| 243 | + desc 'Check periodically the owner and permissions for /etc/passwd-' |
| 244 | + only_if('/etc/passwd- exists') do |
| 245 | + file('/etc/passwd-').exist? |
| 246 | + end |
| 247 | + describe file('/etc/passwd-') do |
| 248 | + it { should be_file } |
| 249 | + it { should be_owned_by 'root' } |
| 250 | + its('group') { should eq 'root' } |
| 251 | + it { should_not be_executable } |
| 252 | + it { should be_writable.by('owner') } |
| 253 | + it { should_not be_writable.by('group') } |
| 254 | + it { should_not be_writable.by('other') } |
| 255 | + it { should be_readable.by('owner') } |
| 256 | + it { should be_readable.by('group') } |
| 257 | + it { should be_readable.by('other') } |
| 258 | + end |
| 259 | +end |
| 260 | + |
| 261 | +control 'os-03e' do |
| 262 | + impact 1.0 |
| 263 | + title 'Check owner and permissions for /etc/group-' |
| 264 | + desc 'Check periodically the owner and permissions for /etc/group-' |
| 265 | + only_if('/etc/group- exists') do |
| 266 | + file('/etc/group-').exist? |
| 267 | + end |
| 268 | + describe file('/etc/group-') do |
| 269 | + it { should be_owned_by 'root' } |
| 270 | + its('group') { should eq 'root' } |
| 271 | + it { should_not be_executable } |
| 272 | + it { should be_writable.by('owner') } |
| 273 | + it { should_not be_writable.by('group') } |
| 274 | + it { should_not be_writable.by('other') } |
| 275 | + it { should be_readable.by('owner') } |
| 276 | + it { should be_readable.by('group') } |
| 277 | + it { should be_readable.by('other') } |
| 278 | + end |
| 279 | +end |
| 280 | + |
221 | 281 | control 'os-04' do
|
222 | 282 | impact 1.0
|
223 | 283 | title 'Dot in PATH variable'
|
|
0 commit comments