diff --git a/pkg/cmd/attestation/verify/verify.go b/pkg/cmd/attestation/verify/verify.go index 014ffdbe0..7107cd93b 100644 --- a/pkg/cmd/attestation/verify/verify.go +++ b/pkg/cmd/attestation/verify/verify.go @@ -246,16 +246,12 @@ func runVerify(opts *Options) error { } // Apply predicate type filter to returned attestations - if opts.PredicateType != "" { - filteredAttestations := verification.FilterAttestations(opts.PredicateType, attestations) - - if len(filteredAttestations) == 0 { - opts.Logger.Printf(opts.Logger.ColorScheme.Red("✗ No attestations found with predicate type: %s\n"), opts.PredicateType) - return err - } - - attestations = filteredAttestations + filteredAttestations := verification.FilterAttestations(opts.PredicateType, attestations) + if len(filteredAttestations) == 0 { + opts.Logger.Printf(opts.Logger.ColorScheme.Red("✗ No attestations found with predicate type: %s\n"), opts.PredicateType) + return err } + attestations = filteredAttestations policy, err := buildVerifyPolicy(opts, *artifact) if err != nil { @@ -263,6 +259,8 @@ func runVerify(opts *Options) error { return err } + opts.Logger.VerbosePrintf("Verifying attestations with the predicate type %s\n", opts.PredicateType) + sigstoreRes := opts.SigstoreVerifier.Verify(attestations, policy) if sigstoreRes.Error != nil { opts.Logger.Println(opts.Logger.ColorScheme.Red("✗ Verification failed"))