mirror of
https://github.com/CISOfy/lynis.git
synced 2025-07-27 07:44:14 +02:00
Allow plugin directory to be configured, and apply new style configuration matching
This commit is contained in:
parent
991083c13f
commit
37a2614f79
@ -26,11 +26,16 @@
|
|||||||
|
|
||||||
for PROFILE in ${PROFILES}; do
|
for PROFILE in ${PROFILES}; do
|
||||||
logtext "Reading profile/configuration ${PROFILE}"
|
logtext "Reading profile/configuration ${PROFILE}"
|
||||||
FIND=`grep '^config:' ${PROFILE} | sed 's/ /!space!/g'`
|
FIND=`egrep "^config:|^[a-z].*=" ${PROFILE} | sed 's/ /!space!/g'`
|
||||||
for I in ${FIND}; do
|
for I in ${FIND}; do
|
||||||
OPTION=`echo ${I} | cut -d ':' -f2`
|
if ContainsString ":" "${I}"; then
|
||||||
VALUE=`echo ${I} | cut -d ':' -f3 | sed 's/!space!/ /g'`
|
# Old style configuration
|
||||||
|
OPTION=`echo ${I} | cut -d ':' -f2`
|
||||||
|
VALUE=`echo ${I} | cut -d ':' -f3 | sed 's/!space!/ /g'`
|
||||||
|
else
|
||||||
|
OPTION=`echo ${I} | cut -d '=' -f1`
|
||||||
|
VALUE=`echo ${I} | cut -d '=' -f2 | sed 's/!space!/ /g'`
|
||||||
|
fi
|
||||||
logtext "Profile option set: ${OPTION} (with value ${VALUE})"
|
logtext "Profile option set: ${OPTION} (with value ${VALUE})"
|
||||||
|
|
||||||
case ${OPTION} in
|
case ${OPTION} in
|
||||||
@ -132,6 +137,16 @@
|
|||||||
TEST_PAUSE_TIME="${VALUE}"
|
TEST_PAUSE_TIME="${VALUE}"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
# Plugin
|
||||||
|
plugin)
|
||||||
|
LogText "Plugin ${VALUE} enabled according profile ${PROFILE}"
|
||||||
|
;;
|
||||||
|
|
||||||
|
# Plugin directory
|
||||||
|
plugindir)
|
||||||
|
PLUGINDIR="${VALUE}"
|
||||||
|
;;
|
||||||
|
|
||||||
# Profile name
|
# Profile name
|
||||||
profile_name)
|
profile_name)
|
||||||
PROFILE_NAME="${VALUE}"
|
PROFILE_NAME="${VALUE}"
|
||||||
@ -219,7 +234,7 @@
|
|||||||
# Catch all bad options and bail out
|
# Catch all bad options and bail out
|
||||||
*)
|
*)
|
||||||
logtext "Unknown option ${OPTION} (with value: ${VALUE})"
|
logtext "Unknown option ${OPTION} (with value: ${VALUE})"
|
||||||
echo "Fatal error: found errors in profile"
|
echo "Fatal error: found errors in profile ${PROFILE}"
|
||||||
echo "Unknown option '${OPTION}' found (with value: ${VALUE})"
|
echo "Unknown option '${OPTION}' found (with value: ${VALUE})"
|
||||||
ExitFatal
|
ExitFatal
|
||||||
;;
|
;;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user