devops329 / devops

BYU CS 329: QA & DevOps
MIT License
5 stars 18 forks source link

Harden github-ci IAM rights (tested) #94

Closed frozenfrank closed 3 weeks ago

frozenfrank commented 3 weeks ago

Overview

The original version of these rules demonstrated a really loose * wildcard ECR permission.

Discussion

This changes splits the related ECR permissions into two statements:

  1. Grants the permission to authenticate with the platform. This must be granted at the account level rather than a specific repository level.
  2. Grants permission to perform the based read/write operations required to efficiently batch update an image. These permissions are only granted for the jwt-pizza-service repository in the individuals' account.

You may prefer to have a bad-practice wildcard in the instructions for the purposes of demonstration, but this PR introduces tested, hardened IAM rights for the github-ci role. It doesn't go crazy deep, but it does restrict the permissions to just the things that are needed.

If you don't want to merge this in, then I'll just count this as an exercise in curiosity and take the blessings for figuring out how to do it :)