Case 664625 · Cloud · L2 Practitioner
Securing Infrastructure as Code
- 01 Context
- 02 Mechanism
- 03 Lessons
What a strong answer covers
Try it out loud first. Then check yourself:
- Terraform, CloudFormation and Bicep make cloud config reviewable code, so misconfigs can be caught before deploy
- Scan plans in CI (Checkov, Trivy) and enforce policy as code (OPA, Sentinel) for public storage, open ports, no encryption
- Terraform state holds resource attributes, secrets included, in plaintext: use an encrypted, locked-down remote backend
- The deploy identity is near-admin: use OIDC not static keys, require approval on apply, protect pipeline files
- Drift: console changes bypass review, so detect drift and back scanners with runtime guardrails like SCPs or Azure Policy
If the interviewer pushes back
- A developer can edit the pipeline file in a PR. What can they do with the apply role, and how do you stop it?