Skip to content

Commit

Permalink
[release-v0.11] Automated cherry pick of #54: Fix mitigation for NoMa…
Browse files Browse the repository at this point in the history
…tchingSignature error (#58)

* Fix mitigation for NoMatchingSignature error

The check introduced with #28 did not work

Co-authored-by: vpnachev <vladimir.nachev@sap.com>
Co-authored-by: ialidzhikov <i.alidjikov@gmail.com>

* Add additional log msg as per review

---------

Co-authored-by: Dimitar Mirchev <dimitar.mirchev@sap.com>
Co-authored-by: ialidzhikov <i.alidjikov@gmail.com>
  • Loading branch information
3 people authored Dec 8, 2023
1 parent ea9cb36 commit 3ab4c6c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/lakom/verifysignature/verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,10 @@ func verify(ctx context.Context, imageRef name.Reference, keys []crypto.PublicKe
}

if IsNoMatchingSignature(err) {
if errors.Is(err, context.Canceled) {
if errors.Is(ctx.Err(), context.Canceled) || errors.Is(ctx.Err(), context.DeadlineExceeded) {
// Mitigation for https://github.com/gardener/gardener-extension-shoot-lakom-service/issues/25
// TODO(vpnachev): remove when https://github.com/sigstore/cosign/issues/3133 is fixed and vendored
log.Info("no matching signatures error detected as canceled or deadline exceeded context", "error", err)
return false, err
}

Expand Down

0 comments on commit 3ab4c6c

Please sign in to comment.