-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
AWS auth login with multi region STS support #21960
AWS auth login with multi region STS support #21960
Conversation
CI Results: |
@@ -625,6 +627,58 @@ func TestBackend_defaultAliasMetadata(t *testing.T) { | |||
} | |||
} | |||
|
|||
func TestRegionFromHeader(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 👍
// https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-auth-using-authorization-header.html | ||
// The Authorization header takes the following form. | ||
// Authorization: AWS4-HMAC-SHA256 | ||
// Credential=AKIAIOSFODNN7EXAMPLE/20230719/us-east-1/sts/aws4_request, | ||
// SignedHeaders=content-length;content-type;host;x-amz-date, | ||
// Signature=fe5f80f77d5fa3beca038a248ff027d0445342fe2855ddc963176630326f1024 | ||
// | ||
// The credential is in the form of "<your-access-key-id>/<date>/<aws-region>/<aws-service>/aws4_request" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this comment is helpful!
Build Results: |
changelog/21960.txt
Outdated
@@ -0,0 +1,3 @@ | |||
```release-note:improvement | |||
aws/auth: Adds a new config field `sts_region_from_client` which allows for using dynamic regional sts endpoints based on Authorization header when using IAM-based authentication.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aws/auth: Adds a new config field `sts_region_from_client` which allows for using dynamic regional sts endpoints based on Authorization header when using IAM-based authentication.. | |
aws/auth: Adds a new config field `sts_region_from_client` which allows for using dynamic regional sts endpoints based on Authorization header when using IAM-based authentication. |
Double dots?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the parameter rename. This is a really elegant solution, nice work.
Summary
Adds support to the AWS auth plugin so that when the
use_sts_region_from_client
configuration is set, the global STS endpoint (https://sts.amazonaws.com) will be overridden to instead use the regional STS endpoints based on the region provided in theAuthorization
header.This change allows for DR situations and AWS regional outages by supporting flexibility in where the login region is calling from.
Without this change, clients would run into an error message when logging in if there were a region mismatch between client and server:
Testing
For the server side, I've configured the AWS auth plugin with the
use_sts_region_from_client
config set totrue
.For the client side, I've tested the login command using a bunch of different regions,
auto
region, and no region specified . Responses omitted for brevity.