Skip to content
This repository was archived by the owner on Jun 4, 2024. It is now read-only.

Refactor Drone Pipelines to use AWS role assumption#671

Merged
wadells merged 2 commits into
masterfrom
walt/drone-role-refactor
Oct 6, 2022
Merged

Refactor Drone Pipelines to use AWS role assumption#671
wadells merged 2 commits into
masterfrom
walt/drone-role-refactor

Conversation

@wadells
Copy link
Copy Markdown
Contributor

@wadells wadells commented Sep 29, 2022

Summary

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.

We created the roles needed in:

https://github.com/gravitational/cloud-terraform/pull/944
https://github.com/gravitational/cloud-terraform/pull/956

And added them to Drone in:

https://github.com/gravitational/ops/pull/432

This PR updates the automation to use the new roles, such that we can later remove the policies from the users.

Contributes to https://github.com/gravitational/SecOps/issues/213

Testing Done

See this comment below:

#671 (comment)

I also proved out the same logic in several less critical places:

Notes to the reviewer

This is largely rote. One linux pipline is like any other. The places to pay attention are:

  • the first linux pipeline (where the general pattern is established)
  • darwin pipelines, which aren't containerized and thus don't use volumes
  • pipelines that use multiple sets of credentials (e.g. promotion)

Lastly, I didn't change anything about the terraform promotion pipeline, as it already appears to be using a role, plumbed through some custom go code.

@wadells wadells changed the title wip Refactor Drone Pipelines to use AWS role assumption Sep 29, 2022
@wadells wadells requested a review from reedloden September 29, 2022 04:32
Comment thread .drone.yml
@wadells wadells force-pushed the walt/drone-role-refactor branch from d38c845 to 7470b8b Compare September 29, 2022 21:28
@wadells wadells marked this pull request as ready for review September 29, 2022 21:35
@wadells wadells force-pushed the walt/drone-role-refactor branch 2 times, most recently from edcc1a3 to 7261c99 Compare October 6, 2022 02:15
@wadells
Copy link
Copy Markdown
Contributor Author

wadells commented Oct 6, 2022

Update: With the new roles available (https://github.com/gravitational/ops/pull/432), I've completed testing both tag builds and promotion with the v11.0.0-dev-walt.6 tags, seen here:

Tag Builds:

Promotion:

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 to users to attaching policies to roles and
having permissionless users assume those roles.

https://aws.amazon.com/partners/foundational-technical-review/

We created the roles needed in:

  https://github.com/gravitational/cloud-terraform/pull/944
  https://github.com/gravitational/cloud-terraform/pull/956

This PR updates the automation to use these roles, such that we can
later remove the policies from the users.

Contributes to https://github.com/gravitational/SecOps/issues/213
This is unneeded, since these steps are already in a helm specific
pipeline.  This naming was a hold over from the oldest teleport
promotion pipelines, where multiple different artifacts were promoted in
the same pipeline.
@wadells wadells force-pushed the walt/drone-role-refactor branch from 7261c99 to 32874dc Compare October 6, 2022 03:21
@wadells wadells merged commit e158e73 into master Oct 6, 2022
wadells added a commit that referenced this pull request Oct 6, 2022
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 to users to attaching policies to roles and
having permissionless users assume those roles.

https://aws.amazon.com/partners/foundational-technical-review/

We created the roles needed in:

  https://github.com/gravitational/cloud-terraform/pull/944
  https://github.com/gravitational/cloud-terraform/pull/956

This PR updates the automation to use these roles, such that we can
later remove the policies from the users.

Contributes to https://github.com/gravitational/SecOps/issues/213
@wadells wadells deleted the walt/drone-role-refactor branch October 6, 2022 15:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants