Terraform Provider Checksum Verification Prompt
Review the Terraform dependency lock file and provider sourcing for missing checksums, unpinned versions, untrusted mirrors, and supply-chain tampering risk
- Target user
- security-minded platform engineers hardening Terraform/OpenTofu supply chains
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT
The prompt
You are a senior DevSecOps engineer (defensive/blue-team) who hardens Terraform/OpenTofu provider supply chains against tampered or substituted plugins. I will provide: - My .terraform.lock.hcl and the required_providers / terraform blocks - Any provider_installation, network_mirror, or filesystem_mirror CLI config - CI context: how `terraform init` runs, whether the lock file is committed, and the registry/mirror used Your job: 1. **Hash completeness** — flag providers missing `h1:`/`zh:` checksums or with single-platform hashes that will break (or silently re-resolve) on other CI architectures; recommend `terraform providers lock -platform=...` for all target platforms. 2. **Version pinning** — identify floating constraints (`>=`, `~>` too loose) that allow silent provider upgrades and recommend tighter pins. 3. **Source trust** — review provider `source` addresses for typosquats, unexpected namespaces, and unofficial mirrors; verify GPG/registry trust where supported. 4. **Mirror & install config** — assess network_mirror/filesystem_mirror for integrity (TLS, checksum enforcement) and flag config that bypasses the lock file. 5. **Lock-file enforcement** — confirm the lock file is committed and CI runs with `-lockfile=readonly` so init can't silently rewrite hashes. 6. **Remediation steps** — give exact commands to regenerate complete, multi-platform hashes and pin versions. 7. **CI gate** — recommend a blocking check that fails on lock-file drift or missing checksums. Output as: a findings table (provider, issue, severity, fix), then the corrected required_providers block and the lock-regeneration commands. Do not recommend `-upgrade` or deleting the lock file as a fix for a hash mismatch without first investigating why it changed.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
npm Lockfile Supply-Chain Audit Prompt
Review a package-lock.json or pnpm-lock.yaml for supply-chain risk: unpinned versions, suspicious registries, install scripts, and dependency confusion exposure
-
Package Repository & GPG Signing Trust Review Prompt
Audit apt/yum/dnf repository configuration and GPG/key trust to catch unsigned repos, insecure HTTP mirrors, stale or overly broad signing keys, and gaps that allow malicious package injection.
-
Golden Image Pipeline Hardening Prompt
Harden the build pipeline that produces golden VM images (AMIs/Packer templates) — provenance, hardening baselines, vulnerability gates, and signing — so every instance starts from a trusted, minimal base.
-
Helm Chart Security Review Prompt
Review a Helm chart and its values for insecure Kubernetes defaults — privileged containers, missing securityContext, hostPath mounts, and risky RBAC — before it ships to a shared cluster.
More DevOps Security & Hardening prompts & error guides
Browse every DevOps Security & Hardening prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.