Home/Refreshers/Reviewing infrastructure as a defender: refresher
Reviewing infrastructure as a defender
What to look for in a pull request or a plan, so the next incident is caught in review.
Remember
- Who can become this role? Keep that list short.
- Does anything grant a permission that grants other permissions?
- What records misuse, and could the person misusing it switch that off?
- If this is deleted, what is lost, and can anyone restore it?
- Does the plan destroy or replace anything that contains data?
| Watch for | Why it matters |
|---|---|
| GitHub OIDC trust with no sub condition | Every repository on GitHub can assume the role |
| iam:PassRole on * | Any role can be handed to a service the grantee controls |
| roles/iam.serviceAccountTokenCreator | The grantee can mint tokens as that service account |
| Actions pinned by tag | A tag can be moved to other code. Pin by commit SHA |
| pull_request_target that checks out the pull request | A stranger's code runs with your secrets |
| Logging off, or retention shortened | The evidence is gone before anyone needs it |
Watch out
- Read the plan as well as the code. The code says what someone meant. The plan says what will happen.
Check it worked
Every finding in the review names the change needed and the team that owns it.