mirror of
https://github.com/CISOfy/lynis.git
synced 2025-07-23 05:44:45 +02:00
Fixes CISOfy/lynis#773
This commit is contained in:
parent
c16133b255
commit
d9013b13ac
@ -57,7 +57,8 @@
|
|||||||
if [ ${SKIPTEST} -eq 0 ]; then
|
if [ ${SKIPTEST} -eq 0 ]; then
|
||||||
# Check if users' home directories permissions are 750 or more restrictive
|
# Check if users' home directories permissions are 750 or more restrictive
|
||||||
FOUND=0
|
FOUND=0
|
||||||
for LINE in $(${EGREPBINARY} -v '^(daemon|git|halt|root|shutdown|sync)' ${ROOTDIR}etc/passwd | ${AWKBINARY} -F: '($7 !~ "/(false|nologin)$") { print }'); do
|
USERDATA=$(${EGREPBINARY} -v '^(daemon|git|halt|root|shutdown|sync)' ${ROOTDIR}etc/passwd | ${AWKBINARY} -F: '($7 !~ "/(false|nologin)$") { print }')
|
||||||
|
while read -r LINE; do
|
||||||
USER=$(echo ${LINE} | ${CUTBINARY} -d: -f1)
|
USER=$(echo ${LINE} | ${CUTBINARY} -d: -f1)
|
||||||
DIR=$(echo ${LINE} | ${CUTBINARY} -d: -f6)
|
DIR=$(echo ${LINE} | ${CUTBINARY} -d: -f6)
|
||||||
if [ -d "${DIR}" ]; then
|
if [ -d "${DIR}" ]; then
|
||||||
@ -70,7 +71,9 @@
|
|||||||
LogText "Result: permissions of home directory ${DIR} of user ${USER} are fine"
|
LogText "Result: permissions of home directory ${DIR} of user ${USER} are fine"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done << EOF
|
||||||
|
$USERDATA
|
||||||
|
EOF
|
||||||
|
|
||||||
if [ ${FOUND} -eq 1 ]; then
|
if [ ${FOUND} -eq 1 ]; then
|
||||||
Display --indent 2 --text "- Permissions of home directories" --result "${STATUS_WARNING}" --color RED
|
Display --indent 2 --text "- Permissions of home directories" --result "${STATUS_WARNING}" --color RED
|
||||||
@ -89,7 +92,8 @@
|
|||||||
if [ ${SKIPTEST} -eq 0 ]; then
|
if [ ${SKIPTEST} -eq 0 ]; then
|
||||||
# Check if users own their home directories
|
# Check if users own their home directories
|
||||||
FOUND=0
|
FOUND=0
|
||||||
for LINE in $(${EGREPBINARY} -v '^(daemon|git|halt|root|shutdown|sync)' ${ROOTDIR}etc/passwd | ${AWKBINARY} -F: '($7 !~ "/(false|nologin)$") { print }'); do
|
USERDATA=$(${EGREPBINARY} -v '^(daemon|git|halt|root|shutdown|sync)' ${ROOTDIR}etc/passwd | ${AWKBINARY} -F: '($7 !~ "/(false|nologin)$") { print }')
|
||||||
|
while read -r LINE; do
|
||||||
USER=$(echo ${LINE} | ${CUTBINARY} -d: -f1)
|
USER=$(echo ${LINE} | ${CUTBINARY} -d: -f1)
|
||||||
DIR=$(echo ${LINE} | ${CUTBINARY} -d: -f6)
|
DIR=$(echo ${LINE} | ${CUTBINARY} -d: -f6)
|
||||||
if [ -d ${DIR} ]; then
|
if [ -d ${DIR} ]; then
|
||||||
@ -101,7 +105,9 @@
|
|||||||
LogText "Result: ownership of home directory ${DIR} for user ${USER} looks to be correct"
|
LogText "Result: ownership of home directory ${DIR} for user ${USER} looks to be correct"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done << EOF
|
||||||
|
$USERDATA
|
||||||
|
EOF
|
||||||
|
|
||||||
if [ ${FOUND} -eq 1 ]; then
|
if [ ${FOUND} -eq 1 ]; then
|
||||||
Display --indent 2 --text "- Ownership of home directories" --result "${STATUS_WARNING}" --color RED
|
Display --indent 2 --text "- Ownership of home directories" --result "${STATUS_WARNING}" --color RED
|
||||||
|
Loading…
x
Reference in New Issue
Block a user