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>2016-05-15 21:37:10 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2016-05-15 21:37:10 +0300
commit9542dc2f6bace060bc480f779bf22c3b1672b3d2 (patch)
tree750d78bc61001e8319993ecb14aa6e12f9c940d5 /include/helper_configure
parentbb2c97f9c1e1a1a424e369896eafbbbca5797f7f (diff)
Initial import of configure helper
Diffstat (limited to 'include/helper_configure')
-rw-r--r--include/helper_configure83
1 files changed, 83 insertions, 0 deletions
diff --git a/include/helper_configure b/include/helper_configure
new file mode 100644
index 00000000..cbdd5b06
--- /dev/null
+++ b/include/helper_configure
@@ -0,0 +1,83 @@
+#!/bin/sh
+
+#################################################################################
+#
+# Lynis
+# ------------------
+#
+# Copyright 2007-2013, Michael Boelen
+# Copyright 2013-2016, CISOfy
+#
+# Website : https://cisofy.com
+# Blog : http://linux-audit.com
+# GitHub : https://github.com/CISOfy/lynis
+#
+# Lynis comes with ABSOLUTELY NO WARRANTY. This is free software, and you are
+# welcome to redistribute it under the terms of the GNU General Public License.
+# See LICENSE file for usage of this software.
+#
+######################################################################
+#
+# Helper program to configure Lynis
+#
+######################################################################
+#
+# How to use:
+# ------------
+#
+# Run:
+# lynis configure settings quick
+# lynis configure settings quick=yes:debug=yes
+#
+######################################################################
+
+ CONFIGURE_CRONJOB=0
+ CONFIGURE_SETTINGS=0
+
+ # Check configure mode
+ if [ "${HELPER_PARAMS}" = "" ]; then
+ ${ECHOCMD} "${YELLOW}Provide one or more configuration settings${NORMAL}"
+ ${ECHOCMD} ""
+ ${ECHOCMD} "Examples:"
+ ${ECHOCMD} " $0 configure cronjob"
+ ${ECHOCMD} ""
+ ${ECHOCMD} " $0 configure settings quick"
+ ${ECHOCMD} " $0 configure settings debug:developer-mode:quick"
+ ${ECHOCMD} " $0 configure settings debug=yes:developer-mode=no:quick=yes"
+ ${ECHOCMD} ""
+ ExitClean
+ elif [ "$1" = "cronjob" ]; then
+ CONFIGURE_CRONJOB=1
+ elif [ "$1" = "settings" ]; then
+ CONFIGURE_SETTINGS=1
+ fi
+
+
+ # Perform activities depending on requested task
+ if [ ${CONFIGURE_CRONJOB} -eq 1 ]; then
+
+ ${ECHOCMD} "Automatic configuration for cronjobs is not implemented yet."
+ ExitClean
+
+ elif [ ${CONFIGURE_SETTINGS} -eq 1 ]; then
+
+ # Determine where profiles are stored
+ if [ "${PROFILEDIR}" = "" ]; then
+ ${ECHOCMD} "Can not configure Lynis, as profile directory is unknown"
+ ExitFatal
+ fi
+ if [ "${CUSTOM_PROFILE}" = "" ]; then ${ECHOCMD} "No custom profile found yet."; fi
+
+ FIND=$(echo ${HELPER_PARAMERS} | grep " ")
+ if [ ! "${FIND}" = "" ]; then ${ECHOCMD} "Found invalid character (space) in configuration string"; ExitFatal; fi
+
+ ${ECHOCMD} "${YELLOW}Note${NORMAL}: ${WHITE}Automatic configuration not fully implemented yet.${NORMAL}"
+ ExitClean
+
+ fi
+
+
+ ExitClean
+
+
+# The End