Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CISOfy/lynis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Boelen <michael.boelen@cisofy.com>2017-03-05 22:45:13 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2017-03-05 22:45:13 +0300
commitb0cde02c71eff2503ec2a398dce529fcab9afb73 (patch)
tree71c36a06e3ff977eca8adcaccb88a2671ec0db83 /include/profiles
parent44f5209cb9fe566858e01fd0c79eadec3ee63031 (diff)
Code enhancements and allow host alias to be defined in profile
Diffstat (limited to 'include/profiles')
-rw-r--r--include/profiles19
1 files changed, 10 insertions, 9 deletions
diff --git a/include/profiles b/include/profiles
index 58218012..abad736a 100644
--- a/include/profiles
+++ b/include/profiles
@@ -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