From 00e5e65176184539af85d3019b497e95adf97438 Mon Sep 17 00:00:00 2001 From: Samuel Dugo Date: Wed, 19 Dec 2018 17:05:13 +0100 Subject: [PATCH] Option "-c" supports one or multiple checks Added support for option "-c" to specify one or multiple specific checks to be performed. To specify multiple tests include them using a comma delimiter (i.e. check21,check22). --- prowler | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/prowler b/prowler index 5787b8ee..8c3255fe 100755 --- a/prowler +++ b/prowler @@ -56,8 +56,8 @@ USAGE: -p specify your AWS profile to use (i.e.: default) -r specify an AWS region to direct API requests to (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) + -c specify one or multiple check ids separated by commas, to see all available checks use "-l" option + (i.e.: "check11" for check 1.1 or "extra71,extra72" for extra check 71 and extra check 72) -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 @@ -305,7 +305,10 @@ getWhoami # Execute single check if called with -c if [[ $CHECK_ID ]];then - execute_check $CHECK_ID + IFS=',' read -ra CHECKS <<< "$CHECK_ID" + for CHECK in "${CHECKS[@]}"; do + execute_check $CHECK + done cleanTemp exit $EXITCODE fi