Replies: 1 comment
-
It's not a bug. It's intended. If you think it should try another registry with unexpected errors, it should be an idea. trivy/docs/docs/configuration/db.md Line 65 in 511b7d3 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
Well sometimes, Trivy will not try to download artifact from another repository.... but sometimes it will - my guess is that not all responses are handled and therefore it exits with 1.
The same can be seen if I use GCR or GHCR as the first optionl, occasionally they give a different response which is not handled and trivy will not try 2nd link at all.
I'm using your official docker image and scanning my own image as part of a gitlab job.
Desired Behavior
if 1st link fails, always go to 2nd no matter the error we're getting, and if 2nd fails go to 3rd... etc.
eg i want it to work like this always:
$ trivy image --download-db-only --no-progress
2024-11-22T15:00:02Z INFO [vulndb] Need to update DB
2024-11-22T15:00:02Z INFO [vulndb] Downloading vulnerability DB...
2024-11-22T15:00:02Z INFO [vulndb] Downloading artifact... repo="ghcr.io/aquasecurity/trivy-db:2"
2024-11-22T15:00:04Z ERROR [vulndb] Failed to download artifact repo="ghcr.io/aquasecurity/trivy-db:2" err="oci download error: failed to fetch the layer: GET https://ghcr.io/v2/aquasecurity/trivy-db/blobs/sha[25](https://gitlab.rosetta.ericssondevops.com/sa-bnew-rdidc/RDI_data_router/-/jobs/21461384#L25)6:dca99f86925c7374fe3ca54553b43f984a153acb4911353afd1dff63b32178bb: TOOMANYREQUESTS: retry-after: 1.008957ms, allowed: 44000/minute"
2024-11-22T15:00:04Z INFO [vulndb] Trying to download artifact from other repository...
2024-11-22T15:00:04Z INFO [vulndb] Downloading artifact... repo="public.ecr.aws/aquasecurity/trivy-db:2"
2024-11-22T15:00:10Z INFO [vulndb] Artifact successfully downloaded repo="public.ecr.aws/aquasecurity/trivy-db:2"
Actual Behavior
Download fails on the first link without trying another registry.
Reproduction Steps
Target
Container Image
Scanner
Vulnerability
Output Format
None
Mode
Standalone
Debug Output
.
Operating System
linux
Version
Checklist
trivy clean --all
Beta Was this translation helpful? Give feedback.
All reactions