-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
cloud: support chaining of assumed roles #83712
Merged
Merged
Conversation
This file contains 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
rhu713
force-pushed
the
role-chaining
branch
11 times, most recently
from
July 5, 2022 20:07
7dbff55
to
f7c0a41
Compare
adityamaru
suggested changes
Jul 12, 2022
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.
Mostly LGTM! Just a few nits and a question about testing IMPLICT + chaining everywhere. Thanks for adding the AWS tests to the nightly as well 🙌
Previously, a user could only assume a role in AWS or GCP directly, via the identity specified by implicit or specified auth. This was inadequate because there is a need to support role assumption through a chain of intermediate delegate roles. To address this, this patch allows the ASSUME_ROLE parameter in AWS and GCP storage and KMS URIs to specify a list of roles with a comma-separated string. The roles in the list can then be chain assumed in order to access the resource specified by the URI. With this patch, if a destination in S3 can only be accessed by RoleB, and the identity corresponding to implicit auth can only assume RoleB through an intermediate role RoleA, then this chain assumption can be specified in the S3 URI: s3://bucket/key?AUTH=implicit&ASSUME_ROLE=RoleA,RoleB In addition, the parameters for auth in AWS URIs via assume role have been changed so that the "assume" auth mode no longer exists, and the ASSUME_ROLE param can be specified for both "specified" and "implicit" auth. Finally, some AWS cloud unit tests, including the assume role tests, have been added to the unit test nightly. Release note (enterprise change): Allow the ASSUME_ROLE parameter in AWS and GCP storage and KMS URIs to specify a list of roles with a comma-separated string. The roles in the list can then be chain assumed in order to access the resource specified by the URI. For example, if a destination in S3 can only be accessed by RoleB, and the identity corresponding to implicit auth can only assume RoleB through an intermediate role RoleA, then this chain assumption can be specified in the S3 URI: s3://bucket/key?AUTH=implicit&ASSUME_ROLE=RoleA,RoleB In addition, remove the "assume" auth mode from AWS URIs, and instead use the ASSUME_ROLE parameter to indicate that a role should be assumed for authentication. Below are some examples: S3: s3://<bucket>/<key>?AUTH=specified&ASSUME_ROLE=<role_arn>&AWS_ACCESS_KEY_ID=<access_key>&AWS_SECRET_ACCESS_KEY=<secret_key> AWS KMS: aws:///<key_arn>?AUTH=implicit®ION=<region>&ASSUME_ROLE=<role_arn>
adityamaru
approved these changes
Jul 15, 2022
bors r+ |
Build failed: |
bors retry |
Build failed (retrying...): |
Build failed (retrying...): |
Build succeeded: |
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.
Previously, a user could only assume a role in AWS or GCP directly, via the
identity specified by implicit or specified auth. This was inadequate because
there is a need to support role assumption through a chain of intermediate
delegate roles. To address this, this patch allows the ASSUME_ROLE parameter
in AWS and GCP storage and KMS URIs to specify a list of roles with a
comma-separated string. The roles in the list can then be chain assumed in
order to access the resource specified by the URI.
With this patch, if a destination in S3 can only be accessed by RoleB, and the
identity corresponding to implicit auth can only assume RoleB through an
intermediate role RoleA, then this chain assumption can be specified in the S3
URI:
s3://bucket/key?AUTH=implicit&ASSUME_ROLE=RoleA,RoleB
In addition, the parameters for auth in AWS URIs via assume role have been
changed so that the "assume" auth mode no longer exists, and the ASSUME_ROLE
param can be specified for both "specified" and "implicit" auth.
Finally, some AWS cloud unit tests, including the assume role tests, have been
added to the unit test nightly.
Release note (enterprise change): Allow the ASSUME_ROLE parameter in AWS and
GCP storage and KMS URIs to specify a list of roles with a comma-separated
string. The roles in the list can then be chain assumed in order to access the
resource specified by the URI.
For example, if a destination in S3 can only be accessed by RoleB, and the
identity corresponding to implicit auth can only assume RoleB through an
intermediate role RoleA, then this chain assumption can be specified in the S3
URI:
s3://bucket/key?AUTH=implicit&ASSUME_ROLE=RoleA,RoleB
In addition, remove the "assume" auth mode from AWS URIs, and instead use the
ASSUME_ROLE parameter to indicate that a role should be assumed for
authentication. Below are some examples:
S3: s3:///?AUTH=specified&ASSUME_ROLE=<role_arn>&AWS_ACCESS_KEY_ID=<access_key>&AWS_SECRET_ACCESS_KEY=<secret_key>
AWS KMS: aws:///<key_arn>?AUTH=implicit®ION=&ASSUME_ROLE=<role_arn>
Addresses #81453