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

[V4] Update signers to handle anonymous credentials #3691

Merged
merged 1 commit into from
Mar 6, 2025

Conversation

dscpinheiro
Copy link
Contributor

@dscpinheiro dscpinheiro commented Mar 6, 2025

Description

Reported in the V4 tracker (#3362 (comment)): If a customer's environment is set to assume a role with web identity, the request to STS doesn't include credentials but our SigV4 signer wasn't handling that properly after the SRA changes.

Testing

  • Dry-run: DRY_RUN-2ed08959-fb2c-4b95-a703-5ae52229c08f

I also ran the app Martin shared locally, forcing the AssumeRoleWithWebIdentityCredentials provider to run (by setting the AWS_WEB_IDENTITY_TOKEN_FILE environment variable), and confirmed the request was made to STS (instead of throwing a null pointer exception - it still failed because I don't have an OIDC on my account but it reached the service).

Before:

AmazonSecurityTokenServiceClient 33|2025-03-06T00:07:17.695Z|ERROR|NullReferenceException making request AssumeRoleWithWebIdentityRequest to https://sts.us-west-2.amazonaws.com/. Attempt 1. 
--> System.NullReferenceException: Object reference not set to an instance of an object.

After:

AmazonSecurityTokenServiceClient 43|2025-03-06T00:08:28.281Z|ERROR|Error calling AssumeRole for role arn:aws:iam::000000000000:role/ec2-role 
---> Amazon.Runtime.AmazonClientException: Error calling AssumeRole for role arn:aws:iam::000000000000:role/ec2-role
---> Amazon.SecurityToken.Model.InvalidIdentityTokenException: The ID Token provided is not a valid JWT. (You may see this error if you sent an Access Token)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

License

  • I confirm that this pull request can be released under the Apache 2 license

@dscpinheiro dscpinheiro added the v4 label Mar 6, 2025
@dscpinheiro dscpinheiro marked this pull request as ready for review March 6, 2025 02:57
@dscpinheiro dscpinheiro merged commit 1e44507 into v4-development Mar 6, 2025
3 checks passed
@dscpinheiro dscpinheiro deleted the dspin/fix-anonymous-creds branch March 6, 2025 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants