mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-24 04:51:51 +00:00
Fix: Credential chaining from environment variables @lazize #996f
If profile is not defined, restore original credentials from environment variables, if they exists, before assume-role
This commit is contained in:
committed by
GitHub
parent
ed558c857a
commit
c120a31904
+5
-1
@@ -14,7 +14,11 @@
|
||||
assume_role(){
|
||||
|
||||
PROFILE_OPT=$PROFILE_OPT_BAK
|
||||
|
||||
if [[ "${PROFILE_OPT}" = "" ]]; then
|
||||
# If profile is not defined, restore original credentials from environment variables, if they exists!
|
||||
restoreInitialAWSCredentials
|
||||
fi
|
||||
|
||||
# Both variables are mandatory to be set together
|
||||
if [[ -z $ROLE_TO_ASSUME || -z $ACCOUNT_TO_ASSUME ]]; then
|
||||
echo "$OPTRED ERROR!$OPTNORMAL - Both Account ID (-A) and IAM Role to assume (-R) must be set"
|
||||
|
||||
Reference in New Issue
Block a user