Update prowler

Adapted execute_check to renew creds
This commit is contained in:
Toni de la Fuente
2020-12-17 15:21:50 +01:00
committed by GitHub
parent 5c620949f0
commit 8c19583ac7

View File

@@ -321,10 +321,10 @@ show_group_title() {
# Function to execute the check
execute_check() {
if [[ $ACCOUNT_TO_ASSUME ]]; then
MINIMUM_REMAINING_TIME_ALLOWED=$(( SESSION_DURATION_TO_ASSUME / 10 ))
MINIMUM_REMAINING_TIME_ALLOWED=$(($SESSION_DURATION_TO_ASSUME / 10 ))
CURRENT_TIMESTAMP=$(date -u "+%s")
SESSION_CUTOFF=$(( CURRENT_TIMESTAMP + MINIMUM_REMAINING_TIME_ALLOWED ))
if (( AWS_SESSION_EXPIRATION < SESSION_CUTOFF )); then
SESSION_CUTOFF=$(($CURRENT_TIMESTAMP + $MINIMUM_REMAINING_TIME_ALLOWED))
if [[ $AWS_SESSION_EXPIRATION < $SESSION_CUTOFF ]]; then
unset AWS_ACCESS_KEY_ID
unset AWS_SECRET_ACCESS_KEY
unset AWS_SESSION_TOKEN