Run this quarterly, and additionally after any credential exposure, any change to the CI credential path, and any change to who can read the state backend. Run it from a clean checkout of the default branch.
The organising question is not “is the secret encrypted”. It is: a Terraform apply can put a secret in five places — the configuration, the variable values, the plan file, the state file, and the job log of the runner — and for each one, does the plaintext exist there, and who can read it? The items below walk those five, then the identity that reaches them, then rotation. The page groups them by severity rather than by that sequence, so read the group headings as “how bad”, not as “in what order”.
What a failure means
There are two shapes of finding here and they need different responses.
A finding in the working tree — a literal in HCL, a missing sensitive flag, a
secret-shaped default — is a defect. Fix it, and the exposure was hypothetical.
A finding in the Git history, the job log, a published artifact or the state
file is an exposure. The value has already been written somewhere it should not
be. Cleaning up the file does not undo that: rotate the credential first and
treat the cleanup as secondary. This is why exposure-means-rotation is a
critical item with no command — it is a decision, not a check.
Access this needs
The repository items need a checkout only. The plan canary needs whatever credentials a plan needs in that workspace. The backend, IAM and CloudTrail items need read access in the account that owns the state bucket. Nothing here writes anything, and the commands are written to print findings rather than values.
Substitute the bucket, key, role and user names at the top of each command before running it; the placeholders match the naming used in the course lessons, not your estate.
Where the evidence goes
Record the findings, the owner and the agreed date in whatever register the organisation uses for security findings, not in the repository. The three items with no command — the exposure decision, the consumer-side rotation reconciliation, and the record itself — need the name of the person who attested them, because those are the ones a command cannot answer.
Sign-off
- Reviewer: ________________ Date: ___________
- Platform owner: ___________ Date: ___________
- Security owner: ___________ Date: ___________