added option -L to list check groups

This commit is contained in:
Toni de la Fuente
2018-11-14 20:38:02 -05:00
parent 013a435784
commit d14bdcc6c3
2 changed files with 14 additions and 3 deletions

View File

@@ -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 <check_id> 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 <group_id> specify a group of checks by id, to see all available group of checks use -l
-g <group_id> 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 <filterregion> 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

14
prowler
View File

@@ -58,7 +58,7 @@ USAGE:
(i.e.: us-east-1), all regions are checked anyway if the check requires it
-c <check_id> 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 <group_id> specify a group of checks by id, to see all available group of checks use "-l"
-g <group_id> 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 <filterregion> 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