mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-24 13:01:56 +00:00
fix(instance-metadata): Credentials recovering (#1207)
* fix(instance-metadata): Credentials recovering * fix(expr): Dockerfile to root and expr in SESSION_TIME_REMAINING. Co-authored-by: Pepe Fagoaga <pepe@verica.io> Co-authored-by: sergargar <sergio@verica.io>
This commit is contained in:
@@ -72,6 +72,9 @@ validate_organizations() {
|
||||
# Set the new account to assume to recover AWS Organizations Metadata
|
||||
ACCOUNT_TO_ASSUME="${MANAGEMENT_ACCOUNT_ID}"
|
||||
|
||||
# Assume role to recover AWS Organizations metadata
|
||||
assume_role
|
||||
|
||||
# Recover AWS Organizations Metadata
|
||||
get_orgs_account_details
|
||||
|
||||
@@ -81,12 +84,14 @@ validate_organizations() {
|
||||
# Restoring initial credentials
|
||||
restoreInitialAWSCredentials
|
||||
fi
|
||||
}
|
||||
|
||||
if [[ -n "${ACCOUNT_TO_ASSUME}" || -n "${ROLE_TO_ASSUME}" ]]
|
||||
then
|
||||
backupInitialAWSCredentials
|
||||
assume_role
|
||||
fi
|
||||
validate_assume_role() {
|
||||
if [[ -n "${ACCOUNT_TO_ASSUME}" || -n "${ROLE_TO_ASSUME}" ]]
|
||||
then
|
||||
backupInitialAWSCredentials
|
||||
assume_role
|
||||
fi
|
||||
}
|
||||
|
||||
# JUnit output if -M junit-xml
|
||||
|
||||
Reference in New Issue
Block a user