Initial support for remote scanning with: lynis audit system remote

This commit is contained in:
Michael Boelen 2016-05-14 15:44:06 +02:00
parent 93074a89ea
commit 08bad0ffbf
1 changed files with 30 additions and 1 deletions

View File

@ -38,7 +38,7 @@
"dockerfile")
if [ "$3" = "" ]; then
echo "${RED}Error: ${WHITE}Missing file name or URL${NORMAL}"
echo "Example: lynis audit dockerfile /root/Dockerfile"
echo "Example: $0 audit dockerfile /root/Dockerfile"
ExitFatal
else
shift; shift
@ -48,6 +48,35 @@
fi
;;
"system")
if [ "$3" = "remote" ]; then
shift
if [ "$3" = "" ]; then
echo "${RED}Error: ${WHITE}Missing remote location${NORMAL}"
echo "Example: $0 audit system remote 192.168.1.100"
ExitFatal
else
REMOTE_TARGET="$3"
shift; shift; shift # shift out first three arguments
EXTRA_PARAMS=""
if [ ! "$1" = "" ]; then EXTRA_PARAMS=" $@"; fi
# --quick is added to be non-interactive
REMOTE_COMMAND="./lynis audit system --quick${EXTRA_PARAMS}"
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
RUN_PLUGINS=0
RUN_TESTS=0
SHOW_PROGRAM_DETAILS=0
break
fi
fi
CHECK=1
CHECK_BINARIES=1
HELPER=""