mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-10 23:05:05 +00:00
prowler: Set default region by aws config, fall back to us-east-1
This commit is contained in:
16
prowler
16
prowler
@@ -23,7 +23,7 @@ OPTRED="[1;31m"
|
||||
OPTNORMAL="[0;39m"
|
||||
|
||||
# Set the defaults for these getopts variables
|
||||
REGION="us-east-1"
|
||||
REGION=""
|
||||
FILTERREGION=""
|
||||
MAXITEMS=100
|
||||
MONOCHROME=0
|
||||
@@ -76,7 +76,7 @@ while getopts ":hlkp:r:c:f:m:M:en" OPTION; do
|
||||
PROFILE=$OPTARG
|
||||
;;
|
||||
r )
|
||||
REGION=$OPTARG
|
||||
REGION_OPT=$OPTARG
|
||||
;;
|
||||
c )
|
||||
CHECKNUMBER=$OPTARG
|
||||
@@ -274,6 +274,16 @@ if [ -z "${AWSCLI}" ]; then
|
||||
exit $EXITCODE
|
||||
fi
|
||||
|
||||
# Set default region by aws config, fall back to us-east-1
|
||||
REGION_CONFIG=$(aws configure get region)
|
||||
if [[ $REGION_OPT ]]; then
|
||||
REGION="$REGION_OPT"
|
||||
elif [[ $REGION_CONFIG ]]; then
|
||||
REGION="$REGION_CONFIG"
|
||||
else
|
||||
REGION="us-east-1"
|
||||
fi
|
||||
|
||||
TITLE_ID=""
|
||||
TITLE_TEXT="CALLER ERROR - UNSET TITLE"
|
||||
## Output formatting functions
|
||||
@@ -1697,7 +1707,7 @@ extra73(){
|
||||
for bucket in $ALL_BUCKETS_LIST; do
|
||||
extra73Thread $bucket &
|
||||
done
|
||||
wait
|
||||
wait
|
||||
}
|
||||
|
||||
extra73Thread(){
|
||||
|
||||
Reference in New Issue
Block a user