mirror of https://github.com/CISOfy/lynis.git
Initial support for remote scanning with: lynis audit system remote
This commit is contained in:
parent
93074a89ea
commit
08bad0ffbf
|
@ -38,7 +38,7 @@
|
||||||
"dockerfile")
|
"dockerfile")
|
||||||
if [ "$3" = "" ]; then
|
if [ "$3" = "" ]; then
|
||||||
echo "${RED}Error: ${WHITE}Missing file name or URL${NORMAL}"
|
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
|
ExitFatal
|
||||||
else
|
else
|
||||||
shift; shift
|
shift; shift
|
||||||
|
@ -48,6 +48,35 @@
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
"system")
|
"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=1
|
||||||
CHECK_BINARIES=1
|
CHECK_BINARIES=1
|
||||||
HELPER=""
|
HELPER=""
|
||||||
|
|
Loading…
Reference in New Issue