diff --git a/controls/1_4_secure_boot_settings.rb b/controls/1_4_secure_boot_settings.rb index 6350344..e2be00a 100644 --- a/controls/1_4_secure_boot_settings.rb +++ b/controls/1_4_secure_boot_settings.rb @@ -37,8 +37,8 @@ it { should_not be_readable.by 'other' } it { should_not be_writable.by 'other' } it { should_not be_executable.by 'other' } - its(:gid) { should cmp 0 } - its(:uid) { should cmp 0 } + it { should be_grouped_into 'root' } + it { should be_owned_by 'root' } end end end diff --git a/controls/5_1_configure_cron.rb b/controls/5_1_configure_cron.rb index 7e6f574..14372db 100644 --- a/controls/5_1_configure_cron.rb +++ b/controls/5_1_configure_cron.rb @@ -70,8 +70,8 @@ it { should_not be_readable.by 'other' } it { should_not be_writable.by 'other' } it { should_not be_executable.by 'other' } - its('uid') { should cmp 0 } - its('gid') { should cmp 0 } + it { should be_owned_by 'root' } + it { should be_grouped_into 'root' } end end @@ -102,8 +102,8 @@ it { should_not be_readable.by 'other' } it { should_not be_writable.by 'other' } it { should_not be_executable.by 'other' } - its('uid') { should cmp 0 } - its('gid') { should cmp 0 } + it { should be_owned_by 'root' } + it { should be_grouped_into 'root' } end end @@ -134,8 +134,8 @@ it { should_not be_readable.by 'other' } it { should_not be_writable.by 'other' } it { should_not be_executable.by 'other' } - its('uid') { should cmp 0 } - its('gid') { should cmp 0 } + it { should be_owned_by 'root' } + it { should be_grouped_into 'root' } end end @@ -166,8 +166,8 @@ it { should_not be_readable.by 'other' } it { should_not be_writable.by 'other' } it { should_not be_executable.by 'other' } - its('uid') { should cmp 0 } - its('gid') { should cmp 0 } + it { should be_owned_by 'root' } + it { should be_grouped_into 'root' } end end @@ -198,8 +198,8 @@ it { should_not be_readable.by 'other' } it { should_not be_writable.by 'other' } it { should_not be_executable.by 'other' } - its('uid') { should cmp 0 } - its('gid') { should cmp 0 } + it { should be_owned_by 'root' } + it { should be_grouped_into 'root' } end end @@ -231,8 +231,8 @@ it { should_not be_readable.by 'other' } it { should_not be_writable.by 'other' } it { should_not be_executable.by 'other' } - its('uid') { should cmp 0 } - its('gid') { should cmp 0 } + it { should be_owned_by 'root' } + it { should be_grouped_into 'root' } end end @@ -272,8 +272,8 @@ it { should_not be_readable.by 'other' } it { should_not be_writable.by 'other' } it { should_not be_executable.by 'other' } - its('uid') { should cmp 0 } - its('gid') { should cmp 0 } + it { should be_owned_by 'root' } + it { should be_grouped_into 'root' } end end end diff --git a/controls/5_2_ssh_server_configuration.rb b/controls/5_2_ssh_server_configuration.rb index 66fe436..e44ae67 100644 --- a/controls/5_2_ssh_server_configuration.rb +++ b/controls/5_2_ssh_server_configuration.rb @@ -43,8 +43,8 @@ it { should_not be_readable.by 'other' } it { should_not be_writable.by 'other' } it { should_not be_executable.by 'other' } - its('uid') { should cmp 0 } - its('gid') { should cmp 0 } + it { should be_owned_by 'root' } + it { should be_grouped_into 'root' } end end @@ -69,8 +69,8 @@ it { should_not be_readable.by 'other' } it { should_not be_writable.by 'other' } it { should_not be_executable.by 'other' } - its('gid') { should cmp 0 } - its('uid') { should cmp 0 } + it { should be_grouped_into 'root' } + it { should be_owned_by 'root' } end end end @@ -96,8 +96,8 @@ it { should be_readable.by 'other' } it { should_not be_writable.by 'other' } it { should_not be_executable.by 'other' } - its('gid') { should cmp 0 } - its('uid') { should cmp 0 } + it { should be_grouped_into 'root' } + it { should be_owned_by 'root' } end end end diff --git a/controls/6_1_system_file_permissions.rb b/controls/6_1_system_file_permissions.rb index 80cea59..02a717d 100644 --- a/controls/6_1_system_file_permissions.rb +++ b/controls/6_1_system_file_permissions.rb @@ -107,8 +107,8 @@ describe file(f) do it { should exist } its('mode') { should cmp '0644' } - its('uid') { should cmp 0 } - its('gid') { should cmp 0 } + it { should be_owned_by 'root' } + it { should be_grouped_into 'root' } its('sticky') { should equal false } its('suid') { should equal false } its('sgid') { should equal false } @@ -138,7 +138,7 @@ describe file(f) do it { should exist } it { should_not be_more_permissive_than('0640') } - its('uid') { should cmp 0 } + it { should be_owned_by 'root' } its('gid') { should cmp expected_gid } end end @@ -167,8 +167,8 @@ describe file(f) do it { should exist } its('mode') { should cmp '0644' } - its('uid') { should cmp 0 } - its('gid') { should cmp 0 } + it { should be_owned_by 'root' } + it { should be_grouped_into 'root' } end end end @@ -197,7 +197,7 @@ describe file(f) do it { should exist } it { should_not be_more_permissive_than('0640') } - its('uid') { should cmp 0 } + it { should be_owned_by 'root' } its('gid') { should cmp expected_gid } end end @@ -222,8 +222,8 @@ describe file('/etc/passwd-') do it { should exist } it { should_not be_more_permissive_than('0600') } - its('uid') { should cmp 0 } - its('gid') { should cmp 0 } + it { should be_owned_by 'root' } + it { should be_grouped_into 'root' } end end @@ -246,7 +246,7 @@ it { should exist } it { should_not be_more_permissive_than('0640') } - its('uid') { should cmp 0 } + it { should be_owned_by 'root' } its('gid') { should cmp expected_gid } end end @@ -270,8 +270,8 @@ describe file('/etc/group-') do it { should exist } it { should_not be_more_permissive_than('0644') } - its('uid') { should cmp 0 } - its('gid') { should cmp 0 } + it { should be_owned_by 'root' } + it { should be_grouped_into 'root' } end end @@ -295,7 +295,7 @@ describe file('/etc/gshadow-') do it { should exist } it { should_not be_more_permissive_than('0640') } - its('uid') { should cmp 0 } + it { should be_owned_by 'root' } its('gid') { should cmp expected_gid } end end diff --git a/controls/6_2_user_and_group_settings.rb b/controls/6_2_user_and_group_settings.rb index d07b6e0..7f72b6e 100644 --- a/controls/6_2_user_and_group_settings.rb +++ b/controls/6_2_user_and_group_settings.rb @@ -162,7 +162,7 @@ it { should be_directory } it { should_not be_writable.by 'group' } it { should_not be_writable.by 'other' } - its('uid') { should cmp 0 } + it { should be_owned_by 'root' } end end end