mirror of
https://github.com/ovh/debian-cis.git
synced 2024-11-25 23:11:24 +01:00
IMP(5.2.3): 640 permission is now ok for the check
This commit is contained in:
parent
829ee8631f
commit
501ce8c651
@ -25,12 +25,17 @@ audit () {
|
|||||||
for FILE in $($SUDO_CMD find $DIR -xdev -type f -name 'ssh_host_*_key.pub');
|
for FILE in $($SUDO_CMD find $DIR -xdev -type f -name 'ssh_host_*_key.pub');
|
||||||
do
|
do
|
||||||
has_file_correct_permissions $FILE $PERMISSIONS
|
has_file_correct_permissions $FILE $PERMISSIONS
|
||||||
|
if [ $FNRET = 0 ]; then
|
||||||
|
ok "$FILE permissions were set to $PERMISSIONS"
|
||||||
|
else
|
||||||
|
has_file_correct_permissions $FILE 640
|
||||||
if [ $FNRET = 0 ]; then
|
if [ $FNRET = 0 ]; then
|
||||||
ok "$FILE permissions were set to $PERMISSIONS"
|
ok "$FILE permissions were set to $PERMISSIONS"
|
||||||
else
|
else
|
||||||
ERRORS=$((ERRORS+1))
|
ERRORS=$((ERRORS+1))
|
||||||
crit "$FILE permissions were not set to $PERMISSIONS"
|
crit "$FILE permissions were not set to $PERMISSIONS"
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -61,12 +66,17 @@ apply () {
|
|||||||
for FILE in $($SUDO_CMD find $DIR -xdev -type f -name 'ssh_host_*_key.pub');
|
for FILE in $($SUDO_CMD find $DIR -xdev -type f -name 'ssh_host_*_key.pub');
|
||||||
do
|
do
|
||||||
has_file_correct_permissions $FILE $PERMISSIONS
|
has_file_correct_permissions $FILE $PERMISSIONS
|
||||||
|
if [ $FNRET = 0 ]; then
|
||||||
|
ok "$FILE permissions were set to $PERMISSIONS"
|
||||||
|
else
|
||||||
|
has_file_correct_permissions $FILE 640
|
||||||
if [ $FNRET = 0 ]; then
|
if [ $FNRET = 0 ]; then
|
||||||
ok "$FILE permissions were set to $PERMISSIONS"
|
ok "$FILE permissions were set to $PERMISSIONS"
|
||||||
else
|
else
|
||||||
warn "fixing $DIR SSH public keys permissions to $USER:$GROUP"
|
warn "fixing $DIR SSH public keys permissions to $USER:$GROUP"
|
||||||
chmod 0$PERMISSIONS $FILE
|
chmod 0$PERMISSIONS $FILE
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
for FILE in $($SUDO_CMD find $DIR -xdev -type f -name 'ssh_host_*_key.pub');
|
for FILE in $($SUDO_CMD find $DIR -xdev -type f -name 'ssh_host_*_key.pub');
|
||||||
|
Loading…
Reference in New Issue
Block a user