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

Add conditional endpoint resolver for AWS KMS #1509

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

euanhume
Copy link

Summary

This PR introduces a conditional check within the endpoint resolver to specifically target the AWS Key Management Service (KMS). Currently, when using Security Token Service (STS), an 'unknown command' error occurred due to the STS action being inadvertently directed to the KMS endpoint defined in the user's configuration. This update ensures that KMS requests are appropriately routed to the custom endpoint specified by the user, while STS and other AWS services continue to utilise their default endpoints.

Release Note

Bug fix for 1175

Documentation

N/A does not require a change to documentation.

Signed-off-by: Euan Hume <euanhume@gmail.com>
@haydentherapper
Copy link
Contributor

Thanks @euanhume! Have you been able to use this locally and confirm that it's working as expected?

@euanhume
Copy link
Author

Thanks for your reply @haydentherapper. I attempted to test via localstack yesterday but unfortunately I am struggling to re create the conditions of my environment - it seems the paid version is required to enable IAM.

For more information, I'm using an AWS VPC endpoint to connect to where my AWS KMS key resides for my awskms://[ENDPOINT]/ configuration in Rekor. Because this AWSClient is setting the endpoint for as the VPC endpoint for all AWS services, the STS AssumeRole operation is failing as the default endpoint for STS (https://sts.amazonaws.com) is overwritten by my VPC endpoint. I'd be grateful if you have suggestions on how I could progress this?

@haydentherapper
Copy link
Contributor

Could you rebuild Cosign locally with this change incorporated? I don't have any suggestions on how to set up AWS to test this out though.
The only thing I'm not sure about is the behavior of the client when returning aws.Endpoint{} without a URL set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants