From 7ba60805224862259075f14299bb74e7e6492999 Mon Sep 17 00:00:00 2001 From: MrSecure Date: Fri, 20 Apr 2018 15:54:47 -0500 Subject: [PATCH 1/2] add -V flag to show version --- prowler | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/prowler b/prowler index 0ae25594..79c093b2 100755 --- a/prowler +++ b/prowler @@ -70,12 +70,13 @@ USAGE: -l list all available checks only (does not perform any check) -e exclude group extras -b do not print Prowler banner + -V show version number & exit -h this help " exit } -while getopts ":hlkp:r:c:g:f:m:M:enb" OPTION; do +while getopts ":hlkp:r:c:g:f:m:M:enbV" OPTION; do case $OPTION in h ) usage @@ -118,6 +119,11 @@ while getopts ":hlkp:r:c:g:f:m:M:enb" OPTION; do e ) EXTRAS=1 ;; + V ) + echo "Prowler $PROWLER_VERSION" + EXITCODE=0 + exit $EXITCODE + ;; : ) echo "" echo "$OPTRED ERROR!$OPTNORMAL -$OPTARG requires an argument" From d1693e0f3d38263d8f7d2658cd8da6a4638a74e7 Mon Sep 17 00:00:00 2001 From: MrSecure Date: Fri, 20 Apr 2018 15:55:51 -0500 Subject: [PATCH 2/2] move getWhoami to position where it will run before any checks This restores the AWS account number in the CSV output when running checks or groups. --- prowler | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/prowler b/prowler index 79c093b2..02f7f064 100755 --- a/prowler +++ b/prowler @@ -256,6 +256,9 @@ show_all_titles() { done } +# Gather account data / test aws cli connectivity +getWhoami + # Execute single check if called with -c if [[ $CHECK_ID ]];then execute_check $CHECK_ID @@ -285,7 +288,6 @@ if [[ $MODE != "csv" ]]; then prowlerBanner fi -getWhoami genCredReport saveReport execute_all