-
Notifications
You must be signed in to change notification settings - Fork 11
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
pathogen-repo-build: Support assuming an AWS role via GitHub Actions' OIDC provider #53
Conversation
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.
The changes here look reasonable to me!
My main questions are about the permissions and management of the GitHubActionsRoleNextstrainBatchJobs
role.
The default role has a pretty limited set of permissions right now: basically only those required to submit and interact with AWS Batch jobs, but not, for example, permissions to upload to our production S3 buckets.
Is the plan to manage upload permissions with another AWS Batch job role (as you mentioned previously). So the temp credentials here will allow the deployment and running of the Batch job, but permissions for AWS interactions within the build runtime will be managed by a separate role.
The role's trust policy will also need to be extended to allow other repos to assume it.
Is the plan to maintain a list of allowed repos in the role's trust policy and we would add repos to it as we add more pathogen workflows?
moved to https://github.com/nextstrain/private/issues/96
Unclear right now. A few options I see:
I'd probably allow all existing pathogen repos initially, even if they're not using role assumption right now, and then yeah, add more as we need. I'd think of this as "enabling" a repo to use our AWS Batch infra. |
moved to https://github.com/nextstrain/private/issues/95 To choose amongst options, I'd think to consider:
Option 1 is tempting because it's ~transparent to pathogen builds and easy. But it maybe runs into session lifetime issues if we're passing those assumed temporary credentials into the Batch job. Options 3 and 4 are tempting because they're also ~transparent and easy and won't run into session lifetime issues. However, it means being ok allowing everyone in the lab who can submit jobs to make all the changes our automated builds need to do. |
… OIDC provider The default role has a pretty limited set of permissions right now: basically only those required to submit and interact with AWS Batch jobs, but not, for example, permissions to upload to our production S3 buckets. The permissions will probably need to be extended in the future as repos/builds opt into this workflow and this role assumption. The role's trust policy will also need to be extended to allow other repos to assume it. While the role is currently manually managed, it should really be managed by a Terraform configuration (but maybe one separate from the current nextstrain.org Terraform configurations?). Related-to: <nextstrain/private#22>
4e26422
to
fbff47b
Compare
This PR shouldn't have any functional change for our current usage, as I believe all callers provide explicit credentials themselves so the new role won't be assumed. As such, I'm inclined to merge it sooner than later to not leave it dangling. Further work to come will extend the role's permissions (or otherwise provide for additional permissions) and ensure they're passed in one way or another to the runtime. |
Will be part of nextstrain/infra@main...dev. |
See also <nextstrain/.github#53>. Policies in Terraform to come.
The default role has a pretty limited set of permissions right now: basically only those required to submit and interact with AWS Batch jobs, but not, for example, permissions to upload to our production S3 buckets. The permissions will probably need to be extended in the future as repos/builds opt into this workflow and this role assumption. The role's trust policy will also need to be extended to allow other repos to assume it.
While the role is currently manually managed, it should really be managed by a Terraform configuration (but one separate from the current nextstrain.org Terraform configurations).
Related-to: https://github.com/nextstrain/private/issues/22
Checklist