Allow skipping of plugins with --skip-plugins or skip-plugins

This commit is contained in:
mboelen 2016-04-25 16:00:10 +02:00
parent e5790dc8c6
commit 4dcb9eccff
6 changed files with 18 additions and 1 deletions

View File

@ -391,6 +391,9 @@ config:compliance_standards:cis,hipaa,iso27001,pci-dss:
# Enable quick mode (no waiting for keypresses, same as --quick option)
#quick=yes
# Skip plugins (default: no)
#skip-plugins=yes
# Skip a test (one per line)
#skip-test=SSH-7408

View File

@ -100,6 +100,7 @@ unset LANG
MALWARE_SCANNER_INSTALLED=0
MYSQL_RUNNING=0
MIN_PASSWORD_LENGTH=-1
N_PLUGIN_ENABLED=0
NAME_CACHE_USED=0
NETWORK_INTERFACES=""
NGINX_ACCESS_LOG_DISABLED=0

View File

@ -259,6 +259,10 @@
#RED=""
;;
--skip-plugins)
RUN_PLUGINS=0
;;
# Only scan these tests
--tests)
shift

View File

@ -182,6 +182,12 @@
Debug "Show warnings only set to ${SHOW_WARNINGS_ONLY}"
;;
# Skip plugins
skip-plugins)
FIND=`echo "${VALUE}" | egrep "^(1|yes)"` && RUN_PLUGINS=0
Debug "Run plugins is set to ${RUN_PLUGINS}"
;;
# Which tests to skip (skip-test=ABCD-1234 or skip-test=ABCD-1234:subtest)
skip-test)
STRING=`echo ${VALUE} | tr '[:upper:]' '[:lower:]'`

View File

@ -167,7 +167,7 @@
echo ""
echo " ${CYAN}Hardening index${NORMAL} : ${WHITE}${HPINDEX}${NORMAL} ${HPGRAPH}"
echo " ${CYAN}Tests performed${NORMAL} : ${WHITE}${CTESTS_PERFORMED}${NORMAL}"
echo " ${CYAN}Plugins enabled${NORMAL} : ${WHITE}${N_PLUGIN_ENABLED}${NORMAL}"
if [ ${RUN_PLUGINS} -eq 1 ]; then echo " ${CYAN}Plugins enabled${NORMAL} : ${WHITE}${N_PLUGIN_ENABLED}${NORMAL}"; fi
echo ""
echo " ${WHITE}Components${NORMAL}:"
if [ ${FIREWALL_ACTIVE} -eq 1 ]; then FIREWALL="${GREEN}V"; else FIREWALL="${RED}X"; fi

View File

@ -103,6 +103,9 @@ Provide an alternative name for report file.
.B \-\-reverse\-colors
Optimize screen output for light backgrounds.
.TP
.B \-\-skip\-plugins
Do not run plugins.
.TP
.B \-\-tests TEST-IDs
Only run the specific test(s). When using multiple tests, add quotes around the
line.