rancher-sandbox / rancher-desktop

Container Management and Kubernetes on the Desktop
https://rancherdesktop.io
Apache License 2.0
5.84k stars 272 forks source link

Image Scanning does not work #6956

Closed mook-as closed 3 months ago

mook-as commented 3 months ago

Actual Behavior

Attempting to scan any image, with either moby or containerd backend, produces an error:

image

[Window Title]
Rancher Desktop
[Content]
Error trying to scan rancher/klipper-lb:v0.4.7:
[OK]

There are no useful logs in images.log.

Steps to Reproduce

  1. Start Rancher Desktop, with either backend.
  2. Go to the Images page.
  3. Select any image (k3s images are fine)
  4. Select the menu on the right side (⋮) and click on Scan…
  5. Wait for the scan to finish.

Result

The scan never completes; a Windows dialog box pops up with an error message, but not enough details to determine why the scan failed.

Expected Behavior

Successful scan (possibly with vulnerabilities).

Additional Information

This doesn't fail in the same way on mac.

With extra logging hacked in, I see:

2024-05-28T15:03:34.401-0700    FATAL   init error: DB error: failed to download vulnerability DB: database download error: OCI repository error: 1 error occurred:
        * error getting credentials - err: exit status 28, out: ``

Rancher Desktop Version

1.13.1-521-g9abed793

Rancher Desktop K8s Version

1.29.5

Which container engine are you using?

containerd (nerdctl)

What operating system are you using?

Windows

Operating System / Build Version

Windows 11 Pro 23H2 (Build 22631.3593)

What CPU architecture are you using?

x64

Linux only: what package format did you use to install Rancher Desktop?

None

Windows User Only

No response

mook-as commented 3 months ago

Running trivy manually in the distribution gets:

# trivy image --format json busybox:latest
2024-05-28T18:16:02-04:00       INFO    Need to update DB
2024-05-28T18:16:02-04:00       INFO    Downloading DB...       repository="ghcr.io/aquasecurity/trivy-db:2"
2024-05-28T18:18:13-04:00       FATAL   Fatal error     init error: DB error: failed to download vulnerability DB: database download error: OCI repository error: 1 error occurred:
        * error getting credentials - err: exit status 28, out: ``
mook-as commented 3 months ago

Running trivy manually in rdctl shell succeeds.

We must be running trivy from the wrong (network) namespace.