mirror of https://github.com/CISOfy/lynis.git
Code enhancements and allow host alias to be defined in profile
This commit is contained in:
parent
44f5209cb9
commit
b0cde02c71
|
@ -29,6 +29,7 @@
|
|||
#################################################################################
|
||||
#
|
||||
for PROFILE in ${PROFILES}; do
|
||||
|
||||
LogText "Reading profile/configuration ${PROFILE}"
|
||||
FIND=$(egrep "^config:|^[a-z-].*=" ${PROFILE} | sed 's/ /!space!/g')
|
||||
for CONFIGOPTION in ${FIND}; do
|
||||
|
@ -36,7 +37,7 @@
|
|||
# Old style configuration
|
||||
OPTION=$(echo ${CONFIGOPTION} | cut -d ':' -f2)
|
||||
VALUE=$(echo ${CONFIGOPTION} | cut -d ':' -f3 | sed 's/!space!/ /g')
|
||||
else
|
||||
else
|
||||
OPTION=$(echo ${CONFIGOPTION} | cut -d '=' -f1)
|
||||
VALUE=$(echo ${CONFIGOPTION} | cut -d '=' -f2 | sed 's/!space!/ /g')
|
||||
fi
|
||||
|
@ -162,6 +163,10 @@
|
|||
AddSetting "group" "${GROUP_NAME}" "Group"
|
||||
;;
|
||||
|
||||
hostalias | host-alias)
|
||||
Report "host_alias=${VALUE}"
|
||||
;;
|
||||
|
||||
hostid)
|
||||
HOSTID="${VALUE}"
|
||||
;;
|
||||
|
@ -459,23 +464,20 @@
|
|||
#################################################################################
|
||||
#
|
||||
# Add group name to report
|
||||
if [ ! "${GROUP_NAME}" = "" ]; then
|
||||
Report "group=${GROUP_NAME}"
|
||||
fi
|
||||
if [ ! -z "${GROUP_NAME}" ]; then Report "group=${GROUP_NAME}"; fi
|
||||
#
|
||||
#################################################################################
|
||||
#
|
||||
# Set default values (only if not configured in profile)
|
||||
if [ "${MACHINE_ROLE}" = "" ]; then
|
||||
if [ -z "${MACHINE_ROLE}" ]; then
|
||||
MACHINE_ROLE="server"
|
||||
LogText "Set option to default value: MACHINE_ROLE --> ${MACHINE_ROLE}"
|
||||
fi
|
||||
|
||||
if [ "${NTPD_ROLE}" = "" ]; then
|
||||
if [ -z "${NTPD_ROLE}" ]; then
|
||||
NTPD_ROLE="client"
|
||||
LogText "Set option to default value: NTPD_ROLE --> ${NTPD_ROLE}"
|
||||
fi
|
||||
|
||||
#
|
||||
#################################################################################
|
||||
#
|
||||
|
@ -491,8 +493,7 @@
|
|||
#
|
||||
Display --indent 2 --text "- Checking profiles..." --result "DONE" --color GREEN
|
||||
|
||||
|
||||
LogTextBreak
|
||||
|
||||
#================================================================================
|
||||
# Lynis - Copyright 2007-2017, Michael Boelen - CISOfy, https://cisofy.com
|
||||
# Lynis - Security Auditing and System Hardening for Linux and UNIX - https://cisofy.com
|
||||
|
|
Loading…
Reference in New Issue