From d14bdcc6c3bdfd98ed6cfb67ee253f56078f342e Mon Sep 17 00:00:00 2001 From: Toni de la Fuente Date: Wed, 14 Nov 2018 20:38:02 -0500 Subject: [PATCH] added option -L to list check groups --- README.md | 3 ++- prowler | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d34a7b2c..6c86f9da 100644 --- a/README.md +++ b/README.md @@ -170,7 +170,7 @@ This script has been written in bash using AWS-CLI and it works in Linux and OSX (i.e.: us-east-1), all regions are checked anyway if the check requires it -c specify a check id, to see all available checks use -l option (i.e.: check11 for check 1.1 or extra71 for extra check 71) - -g specify a group of checks by id, to see all available group of checks use -l + -g specify a group of checks by id, to see all available group of checks use -L (i.e.: check3 for entire section 3, level1 for CIS Level 1 Profile Definitions or forensics-ready) -f specify an AWS region to run checks against (i.e.: us-west-1) @@ -180,6 +180,7 @@ This script has been written in bash using AWS-CLI and it works in Linux and OSX -n show check numbers to sort easier (i.e.: 1.01 instead of 1.1) -l list all available checks only (does not perform any check) + -L list all groups (does not perform any check) -e exclude group extras -b do not print Prowler banner -h this help diff --git a/prowler b/prowler index 00c65783..b243b681 100755 --- a/prowler +++ b/prowler @@ -58,7 +58,7 @@ USAGE: (i.e.: us-east-1), all regions are checked anyway if the check requires it -c specify a check id, to see all available checks use "-l" option (i.e.: "check11" for check 1.1 or "extra71" for extra check 71) - -g specify a group of checks by id, to see all available group of checks use "-l" + -g specify a group of checks by id, to see all available group of checks use "-L" (i.e.: "check3" for entire section 3, "level1" for CIS Level 1 Profile Definitions or "forensics-ready") -f specify an AWS region to run checks against (i.e.: us-west-1) @@ -68,6 +68,7 @@ USAGE: -n show check numbers to sort easier (i.e.: 1.01 instead of 1.1) -l list all available checks only (does not perform any check) + -L list all groups (does not perform any check) -e exclude group extras -b do not print Prowler banner -V show version number & exit @@ -76,7 +77,7 @@ USAGE: exit } -while getopts ":hlkp:r:c:g:f:m:M:enbV" OPTION; do +while getopts ":hlLkp:r:c:g:f:m:M:enbV" OPTION; do case $OPTION in h ) usage @@ -86,6 +87,9 @@ while getopts ":hlkp:r:c:g:f:m:M:enbV" OPTION; do l ) PRINTCHECKSONLY=1 ;; + L ) + PRINTGROUPSONLY=1 + ;; k ) KEEPCREDREPORT=1 ;; @@ -272,6 +276,12 @@ if [[ $PRINTCHECKSONLY == "1" ]]; then exit $EXITCODE fi +# List only group tittles +if [[ $PRINTGROUPSONLY == "1" ]]; then + show_all_group_titles + exit $EXITCODE +fi + # Check that jq is installed for JSON output if [[ $MODE == "json" ]]; then . $PROWLER_DIR/include/jq_detector