Add quiet mode that only logs failures

This commit is contained in:
Dom Bellizzi
2019-12-18 22:06:44 +00:00
parent d2b3e5ecdc
commit f979c7334f
3 changed files with 15 additions and 1 deletions

View File

@@ -222,6 +222,7 @@ This script has been written in bash using AWS-CLI and it works in Linux and OSX
-b do not print Prowler banner
-V show version number & exit
-s show scoring report
-q suppress info messages and passing test output
-h this help
```

View File

@@ -13,6 +13,10 @@
# Output formatting functions
textPass(){
if [[ "$QUIET" == 1 ]]; then
return
fi
PASS_COUNTER=$((PASS_COUNTER+1))
if [[ "$MODE" == "csv" ]]; then
if [[ $2 ]]; then
@@ -55,6 +59,10 @@ textPass(){
}
textInfo(){
if [[ "$QUIET" == 1 ]]; then
return
fi
if [[ "$MODE" == "csv" ]]; then
if [[ $2 ]]; then
REPREGION=$2

View File

@@ -40,6 +40,7 @@ FILTERREGION=""
MAXITEMS=100
MONOCHROME=0
MODE="text"
QUIET=0
SEP=','
KEEPCREDREPORT=0
EXITCODE=0
@@ -75,12 +76,13 @@ USAGE:
-V show version number & exit
-s show scoring report
-x specify external directory with custom checks (i.e. /my/own/checks, files must start by "check")
-q suppress info messages and passing test output
-h this help
"
exit
}
while getopts ":hlLkp:r:c:g:f:m:M:E:enbVsx:" OPTION; do
while getopts ":hlLkqp:r:c:g:f:m:M:E:enbVsx:" OPTION; do
case $OPTION in
h )
usage
@@ -140,6 +142,9 @@ while getopts ":hlLkp:r:c:g:f:m:M:E:enbVsx:" OPTION; do
x )
EXTERNAL_CHECKS_PATH=$OPTARG
;;
q )
QUIET=1
;;
: )
echo ""
echo "$OPTRED ERROR!$OPTNORMAL -$OPTARG requires an argument"