Interview Prep/DevSecOps/Cloud Security Posture

How do you secure the Terraform delivery pipeline itself?

IntermediateProductionCloud Security Posture
Answer
  • Remote state in an encrypted, versioned bucket with access limited to the pipeline roles; state can hold secrets.
  • Separate roles: a read-only role for plan on PRs, a write role for apply that only the main-branch pipeline in a protected environment can assume (OIDC conditions).
  • Policy checks on the plan (Checkov, Trivy, OPA/conftest) before apply.
  • Manual approval for production applies; no humans applying from laptops.
  • Pin provider and module versions with the lock file; use a private module registry.
  • Scheduled terraform plan to detect drift.
All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Cloud Security Posture