Repository navigation
Conversation
The static aws_auth path built credentials from access_key_id and secret_access_key only, so temporary credentials from STS were signed without their session token and AWS refused every request with 403. session_token takes any secret source, like the other two fields. When set, Retrieve returns it and the signer adds X-Amz-Security-Token. It belongs to the static path: alongside credentials_provider it is rejected, and without the keys it reports the missing access_key_id.
Author
|
Closing in favour of #285, which carries the same optional session_token for static credentials in a smaller change. Keeping one PR open for review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
The static
aws_authpath reads onlyaccess_key_idandsecret_access_key. Temporary credentials from STS (AssumeRole, AssumeRoleWithWebIdentity) need their session token too. Without it the request is signed withoutX-Amz-Security-Token, and AWS answers 403 to every call. So a control plane that mints short-lived STS credentials and pushes them into the proxy has no way to use them, and has to fall back to long-lived IAM user keys.Change
session_tokenis a new optional field next to the two keys. It takes any registered secret source (env, aws_sm, 1password, and so on).staticSourceProvider.Retrievereturns it inaws.Credentials.SessionToken. The existing signing path then addsX-Amz-Security-Token, as it already does forworkload_identity.credentials_providerit is rejected ("not both"). Set without the keys, it reports the missingaccess_key_id.session_tokenbehave exactly as before.iron-proxy.example.yamldocuments the field.Tests
go test ./internal/transform/awsauth/covers:X-Amz-Security-Token, and the signature's SignedHeaders include it.credentials_provider, and a token source that cannot be built.Retrieve: no token, a token, and a token source that returns an error.