Looking at source. Try set permissions 0200 or 0600.
sub _check_for_unsafe_permissions {
my ($self) = @_;
my %test_files = (
'/etc/shadow' => { 'perms' => [ 0200, 0600 ], 'uid' => 0, 'gid' => 0 },
'/etc/passwd' => { 'perms' => [0644], 'uid' => 0, 'gid' => 0 }
);
for my $file ( keys %test_files ) {
my $expected_attributes = $test_files{$file};
my ( $current_mode, $uid, $gid ) = ( stat($file) )[ 2, 4, 5 ];
my $perms_ok = 0;
foreach my $allowed_perms ( @{ $expected_attributes->{'perms'} } ) {
if ( ( $allowed_perms & 07777 ) == ( $current_mode & 07777 ) ) {
$perms_ok = 1;
last;
}
}
if ( !$perms_ok ) {
my $expected_mode = sprintf( "%04o", $expected_attributes->{'perms'} );
my $actual_mode = sprintf( "%04o", $current_mode & 07777 );
$self->add_warn_advice(
'text' => ["$file has non default permissions. Expected: $expected_mode, Actual: $actual_mode."],
'suggestion' => ["Review the permissions on $file to ensure they are safe"]
);
}
if ( $uid != $expected_attributes->{'uid'} or $gid != $expected_attributes->{'gid'} ) {
$self->add_warn_advice(
'text' => ["$file has non root user and/or group"],
'suggestion' => ["Review the ownership permissions
The expected permission output should be a 4 character octal formated value but looks like perl's sprint function is improperly displaying the multidimensional array value which is displaying garbage.
Source (The Security Advisor is found within the Security Center of WHM - Cpanel)
https://github.com/bdraco/addon_securityadvisor
https://github.com/bdraco/addon_securityadvisor/blob/master/pkg/Cpanel/Security/Advisor/Assessors/Permissions.pm