mirror of https://github.com/CISOfy/lynis.git
NAME-4406: adjusted filter for localhost detection + logging
This commit is contained in:
parent
7f34f9dece
commit
bd833057e1
|
@ -640,9 +640,10 @@
|
|||
Register --test-no NAME-4406 --preqs-met ${PREQS_MET} --weight L --network NO --description "Check server hostname mapping"
|
||||
if [ ${SKIPTEST} -eq 0 ]; then
|
||||
LogText "Test: Check server hostname not locally mapped in /etc/hosts"
|
||||
sFIND=`egrep -v '^(#|$)' /etc/hosts | egrep '(localhost|^::1\s)' | grep -w ${HOSTNAME}`
|
||||
sFIND=`egrep -v '^(#|$)' /etc/hosts | egrep '^(localhost|::1)\s' | grep -w ${HOSTNAME}`
|
||||
if [ ! "${sFIND}" = "" ]; then
|
||||
LogText "Result: Found this server hostname mapped to a local address"
|
||||
LogText "Output: ${sFIND}"
|
||||
Display --indent 4 --text "- Checking /etc/hosts (localhost)" --result SUGGESTION --color YELLOW
|
||||
LogText "Information: Linking the hostname to the localhost entry may break some resolving. Split resolving so that localhost resolves back to 127.0.0.1 (and ::1) and the hostname of the machine to the real IP address on the network interface."
|
||||
ReportSuggestion ${TEST_NO} "Split resolving between localhost and the hostname of the system"
|
||||
|
|
Loading…
Reference in New Issue