Answers: <p>Unable to get Trivy to scal local images, any idea how to do that?</p>
  <p>scal ? or scan ?</p>
  <p><a href="https://aquasecurity.github.io/trivy/v0.18.3/installation/" rel="nofollow noreferrer">https://aquasecurity.github.io/trivy/v0.18.3/installation/</a></p>
  <p>Login again and try these</p>
  <pre><code>docker pull kodekloud/webapp-delayed-start
  trivy image kodekloud/webapp-delayed-start --severity CRITICAL
  </code></pre>
  
Answers: CC BY-SA 4.0
Answers: 2024-08-13T16:17:18.203Z
Answers: 2024-08-13T16:17:18.203Z
Answers: playwithcode
Body: <p>I have the following setup (running in a KodeKloud lab):</p>
  <p>A controlplane node installed with containerd, crictl and trivy (installed locally).</p>
  <p>Because of a docker rate limit issue, I'm unable to pull docker images from docker.io registry but I have the relevant images saved in the local registry.</p>
  <pre><code>root@controlplane ~ ➜  crictl images | grep kodekl
  docker.io/kodekloud/webapp-delayed-start   latest              a292f6cde2ced       33.1MB
  </code></pre>
  <p>When I run trivy and supplying a local image:</p>
  <pre><code>root@controlplane ~ ➜  trivy image kodekloud/webapp-delayed-start --severity CRITICAL
  2024-08-07T03:34:32-04:00       INFO    Vulnerability scanning is enabled
  2024-08-07T03:34:32-04:00       INFO    Secret scanning is enabled
  2024-08-07T03:34:32-04:00       INFO    If your scanning is slow, please try '--scanners vuln' to disable secret scanning
  2024-08-07T03:34:32-04:00       INFO    Please see also https://aquasecurity.github.io/trivy/v0.51/docs/scanner/secret/#recommendation for faster secret detection
  2024-08-07T03:34:32-04:00       FATAL   Fatal error     image scan error: scan error: unable to initialize a scanner: unable to initialize an image scanner: 4 errors occurred:
          * docker error: unable to inspect the image (kodekloud/webapp-delayed-start): Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
          * containerd error: failed to parse image reference: kodekloud/webapp-delayed-start
          * podman error: unable to initialize Podman client: no podman socket found: stat /run/user/0/podman/podman.sock: no such file or directory
          * remote error: GET https://index.docker.io/v2/kodekloud/webapp-delayed-start/manifests/latest: TOOMANYREQUESTS: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit
  </code></pre>
  <p>No matter what I try, it tries going to the docker.io registry and then encounters the rate limit issue.</p>
  <p>Since docker command is absent, I'm unable to save an image as tar and run trivy on the tar file.</p>
  <p>Any idea how to work around it?</p>
  
Tags: <containerd><crictl><trivy>
Title: Unable to get Trivy to scal local images, any idea how to do that?
UserDisplayName: Itai Ganot
ThreadText: # Unable to get Trivy to scal local images, any idea how to do that?
  
  (Asked by: username_0 on 2024-08-07)
  
  I have the following setup (running in a KodeKloud lab):
  
  A controlplane node installed with containerd, crictl and trivy (installed locally).
  
  Because of a docker rate limit issue, I'm unable to pull docker images from docker.io registry but I have the relevant images saved in the local registry.
  
  ```
  root@controlplane ~ ➜  crictl images | grep kodekl
  docker.io/kodekloud/webapp-delayed-start   latest              a292f6cde2ced       33.1MB
  
  ```
  
  When I run trivy and supplying a local image:
  
  ```
  root@controlplane ~ ➜  trivy image kodekloud/webapp-delayed-start --severity CRITICAL
  2024-08-07T03:34:32-04:00       INFO    Vulnerability scanning is enabled
  2024-08-07T03:34:32-04:00       INFO    Secret scanning is enabled
  2024-08-07T03:34:32-04:00       INFO    If your scanning is slow, please try '--scanners vuln' to disable secret scanning
  2024-08-07T03:34:32-04:00       INFO    Please see also https://aquasecurity.github.io/trivy/v0.51/docs/scanner/secret/#recommendation for faster secret detection
  2024-08-07T03:34:32-04:00       FATAL   Fatal error     image scan error: scan error: unable to initialize a scanner: unable to initialize an image scanner: 4 errors occurred:
          * docker error: unable to inspect the image (kodekloud/webapp-delayed-start): Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
          * containerd error: failed to parse image reference: kodekloud/webapp-delayed-start
          * podman error: unable to initialize Podman client: no podman socket found: stat /run/user/0/podman/podman.sock: no such file or directory
          * remote error: GET https://index.docker.io/v2/kodekloud/webapp-delayed-start/manifests/latest: TOOMANYREQUESTS: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit
  
  ```
  
  No matter what I try, it tries going to the docker.io registry and then encounters the rate limit issue.
  
  Since docker command is absent, I'm unable to save an image as tar and run trivy on the tar file.
  
  Any idea how to work around it?
  
  **Tags:** containerd, crictl, trivy
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-08-13. Score: 0
  
  Unable to get Trivy to scal local images, any idea how to do that?
  
  scal ? or scan ?
  
  <https://aquasecurity.github.io/trivy/v0.18.3/installation/>
  
  Login again and try these
  
  ```
  docker pull kodekloud/webapp-delayed-start
  trivy image kodekloud/webapp-delayed-start --severity CRITICAL
  
  ```
  
  
  ---
  
  