hashicorp/packer · error
verify signed attestation: %w
Error message
verify signed attestation: %w
What it means
After signing, writeAttestation immediately verifies the envelope with internalattestation.VerifyEnvelope to guarantee the signature is internally consistent before writing anything. A verification failure is wrapped as `verify signed attestation: %w`. This almost always indicates a mismatched signer/verifier pair or a tampered/buggy bundle rather than user config.
Source
Thrown at post-processor/provenance/post-processor.go:328
bundlePath := sigstoreBundleOutputPath(outputPath)
bundleJSON := []byte(nil)
var envelope internalattestation.Envelope
if backendConfig.Mode == internalattestation.SigningModeKeyless {
envelope, bundleJSON, err = buildSigstoreBundleForSigner(ctx, signer, backendConfig, internalattestation.InTotoPayloadType, payload)
if err != nil {
return fmt.Errorf("sign attestation with Sigstore bundle: %w", err)
}
} else {
signature, signErr := signer.Sign(ctx, internalattestation.InTotoPayloadType, payload)
if signErr != nil {
return fmt.Errorf("sign attestation: %w", signErr)
}
envelope = internalattestation.NewEnvelope(internalattestation.InTotoPayloadType, payload, signature)
}
if err := internalattestation.VerifyEnvelope(ctx, envelope, verifier); err != nil {
return fmt.Errorf("verify signed attestation: %w", err)
}
output, err := json.MarshalIndent(envelope, "", " ")
if err != nil {
return fmt.Errorf("marshal signed envelope: %w", err)
}
if err := atomicWriteFile(outputPath, output, 0664); err != nil {
return fmt.Errorf("write attestation %q: %w", outputPath, err)
}
if len(bundleJSON) > 0 {
if err := atomicWriteFile(bundlePath, bundleJSON, 0664); err != nil {
return fmt.Errorf("write Sigstore bundle %q: %w", bundlePath, err)
}
ui.Say(fmt.Sprintf("Wrote Sigstore bundle to %s", bundlePath))
}
View on GitHub (pinned to eb36e3c3e4)
Solutions
- Check system clock accuracy (NTP) — keyless certs are time-sensitive.
- Ensure the Fulcio/Rekor URLs used for signing match those used for verification (custom instance configuration).
- Confirm the verifier's public key matches the signing key.
- Upgrade/downgrade the sigstore libraries or file an issue if it persists with consistent configuration.
Defensive patterns
Strategy: fallback
Validate before calling
// sync clock and match signing/verification endpoints before the build
if drift, _ := checkNTPDrift(); drift > 2*time.Minute { return errors.New("fix clock skew") }
if cfg.FulcioURL != "" && cfg.FulcioURL != verifierFulcioURL { return errors.New("fulcio URL mismatch") } Try / catch
if err := pp.PostProcess(ctx, ui, artifact); err != nil {
if strings.Contains(err.Error(), "verify signed attestation") {
// keep the unsigned statement as a fallback artifact and alert
}
} Prevention
- Run NTP on build hosts (keyless certs are time-bound).
- Use the same Fulcio/Rekor URLs for signing and verification.
- Pin sigstore library versions across the toolchain.
- Rotate keys before expiry and verify sign->verify round-trips in CI.
When it happens
Trigger: The verifier configured (or derived from the signer's public key) does not match the signing key; the Sigstore bundle's certificate chain doesn't validate against expected roots (Fulcio root/Rekor transparency log mismatch, clock skew outside cert validity).
Common situations: Sign-time clock skew making keyless certificates appear expired; using a custom Fulcio/Rekor instance while verification checks public sigstore roots; plugin bug after upgrading sigstore libraries.
Related errors
- sign attestation with Sigstore bundle: %w
- signing_mode %q does not support Sigstore bundle emission
- sign payload with keyless signer: %w
- verify Sigstore bundle %q: %w
- sign attestation: %w
AI-assisted analysis of hashicorp/packer@eb36e3c3e4 (2026-09-05).
Data as JSON: /api/errors/cc07b35fc1ec0e1b.
Report an issue: GitHub.