diff options
author | Michael Boelen <michael.boelen@cisofy.com> | 2016-07-05 18:26:27 +0300 |
---|---|---|
committer | Michael Boelen <michael.boelen@cisofy.com> | 2016-07-05 18:26:27 +0300 |
commit | bac442c6fe63da6b0cbfbc3c8e27c1126ca7da46 (patch) | |
tree | 7593e433e8a2e20193aadee5aeba59362a557d57 /include | |
parent | 75786a1c80ba783c5552c837930aaba11f74c3fb (diff) |
Migrate to new options, including skip-plugins
Diffstat (limited to 'include')
-rw-r--r-- | include/consts | 2 | ||||
-rw-r--r-- | include/helper_show | 2 | ||||
-rw-r--r-- | include/profiles | 25 | ||||
-rw-r--r-- | include/report | 2 |
4 files changed, 21 insertions, 10 deletions
diff --git a/include/consts b/include/consts index 9f907527..d4d61482 100644 --- a/include/consts +++ b/include/consts @@ -153,7 +153,6 @@ unset LANG RKHUNTERBINARY="" RPMBINARY="" RUN_HELPERS=0 - RUN_PLUGINS=1 RUN_TESTS=1 SAMHAINBINARY="" SCAN_TEST_HEAVY=""; SCAN_TEST_MEDIUM=""; SCAN_TEST_LOW="" @@ -166,6 +165,7 @@ unset LANG SHOW_PROGRAM_DETAILS=1 SHOW_REPORT=1 SHOW_WARNINGS_ONLY=0 + SKIP_PLUGINS=0 SKIP_TESTS="" SKIPPED_TESTS_ROOTONLY="" SSHKEYSCANBINARY="" diff --git a/include/helper_show b/include/helper_show index 5a6662f7..8acb69f5 100644 --- a/include/helper_show +++ b/include/helper_show @@ -209,6 +209,8 @@ if [ $# -gt 0 ]; then if [ ${BRIEF_OUTPUT} -eq 0 ]; then ${ECHOCMD} ""; fi fi done + if [ ${BRIEF_OUTPUT} -eq 0 ]; then DisplayToolTip "add --brief to show just the settings, --nocolors to remove colors"; fi + ;; "tests") if [ $# -gt 0 ]; then diff --git a/include/profiles b/include/profiles index 3875ef77..1d1cf442 100644 --- a/include/profiles +++ b/include/profiles @@ -171,7 +171,7 @@ # How much seconds to wait between tests pause_between_tests | pause-between-tests) TEST_PAUSE_TIME="${VALUE}" - AddSetting "pause-between-tests" "${TEST_PAUSE_TIME}" "Pause between tests" + AddSetting "pause-between-tests" "${TEST_PAUSE_TIME}" "Pause between tests (in seconds)" ;; # Plugin @@ -196,29 +196,38 @@ # Quick (no waiting for keypresses) quick) - FIND=`echo "${VALUE}" | egrep "^(1|yes)"` && QUICKMODE=1 - Debug "Quickmode set to ${QUICKMODE}" + # Quick mode (SKIP_PLUGINS) might already be set outside profile, so store in different variable + SETTING_QUICK_MODE=0 # default is no + FIND=`echo "${VALUE}" | egrep "^(1|true|yes)$"` && QUICKMODE=1 + if [ ! -z "${FIND}" ]; then SETTING_QUICK_MODE=1; fi + Debug "Quickmode set to ${SETTING_QUICK_MODE}" + AddSetting "quick" "${SETTING_QUICK_MODE}" "Quick mode (non-interactive)" ;; # Inline tips about tool (default enabled) show_tool_tips | show-tool-tips) - FIND=`echo "${VALUE}" | egrep "^(1|false|no)"` && SHOW_TOOL_TIPS=0 + FIND=`echo "${VALUE}" | egrep "^(1|false|no)$"` && SHOW_TOOL_TIPS=0 Debug "Show tool tips set to ${SHOW_TOOL_TIPS}" + AddSetting "show-tool-tips" "${SHOW_TOOL_TIPS}" "Show tool tips" ;; # Show warnings only show-warnings-only) QUIET=1 QUICKMODE=1 - FIND=`echo "${VALUE}" | egrep "^(1|true|yes)"` && SHOW_WARNINGS_ONLY=1 + FIND=`echo "${VALUE}" | egrep "^(1|true|yes)$"` && SHOW_WARNINGS_ONLY=1 Debug "Show warnings only set to ${SHOW_WARNINGS_ONLY}" + AddSetting "show-warnings-only" "${SHOW_WARNINGS_ONLY}" "Show only warnings" ;; # Skip plugins skip-plugins) - FIND=`echo "${VALUE}" | egrep "^(1|true|yes)"` && RUN_PLUGINS=0 - Debug "Run plugins is set to ${RUN_PLUGINS}" - AddSetting "run-plugins" "${RUN_PLUGINS}" "Run plugins" + # Skip plugins (SKIP_PLUGINS) might already be set, so store in different variable + SETTING_SKIP_PLUGINS=0 # default is no + FIND=`echo "${VALUE}" | egrep "^(1|true|yes)$"` && SKIP_PLUGINS=1 + if [ ! -z "${FIND}" ]; then SETTING_SKIP_PLUGINS=1; fi + Debug "Skip plugins is set to ${SETTING_SKIP_PLUGINS}" + AddSetting "skip-plugins" "${SETTING_SKIP_PLUGINS}" "Skip plugins" ;; # SSL paths diff --git a/include/report b/include/report index 2b996fc5..af993fbf 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}" - if [ ${RUN_PLUGINS} -eq 1 ]; then echo " ${CYAN}Plugins enabled${NORMAL} : ${WHITE}${N_PLUGIN_ENABLED}${NORMAL}"; fi + if [ ${SKIP_PLUGINS} -eq 0 ]; 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 |