From 4dcb9eccff5a77c1320083afb4da638fbb3caa27 Mon Sep 17 00:00:00 2001 From: mboelen Date: Mon, 25 Apr 2016 16:00:10 +0200 Subject: Allow skipping of plugins with --skip-plugins or skip-plugins --- default.prf | 3 +++ include/consts | 1 + include/parameters | 4 ++++ include/profiles | 6 ++++++ include/report | 2 +- lynis.8 | 3 +++ 6 files changed, 18 insertions(+), 1 deletion(-) diff --git a/default.prf b/default.prf index 7727a09d..dd5b939e 100644 --- a/default.prf +++ b/default.prf @@ -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 diff --git a/include/consts b/include/consts index f7fa3735..0a74814e 100644 --- a/include/consts +++ b/include/consts @@ -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 diff --git a/include/parameters b/include/parameters index 6dbb8e41..ae95755d 100644 --- a/include/parameters +++ b/include/parameters @@ -259,6 +259,10 @@ #RED="" ;; + --skip-plugins) + RUN_PLUGINS=0 + ;; + # Only scan these tests --tests) shift diff --git a/include/profiles b/include/profiles index f811d96b..bd6440b2 100644 --- a/include/profiles +++ b/include/profiles @@ -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:]'` diff --git a/include/report b/include/report index f007e389..8124b8ad 100644 --- a/include/report +++ b/include/report @@ -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 diff --git a/lynis.8 b/lynis.8 index 85eeffcf..b9eb847c 100644 --- a/lynis.8 +++ b/lynis.8 @@ -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. -- cgit v1.2.3