aquasecurity / trivy

Find vulnerabilities, misconfigurations, secrets, SBOM in containers, Kubernetes, code repositories, clouds and more
https://aquasecurity.github.io/trivy
Apache License 2.0
23.49k stars 2.32k forks source link

FATAL error in image scan: failed to scan image: failed to analyze OS packages: exec: "rpm": executable file not found in $PATH #181

Closed ANastasiosDF closed 5 years ago

ANastasiosDF commented 5 years ago

For every docker image, I am trying to run I receive 2019-10-07T16:01:33.150+0100 FATAL error in image scan: failed to scan image: failed to analyze OS packages: exec: "rpm": executable file not found in $PATH

Output of run with -debug:

    FATAL   error in image scan:
    github.com/aquasecurity/trivy/pkg.Run
        /root/project/pkg/run.go:164
  - failed to scan image:
    github.com/aquasecurity/trivy/pkg/scanner.ScanImage
        /root/project/pkg/scanner/scan.go:54
  - failed to analyze OS packages:
    github.com/aquasecurity/trivy/pkg/scanner/ospkg.Scan
        /root/project/pkg/scanner/ospkg/scan.go:52
  - exec: "rpm": executable file not found in $PATH

Output of trivy -v:

trivy version 0.1.6
knqyf263 commented 5 years ago

@ANastasiosDF If you are using Debian/Ubuntu and scanning RHEL/CentOS, you have to install rpm. https://github.com/aquasecurity/trivy#debianubuntu

ANastasiosDF commented 5 years ago

I am using a MAC

knqyf263 commented 5 years ago

macOS needs rpm as well

knqyf263 commented 5 years ago

If this problem occurs even after you install rpm on macOS, please reopen this PR.