Interview Prep/Terraform/Secrets Provisioners and Policy as Code

How do you verify that third-party providers and modules haven't been tampered with?

AdvancedScenarioSecrets Provisioners and Policy as Code
Answer

Situation read → Supply-chain risk: providers run with your cloud credentials.

What I'd do →

  1. Commit the lock file; init verifies checksums, and the registry's signing keys are verified for HashiCorp-signed providers.
  2. Pin module versions or Git commit SHAs rather than branches.
  3. Use an internal mirror and allowlist namespaces.
  4. Review upgrades with a plan and read release notes.

Why → Pinned, verified, mirrored dependencies reduce what can change without review.

Interview tip → Pin Git modules by tag or SHA, not by branch.

All Terraform questions

More on Secrets Provisioners and Policy as Code