Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use matching signing region for IAM join method #47425

Merged
merged 1 commit into from
Oct 16, 2024

Conversation

nklaassen
Copy link
Contributor

#47044 was flawed and overrides the target STS endpoint without overriding the signing region used when signing the request. This causes IAM joining to fail with errors like the following whenever the region is set from the IMDSv2 or overridden in a non-FIPS region

aws sts api returned status: \"403 Forbidden\" body: \"{\\\"Error\\\":{\\\"Code\\\":\\\"SignatureDoesNotMatch\\\",\\\"Message\\\":\\\"Credential should be scoped to a valid region. \\\",\\\"Type\\\":\\\"Sender\\\"},\\\"RequestId\\\":\\\"5a4361b5-dee0-4a6e-bfbf-35db72ed301c\\\"}

This PR fixes the issue by setting the region on the base aws.Config instead of handling region logic in the custom endpoint resolver. The custom endpoint resolver lives on only because it is the simplest way to set the challenge header and the Accept: application/json header, it doesn't actually override the target endpoint.

@nklaassen nklaassen added the no-changelog Indicates that a PR does not require a changelog entry label Oct 10, 2024
@nklaassen nklaassen added this pull request to the merge queue Oct 16, 2024
Merged via the queue into master with commit 871dc08 Oct 16, 2024
41 checks passed
@nklaassen nklaassen deleted the nklaassen/fix-iam-join branch October 16, 2024 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog Indicates that a PR does not require a changelog entry size/sm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants