Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support registry mirrors for image scanning #7966

Open
itaysk opened this issue Nov 20, 2024 Discussed in #4957 · 0 comments
Open

support registry mirrors for image scanning #7966

itaysk opened this issue Nov 20, 2024 Discussed in #4957 · 0 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature. target/container-image Issues relating to container image scanning

Comments

@itaysk
Copy link
Contributor

itaysk commented Nov 20, 2024

Discussed in #4957

When scanning images, Trivy is pulling the container image from registry directly (using OCI API). Most container engines support "mirroring", which tells the engine to pull certain images from another registry instead of the user specified.
Example from Docker: https://docs.docker.com/docker-hub/mirror/#configure-the-docker-daemon

Trivy should support similar functionality for pulling images from a mirror if configured. Since mirror configuration varies between engines, we should not support one of the existing ones but allow users to configure specifically for Trivy.

As @caleb-devops suggested:

registry-mirrors:
  - src: "docker.io"
    dest: "harbor.example.com/docker.io"
  - src: "ghcr.io"
    dest: "harbor.example.com/ghcr.io"

it could be supported on cli as --registry-mirrors docker.io:harbor.example.com/docker.io, but since this is advanced use case it might be ok to keep it config file exclusive.

@itaysk itaysk added the kind/feature Categorizes issue or PR as related to a new feature. label Nov 20, 2024
@itaysk itaysk changed the title Support mirror support registry mirrors for image scanning Nov 20, 2024
@itaysk itaysk added the target/container-image Issues relating to container image scanning label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. target/container-image Issues relating to container image scanning
Projects
None yet
Development

No branches or pull requests

1 participant