mirror of
https://github.com/CISOfy/lynis.git
synced 2025-07-25 23:05:01 +02:00
Prevent false positive between inetd and xinetd
This commit is contained in:
parent
de7878d6d6
commit
f5f0f02777
@ -31,18 +31,18 @@
|
|||||||
# Description : Check for inetd status
|
# Description : Check for inetd status
|
||||||
Register --test-no INSE-8002 --weight L --network NO --description "Check for enabled inet daemon"
|
Register --test-no INSE-8002 --weight L --network NO --description "Check for enabled inet daemon"
|
||||||
if [ ${SKIPTEST} -eq 0 ]; then
|
if [ ${SKIPTEST} -eq 0 ]; then
|
||||||
# Check running processes
|
# Check running processes
|
||||||
logtext "Test: Searching for active inet daemon..."
|
logtext "Test: Searching for active inet daemon..."
|
||||||
FIND=`${PSBINARY} ax | grep "inetd" | grep -v "grep"`
|
IsRunning inetd
|
||||||
if [ ! "${FIND}" = "" ]; then
|
if [ ${RUNNING} -eq 1 ]; then
|
||||||
logtext "Result: inetd is running"
|
logtext "Result: inetd is running"
|
||||||
Display --indent 2 --text "- Checking inetd status..." --result ACTIVE --color GREEN
|
Display --indent 2 --text "- Checking inetd status..." --result ACTIVE --color GREEN
|
||||||
#YYY perform manual check
|
#YYY perform manual check
|
||||||
INETD_ACTIVE=1
|
INETD_ACTIVE=1
|
||||||
else
|
else
|
||||||
logtext "Result: inetd is NOT running"
|
logtext "Result: inetd is NOT running"
|
||||||
Display --indent 2 --text "- Checking inetd status..." --result "NOT ACTIVE" --color GREEN
|
Display --indent 2 --text "- Checking inetd status..." --result "NOT ACTIVE" --color GREEN
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
#
|
#
|
||||||
#################################################################################
|
#################################################################################
|
||||||
@ -52,17 +52,17 @@
|
|||||||
if [ ${INETD_ACTIVE} -eq 1 ]; then PREQS_MET="YES"; else PREQS_MET="NO"; fi
|
if [ ${INETD_ACTIVE} -eq 1 ]; then PREQS_MET="YES"; else PREQS_MET="NO"; fi
|
||||||
Register --test-no INSE-8004 --preqs-met ${PREQS_MET} --weight L --network NO --description "Check for enabled inet daemon"
|
Register --test-no INSE-8004 --preqs-met ${PREQS_MET} --weight L --network NO --description "Check for enabled inet daemon"
|
||||||
if [ ${SKIPTEST} -eq 0 ]; then
|
if [ ${SKIPTEST} -eq 0 ]; then
|
||||||
# Check configuration file
|
# Check configuration file
|
||||||
logtext "Test: Searching for file ${INETD_CONFIG_FILE}..."
|
logtext "Test: Searching for file ${INETD_CONFIG_FILE}..."
|
||||||
if [ -f ${INETD_CONFIG_FILE} ]; then
|
if [ -f ${INETD_CONFIG_FILE} ]; then
|
||||||
logtext "Result: ${INETD_CONFIG_FILE} exists"
|
logtext "Result: ${INETD_CONFIG_FILE} exists"
|
||||||
Display --indent 4 --text "- Checking inetd.conf..." --result FOUND --color WHITE
|
Display --indent 4 --text "- Checking inetd.conf..." --result FOUND --color WHITE
|
||||||
else
|
else
|
||||||
logtext "Result: ${INETD_CONFIG_FILE} does not exist"
|
logtext "Result: ${INETD_CONFIG_FILE} does not exist"
|
||||||
Display --indent 4 --text "- Checking inetd.conf..." --result "NOT FOUND" --color WHITE
|
Display --indent 4 --text "- Checking inetd.conf..." --result "NOT FOUND" --color WHITE
|
||||||
fi
|
fi
|
||||||
# YYY immutable bit could be set
|
# YYY immutable bit could be set
|
||||||
# YYY permission check (already set in profile)
|
# YYY permission check (already set in profile)
|
||||||
fi
|
fi
|
||||||
#
|
#
|
||||||
#################################################################################
|
#################################################################################
|
||||||
@ -70,17 +70,17 @@
|
|||||||
# Test : INSE-8006
|
# Test : INSE-8006
|
||||||
# Description : Check for inetd configuration file contents if inetd is NOT active
|
# Description : Check for inetd configuration file contents if inetd is NOT active
|
||||||
if [ ${INETD_ACTIVE} -eq 0 -a -f ${INETD_CONFIG_FILE} ]; then PREQS_MET="YES"; else PREQS_MET="NO"; fi
|
if [ ${INETD_ACTIVE} -eq 0 -a -f ${INETD_CONFIG_FILE} ]; then PREQS_MET="YES"; else PREQS_MET="NO"; fi
|
||||||
Register --test-no INSE-8006 --preqs-met ${PREQS_MET} --weight L --network NO --description "Check for disabled inet daemon"
|
Register --test-no INSE-8006 --preqs-met ${PREQS_MET} --weight L --network NO --description "Check configuration of inetd when disabled"
|
||||||
if [ ${SKIPTEST} -eq 0 ]; then
|
if [ ${SKIPTEST} -eq 0 ]; then
|
||||||
# Check if any service is enabled in /etc/inetd.conf (inetd is not active, see test 8002)
|
# Check if any service is enabled in /etc/inetd.conf (inetd is not active, see test 8002)
|
||||||
logtext "Test: check if all services are disabled if inetd is disabled"
|
logtext "Test: check if all services are disabled if inetd is disabled"
|
||||||
FIND=`cat ${INETD_CONFIG_FILE} | grep -v "^#" | grep -v "^$"`
|
FIND=`cat ${INETD_CONFIG_FILE} | grep -v "^#" | grep -v "^$"`
|
||||||
if [ "${FIND}" = "" ]; then
|
if [ "${FIND}" = "" ]; then
|
||||||
Display --indent 4 --text "- Checking inetd.conf services..." --result OK --color GREEN
|
Display --indent 4 --text "- Checking inetd.conf services..." --result OK --color GREEN
|
||||||
else
|
else
|
||||||
Display --indent 4 --text "- Checking inetd.conf services..." --result SUGGESTION --color YELLOW
|
Display --indent 4 --text "- Checking inetd.conf services..." --result SUGGESTION --color YELLOW
|
||||||
ReportSuggestion ${TEST_NO} "Although inetd is not running, make sure no services are enabled in ${INETD_CONFIG_FILE}"
|
ReportSuggestion ${TEST_NO} "Although inetd is not running, make sure no services are enabled in ${INETD_CONFIG_FILE}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
#
|
#
|
||||||
#################################################################################
|
#################################################################################
|
||||||
@ -90,14 +90,14 @@
|
|||||||
if [ ${INETD_ACTIVE} -eq 1 -a -f ${INETD_CONFIG_FILE} ]; then PREQS_MET="YES"; else PREQS_MET="NO"; fi
|
if [ ${INETD_ACTIVE} -eq 1 -a -f ${INETD_CONFIG_FILE} ]; then PREQS_MET="YES"; else PREQS_MET="NO"; fi
|
||||||
Register --test-no INSE-8016 --preqs-met ${PREQS_MET} --weight L --network NO --description "Check for telnet via inetd"
|
Register --test-no INSE-8016 --preqs-met ${PREQS_MET} --weight L --network NO --description "Check for telnet via inetd"
|
||||||
if [ ${SKIPTEST} -eq 0 ]; then
|
if [ ${SKIPTEST} -eq 0 ]; then
|
||||||
logtext "Test: checking telnet presence in inetd configuration"
|
logtext "Test: checking telnet presence in inetd configuration"
|
||||||
FIND=`grep "^telnet" ${INETD_CONFIG_FILE}`
|
FIND=`grep "^telnet" ${INETD_CONFIG_FILE}`
|
||||||
if [ "${FIND}" = "" ]; then
|
if [ "${FIND}" = "" ]; then
|
||||||
logtext "Result: telnet not enabled in ${INETD_CONFIG_FILE}"
|
logtext "Result: telnet not enabled in ${INETD_CONFIG_FILE}"
|
||||||
Display --indent 2 --text "- Checking inetd (telnet)..." --result FOUND --color GREEN
|
Display --indent 2 --text "- Checking inetd (telnet)..." --result FOUND --color GREEN
|
||||||
else
|
else
|
||||||
logtext "Result: telnet enabled in ${INETD_CONFIG_FILE}"
|
logtext "Result: telnet enabled in ${INETD_CONFIG_FILE}"
|
||||||
Display --indent 2 --text "- Checking inetd (telnet)..." --result WARNING --color RED
|
Display --indent 2 --text "- Checking inetd (telnet)..." --result WARNING --color RED
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
#
|
#
|
||||||
|
Loading…
x
Reference in New Issue
Block a user