mirror of https://github.com/CISOfy/lynis.git
Update tests_authentication
Update AUTH-9402, change name to check in etc/passwd file when device is a QNAP
This commit is contained in:
parent
dc2962955e
commit
10b8da1c6a
|
@ -40,7 +40,12 @@
|
||||||
if [ ${SKIPTEST} -eq 0 ]; then
|
if [ ${SKIPTEST} -eq 0 ]; then
|
||||||
# Search accounts with UID 0
|
# Search accounts with UID 0
|
||||||
LogText "Test: Searching accounts with UID 0"
|
LogText "Test: Searching accounts with UID 0"
|
||||||
|
# Check if device is a QNAP, as the root user is called admin, and not root
|
||||||
|
if [ ${QNAP_DEVICE} -eq 1 ]; then
|
||||||
|
FIND=$(${GREPBINARY} ':0:' ${ROOTDIR}etc/passwd | ${EGREPBINARY} -v '^#|^admin:|^(\+:\*)?:0:0:::' | ${CUTBINARY} -d ":" -f1,3 | ${GREPBINARY} ':0')
|
||||||
|
else
|
||||||
FIND=$(${GREPBINARY} ':0:' ${ROOTDIR}etc/passwd | ${EGREPBINARY} -v '^#|^root:|^(\+:\*)?:0:0:::' | ${CUTBINARY} -d ":" -f1,3 | ${GREPBINARY} ':0')
|
FIND=$(${GREPBINARY} ':0:' ${ROOTDIR}etc/passwd | ${EGREPBINARY} -v '^#|^root:|^(\+:\*)?:0:0:::' | ${CUTBINARY} -d ":" -f1,3 | ${GREPBINARY} ':0')
|
||||||
|
fi
|
||||||
if [ ! -z "${FIND}" ]; then
|
if [ ! -z "${FIND}" ]; then
|
||||||
Display --indent 2 --text "- Administrator accounts" --result "${STATUS_WARNING}" --color RED
|
Display --indent 2 --text "- Administrator accounts" --result "${STATUS_WARNING}" --color RED
|
||||||
LogText "Result: Found more than one administrator accounts"
|
LogText "Result: Found more than one administrator accounts"
|
||||||
|
|
Loading…
Reference in New Issue