2014-08-26 17:33:55 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
#################################################################################
|
|
|
|
#
|
|
|
|
# Lynis
|
|
|
|
# ------------------
|
|
|
|
#
|
2016-03-13 16:00:39 +01:00
|
|
|
# Copyright 2007-2013, Michael Boelen
|
2019-01-31 14:47:35 +01:00
|
|
|
# Copyright 2007-2019, CISOfy
|
2016-03-13 16:00:39 +01:00
|
|
|
#
|
|
|
|
# Website : https://cisofy.com
|
|
|
|
# Blog : http://linux-audit.com
|
|
|
|
# GitHub : https://github.com/CISOfy/lynis
|
2014-08-26 17:33:55 +02:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#
|
|
|
|
#################################################################################
|
|
|
|
#
|
|
|
|
# Parameter checks
|
|
|
|
#
|
|
|
|
#################################################################################
|
|
|
|
#
|
|
|
|
PARAMCOUNT=$#
|
2019-06-30 19:29:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
# Input validation on provided parameters and their arguments
|
|
|
|
COUNT=0
|
|
|
|
for I in "$@"; do
|
|
|
|
COUNT=$((COUNT + 1))
|
|
|
|
if ! SafeInput "${I}"; then
|
|
|
|
echo "Execution of ${PROGRAM_NAME} stopped as we found unexpected input or invalid characters in argument ${COUNT}"
|
|
|
|
echo "Do you believe this is in error? Let us know: ${PROGRAM_AUTHOR_CONTACT}"
|
2019-06-30 20:37:33 +02:00
|
|
|
ExitFatal "Program execution stopped due to security measure"
|
2019-06-30 19:29:48 +02:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# Parse arguments
|
2014-08-26 17:33:55 +02:00
|
|
|
while [ $# -ge 1 ]; do
|
2014-11-14 16:15:35 +01:00
|
|
|
case $1 in
|
2015-04-30 01:28:33 +02:00
|
|
|
# Helpers first
|
2015-01-30 19:59:48 +01:00
|
|
|
audit)
|
|
|
|
CHECK_BINARIES=0
|
|
|
|
RUN_HELPERS=1
|
|
|
|
HELPER="audit"
|
2016-07-05 18:18:54 +02:00
|
|
|
SKIP_PLUGINS=1
|
2015-01-30 19:59:48 +01:00
|
|
|
RUN_TESTS=0
|
2016-07-28 11:10:59 +02:00
|
|
|
if [ $# -gt 1 ]; then
|
2015-01-30 19:59:48 +01:00
|
|
|
case $2 in
|
|
|
|
"dockerfile")
|
2019-06-24 15:33:42 +02:00
|
|
|
if [ $# = 2 ]; then
|
2016-03-30 14:26:01 +02:00
|
|
|
echo "${RED}Error: ${WHITE}Missing file name or URL${NORMAL}"
|
2019-06-24 15:33:42 +02:00
|
|
|
echo "Example: $0 audit dockerfile /path/to/Dockerfile"
|
2015-01-30 19:59:48 +01:00
|
|
|
ExitFatal
|
2017-04-30 17:59:35 +02:00
|
|
|
else
|
2015-01-30 19:59:48 +01:00
|
|
|
shift; shift
|
2019-06-24 15:33:42 +02:00
|
|
|
CHECK_BINARIES=1
|
2016-11-05 11:52:06 +01:00
|
|
|
HELPER_PARAMS="$1"
|
2015-01-30 19:59:48 +01:00
|
|
|
HELPER="audit_dockerfile"
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
"system")
|
2016-07-28 11:10:59 +02:00
|
|
|
if [ $# -gt 2 ]; then
|
|
|
|
if [ "$3" = "remote" ]; then
|
2017-06-21 14:28:12 +02:00
|
|
|
#shift
|
|
|
|
if [ $# -eq 3 ]; then
|
2016-07-28 11:10:59 +02:00
|
|
|
echo "${RED}Error: ${WHITE}Missing remote location${NORMAL}"
|
|
|
|
echo "Example: $0 audit system remote 192.168.1.100"
|
|
|
|
ExitFatal
|
2017-04-30 17:59:35 +02:00
|
|
|
else
|
2017-06-21 14:28:12 +02:00
|
|
|
REMOTE_TARGET="$4"
|
2016-07-28 11:10:59 +02:00
|
|
|
shift; shift; shift # shift out first three arguments
|
|
|
|
EXTRA_PARAMS=""
|
|
|
|
if [ ! "$1" = "" ]; then EXTRA_PARAMS=" $@"; fi
|
2018-09-08 11:22:28 +02:00
|
|
|
REMOTE_COMMAND="./lynis audit system"
|
2016-07-28 11:10:59 +02:00
|
|
|
echo ""
|
|
|
|
echo " How to perform a remote scan:"
|
|
|
|
echo " ============================="
|
|
|
|
echo " Target : ${REMOTE_TARGET}"
|
|
|
|
echo " Command : ${REMOTE_COMMAND}"
|
|
|
|
HELPER="system_remote_scan"
|
|
|
|
HELPER_PARAMS="$@"
|
|
|
|
CHECK_BINARIES=0
|
|
|
|
QUIET=1
|
|
|
|
RUN_HELPERS=1
|
|
|
|
SKIP_PLUGINS=1
|
|
|
|
RUN_TESTS=0
|
|
|
|
SHOW_PROGRAM_DETAILS=0
|
|
|
|
break
|
|
|
|
fi
|
2016-05-14 15:44:06 +02:00
|
|
|
fi
|
|
|
|
fi
|
2016-05-03 13:53:20 +02:00
|
|
|
CHECK=1
|
2015-01-30 19:59:48 +01:00
|
|
|
CHECK_BINARIES=1
|
|
|
|
HELPER=""
|
2016-07-05 18:18:54 +02:00
|
|
|
SKIP_PLUGINS=0
|
2015-01-30 19:59:48 +01:00
|
|
|
RUN_TESTS=1
|
|
|
|
shift
|
2019-08-22 14:11:22 +02:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "${RED}Error: ${WHITE}Need a target to audit${NORMAL}"
|
|
|
|
echo " "
|
|
|
|
echo "Examples:"
|
|
|
|
echo "lynis audit dockerfile"
|
|
|
|
echo "lynis audit system"
|
|
|
|
ExitFatal
|
2015-01-30 19:59:48 +01:00
|
|
|
;;
|
|
|
|
esac
|
2017-04-30 17:59:35 +02:00
|
|
|
else
|
2016-03-30 14:35:16 +02:00
|
|
|
echo "${RED}Error: ${WHITE}Need a target to audit${NORMAL}"
|
|
|
|
echo " "
|
|
|
|
echo "Examples:"
|
|
|
|
echo "lynis audit dockerfile"
|
|
|
|
echo "lynis audit system"
|
2015-01-30 19:59:48 +01:00
|
|
|
ExitFatal
|
|
|
|
fi
|
|
|
|
;;
|
2014-08-26 17:33:55 +02:00
|
|
|
|
2016-05-15 20:00:18 +02:00
|
|
|
# Configure Lynis
|
|
|
|
configure)
|
|
|
|
CHECK_BINARIES=0
|
|
|
|
RUN_HELPERS=1
|
|
|
|
QUIET=1
|
2016-07-05 18:18:54 +02:00
|
|
|
SKIP_PLUGINS=1
|
2016-05-15 20:00:18 +02:00
|
|
|
RUN_TESTS=0
|
|
|
|
SHOW_PROGRAM_DETAILS=0
|
|
|
|
if [ $# -gt 0 ]; then shift; fi
|
|
|
|
HELPER="configure"
|
|
|
|
HELPER_PARAMS="$@"
|
|
|
|
break
|
|
|
|
;;
|
|
|
|
|
2019-04-13 13:26:56 +02:00
|
|
|
# Generate data
|
|
|
|
generate)
|
|
|
|
CHECK_BINARIES=0
|
|
|
|
HELPER="generate"
|
|
|
|
LOGTEXT=0
|
|
|
|
QUIET=1
|
|
|
|
RUN_HELPERS=1
|
|
|
|
RUN_TESTS=0
|
|
|
|
RUN_UPDATE_CHECK=0
|
|
|
|
SKIP_GETHOSTID=1
|
|
|
|
SKIP_PLUGINS=1
|
|
|
|
SKIP_VM_DETECTION=1
|
|
|
|
SHOW_PROGRAM_DETAILS=0
|
|
|
|
SHOW_TOOL_TIPS=0
|
|
|
|
shift; HELPER_PARAMS="$@"
|
|
|
|
break
|
|
|
|
;;
|
|
|
|
|
2016-05-15 20:00:18 +02:00
|
|
|
# Show Lynis details
|
2016-04-07 16:24:38 +02:00
|
|
|
show)
|
|
|
|
CHECK_BINARIES=0
|
|
|
|
HELPER="show"
|
2016-10-28 11:47:31 +02:00
|
|
|
LOGTEXT=0
|
2016-08-23 20:21:26 +02:00
|
|
|
QUIET=1
|
|
|
|
RUN_HELPERS=1
|
2016-04-07 16:24:38 +02:00
|
|
|
RUN_TESTS=0
|
2016-08-23 20:21:26 +02:00
|
|
|
RUN_UPDATE_CHECK=0
|
2016-07-12 20:09:10 +02:00
|
|
|
SKIP_PLUGINS=1
|
2016-04-07 16:24:38 +02:00
|
|
|
SHOW_PROGRAM_DETAILS=0
|
2016-10-28 11:47:31 +02:00
|
|
|
SHOW_TOOL_TIPS=0
|
2016-07-28 11:39:10 +02:00
|
|
|
shift; HELPER_PARAMS="$@"
|
2016-04-07 16:24:38 +02:00
|
|
|
break
|
|
|
|
;;
|
|
|
|
|
2015-04-30 01:28:33 +02:00
|
|
|
update)
|
|
|
|
CHECK_BINARIES=0
|
|
|
|
RUN_HELPERS=1
|
|
|
|
HELPER="update"
|
2016-05-14 17:43:40 +02:00
|
|
|
QUIET=1
|
2016-07-05 18:18:54 +02:00
|
|
|
SKIP_PLUGINS=1
|
2015-04-30 01:28:33 +02:00
|
|
|
RUN_TESTS=0
|
2016-10-28 11:47:31 +02:00
|
|
|
RUN_UPDATE_CHECK=0
|
2015-04-30 01:28:33 +02:00
|
|
|
SHOW_PROGRAM_DETAILS=0
|
2016-10-28 11:47:31 +02:00
|
|
|
SHOW_TOOL_TIPS=0
|
|
|
|
if [ $# -gt 1 ]; then
|
2015-04-30 01:28:33 +02:00
|
|
|
shift
|
2016-10-28 11:47:31 +02:00
|
|
|
HELPER_PARAMS="$1"
|
2015-04-30 01:28:33 +02:00
|
|
|
break
|
2016-10-28 11:47:31 +02:00
|
|
|
else
|
2016-03-30 14:26:01 +02:00
|
|
|
echo "${RED}Error: ${WHITE}Need a target for update${NORMAL}"
|
|
|
|
echo " "
|
|
|
|
echo "Examples:"
|
2016-07-18 10:34:10 +02:00
|
|
|
echo "lynis update check"
|
2016-03-30 14:26:01 +02:00
|
|
|
echo "lynis update info"
|
2015-04-30 01:28:33 +02:00
|
|
|
ExitFatal
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
2016-10-13 20:15:00 +02:00
|
|
|
# Perform just the upload
|
|
|
|
"upload-only" | "only-upload")
|
|
|
|
CHECK_BINARIES=1
|
|
|
|
CREATE_REPORT_FILE=0
|
|
|
|
#QUIET=1
|
|
|
|
LOGTEXT=0
|
|
|
|
RUN_HELPERS=0
|
|
|
|
RUN_TESTS=0
|
|
|
|
RUN_UPDATE_CHECK=0
|
|
|
|
SKIP_PLUGINS=1
|
|
|
|
SHOW_REPORT=0
|
|
|
|
SHOW_TOOL_TIPS=0
|
|
|
|
SHOW_PROGRAM_DETAILS=0
|
|
|
|
UPLOAD_DATA=1
|
|
|
|
if [ $# -gt 1 ]; then echo "No other parameters or options are allowed when using 'upload-only' command"; ExitFatal; fi
|
|
|
|
;;
|
|
|
|
|
2016-05-11 15:12:37 +02:00
|
|
|
# Assign auditor to report
|
|
|
|
--auditor)
|
|
|
|
shift
|
|
|
|
AUDITORNAME=$1
|
|
|
|
;;
|
|
|
|
|
2016-08-16 08:07:52 +02:00
|
|
|
# Binary directories (useful for incident response)
|
|
|
|
--bindirs | --bin-dirs)
|
|
|
|
if [ $# -gt 1 ]; then
|
|
|
|
shift
|
|
|
|
DIRS="$1"
|
|
|
|
for DIR in $1; do
|
|
|
|
if [ ! -d ${DIR} ]; then
|
|
|
|
echo "Invalid bindir '${DIR}' provided (does not exist)"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
BIN_PATHS="${DIRS}"
|
|
|
|
else
|
|
|
|
echo "Need one or more directories (e.g. \"/mnt/cert/bin /mnt/cert/sbin\")"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
2016-05-11 15:12:37 +02:00
|
|
|
# Cronjob support
|
2016-07-24 17:22:00 +02:00
|
|
|
--cron-job | --cronjob | --cron)
|
2016-05-11 15:12:37 +02:00
|
|
|
CRONJOB=1
|
2019-07-12 14:38:52 +02:00
|
|
|
CHECK=1; COLORS=0; NEVERBREAK=1 # Use some defaults ('audit system', -Q, no colors)
|
2016-07-18 19:58:32 +02:00
|
|
|
RemoveColors
|
2016-05-11 15:12:37 +02:00
|
|
|
;;
|
|
|
|
|
|
|
|
# Perform tests with additional debugging information on screen
|
|
|
|
--debug)
|
|
|
|
DEBUG=1
|
|
|
|
;;
|
|
|
|
|
|
|
|
# Developer mode (more details when creating tests)
|
|
|
|
--developer)
|
|
|
|
DEVELOPER_MODE=1
|
|
|
|
;;
|
|
|
|
|
2019-08-21 13:59:28 +02:00
|
|
|
# DevOps mode (continuous integration)
|
|
|
|
--devops)
|
|
|
|
DEVOPS_MODE=1
|
|
|
|
;;
|
|
|
|
|
2019-08-21 13:41:23 +02:00
|
|
|
# Enable forensics mode (gather information from a mounted directory)
|
|
|
|
--forensics)
|
|
|
|
FORENSICS=1
|
2016-05-11 15:12:37 +02:00
|
|
|
;;
|
|
|
|
|
|
|
|
# View help
|
|
|
|
--help | -h | "-?")
|
|
|
|
VIEWHELP=1
|
|
|
|
;;
|
|
|
|
|
|
|
|
# Adjust default logfile location
|
|
|
|
--logfile | --log-file)
|
|
|
|
shift
|
|
|
|
LOGFILE=$1
|
|
|
|
;;
|
|
|
|
|
|
|
|
# Don't use colors
|
2020-03-04 14:51:13 +01:00
|
|
|
--no-colors | --nocolors | --no-colour | --nocolour)
|
2016-07-05 19:56:38 +02:00
|
|
|
COLORS=0
|
2016-07-18 19:58:32 +02:00
|
|
|
RemoveColors
|
2016-05-11 15:12:37 +02:00
|
|
|
;;
|
|
|
|
|
|
|
|
# Disable logging
|
|
|
|
--no-log | --nolog)
|
|
|
|
LOGFILE="/dev/null"
|
|
|
|
;;
|
|
|
|
|
2020-02-14 11:49:32 +01:00
|
|
|
# Skip execution of plugins
|
|
|
|
--no-plugins | --noplugins | --skip-plugins)
|
|
|
|
SKIP_PLUGINS=1
|
|
|
|
;;
|
|
|
|
|
2016-05-11 15:12:37 +02:00
|
|
|
--pen-test | --pentest)
|
|
|
|
PENTESTINGMODE=1
|
|
|
|
;;
|
|
|
|
|
|
|
|
# Define a custom profile file
|
|
|
|
--profile)
|
2018-05-02 12:48:05 +02:00
|
|
|
if [ $# -gt 1 ]; then
|
|
|
|
shift
|
2019-07-18 11:42:26 +02:00
|
|
|
SEARCH_PROFILES="$1"
|
2018-05-02 12:48:05 +02:00
|
|
|
else
|
|
|
|
echo "Specify the profile (lynis audit system --profile /home/michael/myprofile.prf)"
|
|
|
|
exit 1
|
|
|
|
fi
|
2016-05-11 15:12:37 +02:00
|
|
|
;;
|
|
|
|
|
|
|
|
# Define a custom plugin directory
|
|
|
|
--plugindir | --plugin-dir | --plugins-dir)
|
2018-05-02 12:48:05 +02:00
|
|
|
if [ $# -gt 1 ]; then
|
|
|
|
shift
|
|
|
|
PLUGINDIR=$1
|
|
|
|
LASTCHAR=$(echo $1 | awk '{ print substr($0, length($0))}')
|
|
|
|
if [ "${LASTCHAR}" = "/" ]; then
|
|
|
|
echo "${RED}Error:${WHITE} plugin directory path should not end with a slash${NORMAL}"
|
|
|
|
ExitCustom 65
|
|
|
|
fi
|
|
|
|
if [ ! -d ${PLUGINDIR} ]; then
|
|
|
|
echo "${RED}Error:${WHITE} invalid plugin directory ${PLUGINDIR}${NORMAL}"
|
|
|
|
ExitCustom 66
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "Specify the plugin directory (lynis audit system --plugindir /home/michael/plugins)"
|
|
|
|
exit 1
|
2016-05-11 15:12:37 +02:00
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
|
|
|
# Quiet mode
|
2017-10-29 10:26:18 +01:00
|
|
|
--quiet | -q | --silent)
|
2016-05-11 15:12:37 +02:00
|
|
|
QUIET=1
|
|
|
|
;;
|
|
|
|
|
|
|
|
# Non-interactive mode
|
|
|
|
--quick | -Q)
|
|
|
|
QUICKMODE=1
|
|
|
|
;;
|
|
|
|
|
|
|
|
# Define alternative report file
|
|
|
|
--report-file)
|
|
|
|
shift
|
|
|
|
REPORTFILE=$1
|
|
|
|
;;
|
|
|
|
|
|
|
|
# Strip the colors which aren't clearly visible on light backgrounds
|
2020-03-04 14:51:13 +01:00
|
|
|
--reverse-colors| --reverse-colour)
|
2016-07-05 19:56:38 +02:00
|
|
|
BLUE="${NORMAL}";
|
2016-05-11 15:12:37 +02:00
|
|
|
SECTION="${NORMAL}";
|
|
|
|
NOTICE="${NORMAL}";
|
|
|
|
CYAN="${NORMAL}";
|
|
|
|
GREEN="${NORMAL}";
|
|
|
|
YELLOW="${NORMAL}";
|
|
|
|
WHITE="${NORMAL}";
|
|
|
|
PURPLE="${NORMAL}";
|
|
|
|
;;
|
|
|
|
|
2016-08-15 19:50:52 +02:00
|
|
|
# Root directory (useful for forensics)
|
|
|
|
--rootdir | --root-dir)
|
|
|
|
if [ $# -gt 1 ]; then
|
|
|
|
shift
|
|
|
|
if [ -d $1 ]; then
|
|
|
|
ROOTDIR="$1"
|
|
|
|
else
|
|
|
|
echo "Invalid rootdir provided (does not exist)"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "Need a root directory (e.g. /mnt/forensics)"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
2016-05-11 15:12:37 +02:00
|
|
|
# Only scan these tests
|
|
|
|
--tests)
|
|
|
|
shift
|
|
|
|
TESTS_TO_PERFORM=$1
|
|
|
|
;;
|
|
|
|
|
2016-07-24 17:22:00 +02:00
|
|
|
# Scan one or more tests from just one category (e.g. security)
|
|
|
|
--tests-from-category)
|
2016-05-11 15:12:37 +02:00
|
|
|
shift
|
2016-07-24 17:22:00 +02:00
|
|
|
TEST_CATEGORY_TO_CHECK=$1
|
|
|
|
;;
|
|
|
|
|
|
|
|
# Scan one or more tests from just on group
|
2019-09-19 14:05:15 +02:00
|
|
|
--tests-from-group | --tests-from-groups | --test-from-group | --test-from-groups)
|
2016-07-24 17:22:00 +02:00
|
|
|
shift
|
|
|
|
TEST_GROUP_TO_CHECK=$1
|
2016-05-11 15:12:37 +02:00
|
|
|
;;
|
|
|
|
|
|
|
|
# Lynis Enterprise: upload data to central node
|
|
|
|
--upload)
|
|
|
|
UPLOAD_DATA=1
|
|
|
|
;;
|
|
|
|
|
2019-12-04 08:01:56 +01:00
|
|
|
--usecwd | --use-cwd)
|
2019-07-26 09:00:47 +02:00
|
|
|
USE_CWD=1
|
2019-07-25 11:34:58 +02:00
|
|
|
;;
|
|
|
|
|
2016-05-11 15:12:37 +02:00
|
|
|
--verbose)
|
|
|
|
VERBOSE=1
|
|
|
|
;;
|
|
|
|
|
|
|
|
# Version number
|
|
|
|
--version | -V)
|
|
|
|
echo "${PROGRAM_VERSION}"
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
|
|
|
|
# View man page
|
2016-05-15 20:01:32 +02:00
|
|
|
--view-manpage | --man-page | --manpage | --man)
|
2016-05-11 15:12:37 +02:00
|
|
|
if [ -f lynis.8 ]; then
|
|
|
|
nroff -man lynis.8
|
|
|
|
exit 0
|
2017-04-30 17:59:35 +02:00
|
|
|
else
|
2016-05-11 15:12:37 +02:00
|
|
|
echo "Error: man page file not found (lynis.8)"
|
|
|
|
echo "If you are running an installed version of Lynis, use 'man lynis'"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
2016-07-27 12:14:25 +02:00
|
|
|
--wait)
|
|
|
|
QUICKMODE=0
|
|
|
|
;;
|
|
|
|
|
2016-05-11 15:12:37 +02:00
|
|
|
# Warnings
|
|
|
|
--warnings-only | --show-warnings-only)
|
|
|
|
SHOW_WARNINGS_ONLY=1
|
|
|
|
QUIET=1
|
|
|
|
;;
|
|
|
|
|
2016-07-24 17:22:00 +02:00
|
|
|
--tests-category | --tests-categories | --view-categories | --list-categories | --show-categories)
|
2016-07-26 15:20:18 +02:00
|
|
|
echo "Error: Deprecated option ($1)"
|
|
|
|
exit 1
|
2016-07-24 17:22:00 +02:00
|
|
|
;;
|
|
|
|
|
2019-08-21 13:41:23 +02:00
|
|
|
# Soon to be deprecated options
|
|
|
|
|
2019-08-21 13:48:36 +02:00
|
|
|
# Perform tests (deprecated, use audit system)
|
|
|
|
--check-all | --checkall | -c)
|
|
|
|
echo "This option (-c) is deprecated."
|
|
|
|
echo "Use: lynis audit system [options]"
|
|
|
|
ExitFatal
|
|
|
|
;;
|
|
|
|
|
2019-08-21 13:41:23 +02:00
|
|
|
# View program/database information
|
|
|
|
--check-update | --check-updates | --info)
|
2019-08-21 13:48:36 +02:00
|
|
|
echo "This option (--info) is deprecated"
|
2019-08-21 13:41:23 +02:00
|
|
|
echo "Use: lynis update info"
|
|
|
|
ExitFatal
|
|
|
|
;;
|
|
|
|
|
|
|
|
# Display all available options with short alias
|
|
|
|
--dump-options | --dumpoptions)
|
2019-08-21 13:48:36 +02:00
|
|
|
echo "This option (--dump-options) is deprecated"
|
2019-08-21 13:41:23 +02:00
|
|
|
echo "Use: lynis show options"
|
|
|
|
ExitFatal
|
|
|
|
;;
|
|
|
|
|
|
|
|
# License key for Lynis Enterprise
|
|
|
|
--license-key)
|
|
|
|
echo "This option is deprecated"
|
|
|
|
echo "Define a license key in /etc/lynis/custom.prf"
|
|
|
|
ExitFatal
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
2016-05-11 15:12:37 +02:00
|
|
|
# Drop out when using wrong option(s)
|
|
|
|
*)
|
|
|
|
# Wrong option used, we bail out later
|
|
|
|
WRONGOPTION=1
|
|
|
|
WRONGOPTION_value=$1
|
|
|
|
;;
|
2014-09-25 16:55:23 +02:00
|
|
|
|
2014-11-14 16:15:35 +01:00
|
|
|
esac
|
|
|
|
shift
|
2014-09-25 16:55:23 +02:00
|
|
|
|
2014-08-26 17:33:55 +02:00
|
|
|
done
|
|
|
|
|
2019-07-12 14:38:52 +02:00
|
|
|
# Ensure non-interactive mode when running quietly or as cronjob
|
|
|
|
if [ ${CRONJOB} -eq 1 -o ${QUIET} -eq 1 ]; then
|
|
|
|
if [ ${QUICKMODE} -eq 0 ]; then
|
|
|
|
if [ ${QUIET} -eq 0 ]; then
|
|
|
|
echo "Switched back to quick mode (cron/non-interactive/quiet)"
|
|
|
|
fi
|
|
|
|
QUICKMODE=1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2014-08-26 17:33:55 +02:00
|
|
|
#================================================================================
|
2016-03-13 16:03:46 +01:00
|
|
|
# Lynis - Security Auditing and System Hardening for Linux and UNIX - https://cisofy.com
|