fix(#8173): Do not return static aws credentials if they can expire #8970
+55
−83
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please add a summary of your change
In a previous commit (30728c2) for the function that provides AWS credentials, a crucial
if
was removed that was responsible for making sure callers of the functionGetS3Credentials
would not receive expired credentials.Specifically the removal of the following code caused the problem:
By not returning
nil, nil
in any of the code in the specific function and forcing to returnsome
credentials, even if they can expire (for example for IAM roles that are assumed via STS) all functions that would call this function would end up with invalid tokens after some period. This affects specifically long running backup/data mover jobs to cloud storage like S3. This PR addresses this issue, buy checking if the credentials received are able to expire and if yes, will returnnil,nil
and let the calling functions get their credentials via the default AWS credential provider chain.Does your change fix a particular issue?
Fixes #8173
Please indicate you've done the following:
make new-changelog
) or comment/kind changelog-not-required
on this PR.site/content/docs/main
.