Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cmd/devguard-scanner/scanner/discover.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"encoding/json"
"fmt"

"github.com/google/go-containerregistry/pkg/authn"
"github.com/google/go-containerregistry/pkg/name"
"github.com/google/go-containerregistry/pkg/v1/remote"
"github.com/pkg/errors"
Expand All @@ -34,7 +35,7 @@ type AttestationFileLine struct {
}

func fetchAttestationsForReference(ctx context.Context, ref name.Reference) ([]oci.Signature, error) {
desc, err := remote.Get(ref, remote.WithContext(ctx))
desc, err := remote.Get(ref, remote.WithContext(ctx), remote.WithAuthFromKeychain(authn.DefaultKeychain))
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Authentication is only added to the initial remote descriptor lookup. The subsequent attestation fetches via ociremote.Signatures are still configured with remote.WithContext(ctx) only, so private registries will likely still fail when pulling the attestation artifacts. Consider reusing a shared set of remote options (context + WithAuthFromKeychain(authn.DefaultKeychain)) and passing it both to remote.Get and to ociremote.WithRemoteOptions(...) in both branches.

Copilot uses AI. Check for mistakes.
if err != nil {
return nil, errors.Wrap(err, "failed to get remote descriptor")
}
Expand Down
Loading