mirror of
https://github.com/CISOfy/lynis.git
synced 2025-07-28 08:14:10 +02:00
[PRNT-2308] check for Port statement and minor adjustments to test
This commit is contained in:
parent
ca6fc134dd
commit
6eb204a85d
@ -144,14 +144,21 @@
|
|||||||
FIND=$(${EGREPBINARY} "^(SSL)?Listen" ${CUPSD_CONFIG_FILE} | ${GREPBINARY} -v "/" | ${AWKBINARY} '{ print $2 }')
|
FIND=$(${EGREPBINARY} "^(SSL)?Listen" ${CUPSD_CONFIG_FILE} | ${GREPBINARY} -v "/" | ${AWKBINARY} '{ print $2 }')
|
||||||
COUNT=0
|
COUNT=0
|
||||||
for ITEM in ${FIND}; do
|
for ITEM in ${FIND}; do
|
||||||
LogText "Found network address: ${ITEM}"
|
LogText "Result: found network address: ${ITEM}"
|
||||||
COUNT=$((COUNT + 1))
|
COUNT=$((COUNT + 1))
|
||||||
FOUND=1
|
FOUND=1
|
||||||
done
|
done
|
||||||
|
|
||||||
# Check if daemon is only running on localhost
|
# Search for Port statement
|
||||||
|
FIND=$(${EGREPBINARY} "^Port 631" ${CUPSD_CONFIG_FILE})
|
||||||
|
if [ -n "${FIND}" ]; then
|
||||||
|
LogText "Result: found CUPS listening on port 631 (most likely all interfaces)"
|
||||||
|
FOUND=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if daemon might be running on localhost
|
||||||
if [ ${FOUND} -eq 0 ]; then
|
if [ ${FOUND} -eq 0 ]; then
|
||||||
LogText "Result: no listen statement found in CUPS configuration file"
|
LogText "Result: CUPS does not look to be listening on a network port"
|
||||||
elif [ ${COUNT} -eq 1 ]; then
|
elif [ ${COUNT} -eq 1 ]; then
|
||||||
if [ "${FIND}" = "localhost:631" -o "${FIND}" = "127.0.0.1:631" ]; then
|
if [ "${FIND}" = "localhost:631" -o "${FIND}" = "127.0.0.1:631" ]; then
|
||||||
LogText "Result: CUPS daemon only running on localhost"
|
LogText "Result: CUPS daemon only running on localhost"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user