fix(tflint): verify aws plugin via PGP to dodge tflint init panic#106
Closed
camrschuette wants to merge 1 commit into
Closed
fix(tflint): verify aws plugin via PGP to dodge tflint init panic#106camrschuette wants to merge 1 commit into
camrschuette wants to merge 1 commit into
Conversation
GitHub REST API 2026-03-10 removed the `bundle` field from attestation list responses. tflint's default `auto` signature mode prefers attestations, unmarshals the now-null bundle into a nil *bundle.Bundle without erroring, and panics dereferencing it inside sigstore verify. `tflint --init` crashes before any linting runs, failing the terraform_tflint hook in every consuming repo. Pinning the plugin to `signature = "pgp"` takes the legacy verification path instead. Verification stays enabled; tflint emits a deprecation warning about the legacy signing key. Pinning an older tflint does not help — the trigger is server-side and every version taking the attestation path panics. Upstream: terraform-linters/tflint#2591 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Author
|
Superseded by #107, which lands this same tflint fix together with the free-disk and trivy_scan_ref commits already running in stratusphere via the branch pin. Merging them as one retires that pin and clears the revert-to-main TODO in stratusphere's ci.yml. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every repo using
pre-commit.ymlis currently failingterraform_tflint. This is not a lint failure —tflint --initpanics installing the aws plugin, before any linting runs.Cause
Server-side, nothing in our repos changed. GitHub REST API version 2026-03-10 removed the
bundlefield from attestation list responses. tflint calls that endpoint to verify the plugin, and:"bundle": nullnullinto a**Bundle— this sets the pointer nil and returns no error, so its own nil guard atplugin/signature.go:133never firesverifier.Verify(b, policy)then calls a method on the nil receiver, and sigstore-go`s nil check dereferences it. Panic.A latent tflint bug that only fires once the server returns null. Upstream: terraform-linters/tflint#2591 — filed 2026-07-16, still open,
masterunpatched.Fix
signature = "pgp"takes the legacy PGP verification path instead of the defaultauto(which prefers attestations). Verification stays enabled. tflint emits a deprecation warning about the legacy signing key; the hook still passes.Alternatives ruled out:
signature = "none"— works but disables verification. Avoided; the PGP path works.Verification
Reproduced the exact CI panic locally with the current config, then confirmed the fix against a clean plugin dir on tflint v0.63.1 with an authenticated
GITHUB_TOKEN:Full CI rule set against a real
terraform/tree: exit 0, zero findings.v0.40.0release assets includechecksums.txt.sig, so the PGP path is valid for the pinned version.Note for reviewers
The
Checkout precommit configstep has noref:, so config is always read from this repos default branch — pinning the reusable workflow to a feature branch does not change which config CI uses. That is why this has to land onmainto take effect anywhere. Consuming repos can drop a local.tflint.hclas a stopgap (thecp -r -n` no-clobber makes it win); stratusphere has one, to be removed once this merges.🤖 Generated with Claude Code