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 →
- Commit the lock file;
initverifies checksums, and the registry's signing keys are verified for HashiCorp-signed providers. - Pin module versions or Git commit SHAs rather than branches.
- Use an internal mirror and allowlist namespaces.
- 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.
More on Secrets Provisioners and Policy as Code
A developer hardcodes a DB password in `terraform.tfvars` and commits it. What do you do right now, and what's the long-term fix?BeginnerHow do you avoid Terraform persisting a secret in state when creating a secret in AWS Secrets Manager?AdvancedSomeone wants a `remote-exec` provisioner to configure servers after creation. What's your advice?BeginnerYou must run a one-off command after a resource is created, such as registering with an external system.IntermediateHow do you generate and manage the master password for a new RDS instance?IntermediateCompare Sentinel, OPA/Conftest and Checkov for policy as code.Intermediate