mirror of
https://github.com/CISOfy/lynis.git
synced 2025-07-27 07:44:14 +02:00
[FILE-7524] Support for multiple profiles
This commit is contained in:
parent
015287e963
commit
d4a5aba7ea
@ -32,24 +32,26 @@
|
|||||||
if [ ${SKIPTEST} -eq 0 ]; then
|
if [ ${SKIPTEST} -eq 0 ]; then
|
||||||
Display --indent 2 --text "- Starting file permissions check"
|
Display --indent 2 --text "- Starting file permissions check"
|
||||||
LogText "Test: Checking file permissions"
|
LogText "Test: Checking file permissions"
|
||||||
LogText "Using profile ${PROFILE} for baseline."
|
for PROFILE in ${PROFILES}; do
|
||||||
FIND=`egrep '^permfile:|^permdir:' ${PROFILE} | cut -d: -f2`
|
LogText "Using profile ${PROFILE} for baseline."
|
||||||
for I in ${FIND}; do
|
FIND=`egrep '^permfile:|^permdir:' ${PROFILE} | cut -d: -f2`
|
||||||
LogText "Checking ${I}"
|
for I in ${FIND}; do
|
||||||
CheckFilePermissions ${I}
|
LogText "Checking ${I}"
|
||||||
LogText " Expected permissions: ${PROFILEVALUE}"
|
CheckFilePermissions ${I}
|
||||||
LogText " Actual permissions: ${FILEVALUE}"
|
LogText " Expected permissions: ${PROFILEVALUE}"
|
||||||
LogText " Result: $PERMS"
|
LogText " Actual permissions: ${FILEVALUE}"
|
||||||
if [ "${PERMS}" = "FILE_NOT_FOUND" ]; then
|
LogText " Result: $PERMS"
|
||||||
Display --indent 4 --text "${I}" --result "NOT FOUND" --color WHITE
|
if [ "${PERMS}" = "FILE_NOT_FOUND" ]; then
|
||||||
elif [ "${PERMS}" = "OK" ]; then
|
Display --indent 4 --text "${I}" --result "NOT FOUND" --color WHITE
|
||||||
Display --indent 4 --text "${I}" --result OK --color GREEN
|
elif [ "${PERMS}" = "OK" ]; then
|
||||||
elif [ "${PERMS}" = "BAD" ]; then
|
Display --indent 4 --text "${I}" --result OK --color GREEN
|
||||||
Display --indent 4 --text "${I}" --result WARNING --color RED
|
elif [ "${PERMS}" = "BAD" ]; then
|
||||||
ReportWarning ${TEST_NO} "M" "Incorrect permissions for file ${I}"
|
Display --indent 4 --text "${I}" --result WARNING --color RED
|
||||||
else
|
ReportWarning ${TEST_NO} "M" "Incorrect permissions for file ${I}"
|
||||||
LogText "UNKNOWN status for file"
|
else
|
||||||
fi
|
LogText "UNKNOWN status for file"
|
||||||
|
fi
|
||||||
|
done
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
#
|
#
|
||||||
|
Loading…
x
Reference in New Issue
Block a user