Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions include/tests_authentication
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
fi
# Check password file
if [ -f ${PASSWD_FILE} ]; then
FIND=$(${GREPBINARY} -v '^#' ${PASSWD_FILE} | ${CUTBINARY} -d ':' -f3 | ${SORTBINARY} | uniq -d)
FIND=$(${GREPBINARY} -v '^#' ${PASSWD_FILE} | grep -v '^git:\*:' | ${CUTBINARY} -d ':' -f3 | ${SORTBINARY} | uniq -d)
if [ "${FIND}" = "" ]; then
Display --indent 2 --text "- Unique UIDs" --result "${STATUS_OK}" --color GREEN
LogText "Result: all accounts found in ${PASSWD_FILE} are unique"
Expand Down Expand Up @@ -162,7 +162,7 @@
LogText "Test: Checking login shells"
if [ -f ${ROOTDIR}etc/master.passwd ]; then
# Check for all shells, except: (/usr)/sbin/nologin /nonexistent
FIND=$(${GREPBINARY} "[a-z]:\*:" ${ROOTDIR}etc/master.passwd | ${GREPBINARY} -E -v '^#|/sbin/nologin|/usr/sbin/nologin|/nonexistent' | ${SEDBINARY} 's/ /!space!/g')
FIND=$(${GREPBINARY} "[a-z]:\*:" ${ROOTDIR}etc/master.passwd | ${GREPBINARY} -E -v '^#|/sbin/nologin|/usr/sbin/nologin|/nonexistent' | ${SEDBINARY} 's/ /!space!/g' | ${GREPBINARY} -vE '^(git|_gitea|_forgejo):\*:')
if [ -z "${FIND}" ]; then
Display --indent 2 --text "- Login shells" --result "${STATUS_OK}" --color GREEN
else
Expand Down Expand Up @@ -659,7 +659,12 @@
#
# Test : AUTH-9262
# Description : Search for PAM password strength testing libraries
Register --test-no AUTH-9262 --weight L --network NO --category security --description "Checking presence password strength testing tools (PAM)"
if [ ! "${OS}" = "OpenBSD" ]; then
PREQS_MET="YES"
else
PREQS_MET="NO"
fi
Register --test-no AUTH-9262 --preqs-met ${PREQS_MET} --weight L --network NO --category security --description "Checking presence password strength testing tools (PAM)"
if [ ${SKIPTEST} -eq 0 ]; then
FOUND=0
FOUND_CRACKLIB=0
Expand Down
2 changes: 1 addition & 1 deletion include/tests_filesystems
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@
if [ ${FOUND} -eq 1 ]; then
Display --indent 2 --text "- Query swap partitions (fstab)" --result "${STATUS_OK}" --color GREEN
else
Display --indent 2 --text "- Query swap partitions (fstab)" --result "${STATUS_NONE}" --color YELLOW
Display --indent 2 --text "- Query swap partitions (fstab)" --result "${STATUS_NONE}" --color WHITE
LogText "Result: no swap partitions found in /etc/fstab"
fi
fi
Expand Down
2 changes: 1 addition & 1 deletion include/tests_homedirs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ EOF
LogText "Test: checking directory '${DIR}' for user '${USER}'"
if [ -d "${DIR}" ]; then
OWNER=$(ls -ld ${DIR} | awk -F" " '{ print $3 }')
if [ ! "${OWNER}" = "${USER}" ]; then
if [ ! "$(id -u "${OWNER}")" = "$(id -u "${USER}")" ]; then
LogText "Result: the home directory ${DIR} of user ${USER} is owned by ${OWNER}. Correct: chown ${USER} ${DIR}"
FOUND=1
else
Expand Down
7 changes: 6 additions & 1 deletion include/tests_ports_packages
Original file line number Diff line number Diff line change
Expand Up @@ -1341,7 +1341,12 @@ EOF
#
# Test : PKGS-7398
# Description : Check package audit tool
Register --test-no PKGS-7398 --weight L --network YES --category security --description "Check for package audit tool"
if [ ! "${OS}" = "OpenBSD" ]; then
PREQS_MET="YES"
else
PREQS_MET="NO"
fi
Register --test-no PKGS-7398 --preqs-met ${PREQS_MET} --weight L --network YES --category security --description "Check for package audit tool"
if [ ${SKIPTEST} -eq 0 ]; then
LogText "Test: checking for package audit tool"
if [ ${PACKAGE_AUDIT_TOOL_FOUND} -eq 0 ]; then
Expand Down