add --audit-all option

This commit is contained in:
Stéphane Lesimple 2016-04-19 19:26:04 +02:00 committed by thibault.dewailly
parent 011cd160ea
commit 76811c8a7f
2 changed files with 11 additions and 0 deletions

View File

@ -18,6 +18,7 @@ TOTAL_CHECKS=0
TOTAL_TREATED_CHECKS=0
AUDIT=0
APPLY=0
AUDIT_ALL=0
usage() {
cat << EOF
@ -40,6 +41,9 @@ while [[ $# > 0 ]]; do
--audit)
AUDIT=1
;;
--audit-all)
AUDIT_ALL=1
;;
--apply)
APPLY=1
;;
@ -76,6 +80,9 @@ for SCRIPT in $(ls $CIS_ROOT_DIR/bin/hardening/*.sh | sort -V); do
if [ $AUDIT = 1 ]; then
debug "$CIS_ROOT_DIR/bin/hardening/$SCRIPT --audit"
$SCRIPT --audit
elif [ $AUDIT_ALL = 1 ]; then
debug "$CIS_ROOT_DIR/bin/hardening/$SCRIPT --audit-all"
$SCRIPT --audit-all
elif [ $APPLY = 1 ]; then
debug "$CIS_ROOT_DIR/bin/hardening/$SCRIPT"
$SCRIPT

View File

@ -26,6 +26,10 @@ fi
while [[ $# > 0 ]]; do
ARG="$1"
case $ARG in
--audit-all)
debug "Audit all specified, setting status to audit regardless of configuration"
status=audit
;;
--audit)
if [ $status != 'disabled' -a $status != 'false' ]; then
debug "Audit argument detected, setting status to audit"