This repository has been archived by the owner on May 18, 2021. It is now read-only.
fix: invalid request when assume_role_ttl >1h used from upstream source_profile #215
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.
Background
When role chaining, AWS sets a hard upper limit of 1h on the chained assume role TTL. However, the upstream non-chained role can still have a TTL of up to 12h.
Context
Prior to this PR, if the chained role did not have a value set for
assume_role_ttl
, aws-okta would look for it in the source profile. If the source profile set it to a value >1h, aws-okta would make a bad request resulting in:Change
Adds a
GetDirectValue
function to only search for the setting in the given profile (i.e. doesn't descend intosource_profile
or the okta profile). This is matches the behavior of aws-cli which does not appear to perform a recursive search for missing values.I've updated
updateDurationFromConfigProfile
to use this so that it only looks forassume_role_ttl
in the top-level profile.