Nodes use FIPS STS endpoints for IAM join method when in FIPS mode#16123
Merged
Nodes use FIPS STS endpoints for IAM join method when in FIPS mode#16123
Conversation
strideynet
approved these changes
Sep 5, 2022
Contributor
Author
|
friendly ping @lxea |
lxea
approved these changes
Sep 12, 2022
Contributor
|
@nklaassen See the table below for backport results.
|
nklaassen
added a commit
that referenced
this pull request
Sep 13, 2022
nklaassen
added a commit
that referenced
this pull request
Sep 13, 2022
nklaassen
added a commit
that referenced
this pull request
Sep 14, 2022
nklaassen
added a commit
that referenced
this pull request
Sep 14, 2022
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.
When nodes join a Teleport cluster using the IAM join method, they generate a signed
sts:GetCallerIdentityrequest and send it to the Teleport auth server, which finally sends the signed request to the actual AWS endpoint which will return the verified identity of the node.The exact AWS endpoint is necessarily part of the signed request, and must be selected on the client. Since #15337, nodes will attempt to use the regional STS endpoint of their local AWS region, such as
https://sts.us-west-2.amazonaws.com. Before that change, nodes would always use the global endpointhttps://sts.amazonaws.com.The STS service has 4 specific FIPS endpoints
sts-fips.us-east-1.amazonaws.com,sts-fips.us-east-2.amazonaws.com,sts-fips.us-west-1.amazonaws.com, andsts-fips.us-west-2.amazonaws.com. We should use these endpoints when in FIPS mode, but until now we have not done so (I didn't realize there were separate FIPS endpoints until recently.)With this change, nodes running in FIPS mode will select a FIPS endpoint. If they are running in a region with a local FIPS endpoint, that will be used, otherwise the
us-east-1FIPS endpoint will be used.All GovCloud STS endpoints are already FIPS compliant.
As far as I can tell, there are no FIPS endpoints for the AWS China partition, so we cannot support FIPS mode with the IAM join method in China.
In a following PR #16124, the auth server will enforce that FIPS endpoints are always used. This could break cross-version compat between minor versions, so it is being split into a separate PR and will not be backported.
I wanted to write a test for a PR, but all of the interesting logic is in configuring the AWS SDK to generate the right endpoint, and the SDK relies on having AWS credentials. If we mocked out the SDK, all we could really test would be the mock. Let me know if you see a decent/useful way to test this.
I manually tested this change in a region with a local FIPS endpoint (
us-west-2), without a local FIPS endpoint (ca-central-1), and in GovCloud (us-gov-west-1).re: #15927