Refactor Drone Pipelines to use AWS role assumption#17201
Merged
Conversation
3aa848c to
d6aabd7
Compare
d6aabd7 to
d9d5148
Compare
d9d5148 to
1e155d3
Compare
fheinecke
reviewed
Oct 10, 2022
justinas
reviewed
Oct 10, 2022
wadells
added a commit
that referenced
this pull request
Oct 10, 2022
reedloden
approved these changes
Oct 10, 2022
r0mant
approved these changes
Oct 10, 2022
wadells
added a commit
that referenced
this pull request
Oct 10, 2022
Backports #17201 Contributes to gravitational/SecOps#213
wadells
added a commit
that referenced
this pull request
Oct 10, 2022
reedloden
pushed a commit
that referenced
this pull request
Oct 11, 2022
* Flip the order of the quay and ecr pipelines These are reversed in master/v11 (ecr first, and then quay) and having the order consistent across branches will make future ports easier. * Add AWS roles to Drone pipelines Backports #17201 Contributes to gravitational/SecOps#213
This was referenced Oct 11, 2022
wadells
added a commit
that referenced
this pull request
Oct 11, 2022
This is follow up to #17201, that fixes the buildbox pipeline error seen here: An error occurred (AccessDeniedException) when calling the GetAuthorizationToken operation: User: arn:aws:iam::146628656107:user/teleport_build_user_read_only is not authorized to perform: ecr-public:GetAuthorizationToken on resource: * because no identity-based policy allows the ecr-public:GetAuthorizationToken action Contributes to gravitational/SecOps#213.
wadells
added a commit
that referenced
this pull request
Oct 13, 2022
This is follow up to #17201, that fixes the buildbox pipeline error seen here: An error occurred (AccessDeniedException) when calling the GetAuthorizationToken operation: User: arn:aws:iam::146628656107:user/teleport_build_user_read_only is not authorized to perform: ecr-public:GetAuthorizationToken on resource: * because no identity-based policy allows the ecr-public:GetAuthorizationToken action
wadells
added a commit
that referenced
this pull request
Oct 13, 2022
This is follow up to #17201, that fixes the buildbox pipeline error seen here: An error occurred (AccessDeniedException) when calling the GetAuthorizationToken operation: User: arn:aws:iam::146628656107:user/teleport_build_user_read_only is not authorized to perform: ecr-public:GetAuthorizationToken on resource: * because no identity-based policy allows the ecr-public:GetAuthorizationToken action
wadells
added a commit
that referenced
this pull request
Oct 13, 2022
This is follow up to #17201, that fixes the buildbox pipeline error seen here: An error occurred (AccessDeniedException) when calling the GetAuthorizationToken operation: User: arn:aws:iam::146628656107:user/teleport_build_user_read_only is not authorized to perform: ecr-public:GetAuthorizationToken on resource: * because no identity-based policy allows the ecr-public:GetAuthorizationToken action
This was referenced Oct 13, 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.
This PR updates our various Drone pipelines to use AWS roles for publishing.
Our AWS FTR requires that we do not use any long lived credentials in our AWS accounts and instead use roles. This means we need to move from attaching policies directly to users to attaching policies to roles and having policyless users assume those roles.
Related Issues & PRs
We created the roles needed in:
And added them to Drone in:
This PR updates the automation to use the new roles, such that we can remove the policies from the users:
Backports:
The corresponding
teleport-pluginsPR is:Contributes to https://github.com/gravitational/SecOps/issues/213
Reviewing
This is a large PR, however the changes are divided into small chunks for easier review.
Because this is a cross cutting change that touches on the past work of many different contributors, I've added your name after a commit if it touches code related to your work -- I'd appreciate it if you'd review at least these parts. Though you're welcome to review more.
Part One - This section includes all drongen changes. The important thing to review here is the drongen go code.
Part Two - This section includes all pipelines that aren't managed by dronegen, and were hand edited. The .drone.yml itself should be reviewed here.
Testing
All tag build changes were tested via
v12.0.0-dev.walt.3here:https://drone.platform.teleport.sh/gravitational/teleport/16273
Most promotion changes were tested off that same tag here:
https://drone.platform.teleport.sh/gravitational/teleport/16277
What wasn't tested from the promote?
All the testing above was performed with all the changes in this branch plus:
make versionupdate commitsSee the following for the diff between what was tested and what is in this branch: walt/role-assumption...walt/role-assumption-test
Notes
I chose to perform role assumption in a different step than the role is used in. This is a bit more verbose, but it is a reasonable simulacra of how we'll handle creds eventually in GitHub actions. Furthermore, it prevents the code using AWS credentials from ever having access to the long lived creds -- it'll only ever see the short lived role sessions. So if someone were to exfiltrate creds with anything short of
drone signed code, they'll only get a short lived session.plugins/s3has been entirely removed, as it didn't seem compatible with pre-assumed roles.