Scanning a local Docker image with PHP and a composer.lock inside I get an error. The command
trivy --debug registry.example.com/project/image:tag
What did you expect to happen?
Just a report ;-)
What happened instead?
I get an error message.
Output of run with -debug:
2019-07-03T18:12:07.263+0200 DEBUG cache dir: /Users/johndoe/Library/Caches/trivy
2019-07-03T18:12:07.263+0200 DEBUG db path: /Users/johndoe/Library/Caches/trivy/db/trivy.db
2019-07-03T18:12:07.266+0200 INFO Updating vulnerability database...
2019-07-03T18:12:07.266+0200 DEBUG git pull
2019-07-03T18:12:08.024+0200 DEBUG total updated files: 1
2019-07-03T18:12:08.038+0200 DEBUG Vulnerability type: [os library]
2019-07-03T18:12:08.897+0200 DEBUG OS family: debian, OS version: 9.7
2019-07-03T18:12:08.898+0200 DEBUG the number of packages: 170
2019-07-03T18:12:08.898+0200 DEBUG the number of packages from commands: 0
2019-07-03T18:12:08.898+0200 DEBUG the number of packages: 170
2019-07-03T18:12:08.898+0200 INFO Detecting Debian vulnerabilities...
2019-07-03T18:12:08.898+0200 DEBUG debian: os version: 9
2019-07-03T18:12:08.898+0200 DEBUG debian: the number of packages: 170
2019-07-03T18:12:08.925+0200 DEBUG Detecting library vulnerabilities, path: tmp/composer.lock
2019-07-03T18:12:08.925+0200 INFO Updating composer Security DB...
2019-07-03T18:12:08.925+0200 DEBUG git pull
2019-07-03T18:12:09.598+0200 FATAL error in image scan:
github.com/knqyf263/trivy/pkg.Run
/root/project/pkg/run.go:166
- failed to scan libraries:
github.com/knqyf263/trivy/pkg/scanner.ScanImage
/root/project/pkg/scanner/scan.go:65
- failed to scan composer vulnerabilities:
github.com/knqyf263/trivy/pkg/scanner/library.Scan
/root/project/pkg/scanner/library/scan.go:76
- failed to update composer advisories:
github.com/knqyf263/trivy/pkg/scanner/library.scan
/root/project/pkg/scanner/library/scan.go:106
- error in batch update:
github.com/knqyf263/trivy/pkg/db.BatchUpdate
/root/project/pkg/db/db.go:110
- failed to save composer vulnerability:
github.com/knqyf263/trivy/pkg/scanner/library/composer.Scanner.saveVulnerabilities.func1
/root/project/pkg/scanner/library/composer/advisory.go:98
- failed to create a bucket:
github.com/knqyf263/trivy/pkg/db.Put
/root/project/pkg/db/db.go:99
- bucket name required
Output of trivy -v:
trivy version 0.1.3
Installed via Brew
Additional details (base image name, container registry info...):
The local image is based on php:7.3-fpm-stretch
Same here...
trivy version 0.1.3
Output of run with -debug:
2019-07-03T11:53:46.902-0600 DEBUG Vulnerability type: [os library]
2019-07-03T11:53:59.880-0600 DEBUG OS family: alpine, OS version: 3.10.0
2019-07-03T11:53:59.883-0600 DEBUG the number of packages: 81
2019-07-03T11:54:00.833-0600 DEBUG the number of packages from commands: 118
2019-07-03T11:54:00.833-0600 DEBUG the number of packages: 129
2019-07-03T11:54:00.833-0600 INFO Detecting Alpine vulnerabilities...
2019-07-03T11:54:00.833-0600 DEBUG alpine: os version: 3.10
2019-07-03T11:54:00.833-0600 DEBUG alpine: the number of packages: 129
2019-07-03T11:54:00.835-0600 DEBUG Detecting library vulnerabilities, path: service/Gemfile.lock
2019-07-03T11:54:00.835-0600 INFO Updating bundler Security DB...
2019-07-03T11:54:00.864-0600 DEBUG remove an existed directory
2019-07-03T11:54:03.157-0600 FATAL error in image scan:
github.com/knqyf263/trivy/pkg.Run
/root/project/pkg/run.go:166
- failed to scan libraries:
github.com/knqyf263/trivy/pkg/scanner.ScanImage
/root/project/pkg/scanner/scan.go:65
- failed to scan bundler vulnerabilities:
github.com/knqyf263/trivy/pkg/scanner/library.Scan
/root/project/pkg/scanner/library/scan.go:76
- failed to update bundler advisories:
github.com/knqyf263/trivy/pkg/scanner/library.scan
/root/project/pkg/scanner/library/scan.go:106
- error in batch update:
github.com/knqyf263/trivy/pkg/db.BatchUpdate
/root/project/pkg/db/db.go:110
- failed to save bundler vulnerability:
github.com/knqyf263/trivy/pkg/scanner/library/bundler.(*Scanner).saveVulnerabilities.func1
/root/project/pkg/scanner/library/bundler/advisory.go:117
- failed to create a bucket:
github.com/knqyf263/trivy/pkg/db.Put
/root/project/pkg/db/db.go:99
- bucket name required
I am facing same issue for all the images with composer.lock.
[root@git-runner ~]# trivy --version
trivy version 0.1.3
Output:
[~]# trivy -d image:tag
2019-07-05T03:03:35.355-0400 DEBUG cache dir: /root/.cache/trivy
2019-07-05T03:03:35.356-0400 DEBUG db path: /root/.cache/trivy/db/trivy.db
2019-07-05T03:03:35.373-0400 INFO Updating vulnerability database...
2019-07-05T03:03:35.373-0400 DEBUG git pull
2019-07-05T03:03:38.215-0400 DEBUG total updated files: 1
2019-07-05T03:03:38.221-0400 DEBUG Vulnerability type: [os library]
2019-07-05T03:03:57.033-0400 DEBUG OS family: centos, OS version: 7.6.1810
2019-07-05T03:04:00.884-0400 DEBUG the number of packages: 420
2019-07-05T03:04:00.884-0400 DEBUG the number of packages from commands: 0
2019-07-05T03:04:00.885-0400 DEBUG the number of packages: 420
2019-07-05T03:04:00.885-0400 INFO Detecting RHEL/CentOS vulnerabilities...
2019-07-05T03:04:00.885-0400 DEBUG redhat: os version: 7
2019-07-05T03:04:00.885-0400 DEBUG redhat: the number of packages: 420
2019-07-05T03:04:01.151-0400 DEBUG Detecting library vulnerabilities, path: opt/app-root/src/composer.lock
2019-07-05T03:04:01.151-0400 INFO Updating composer Security DB...
2019-07-05T03:04:01.151-0400 DEBUG git pull
2019-07-05T03:04:03.884-0400 FATAL error in image scan:
github.com/knqyf263/trivy/pkg.Run
/root/project/pkg/run.go:166
- failed to scan libraries:
github.com/knqyf263/trivy/pkg/scanner.ScanImage
/root/project/pkg/scanner/scan.go:65
- failed to scan composer vulnerabilities:
github.com/knqyf263/trivy/pkg/scanner/library.Scan
/root/project/pkg/scanner/library/scan.go:76
- failed to update composer advisories:
github.com/knqyf263/trivy/pkg/scanner/library.scan
/root/project/pkg/scanner/library/scan.go:106
- error in batch update:
github.com/knqyf263/trivy/pkg/db.BatchUpdate
/root/project/pkg/db/db.go:110
- failed to save composer vulnerability:
github.com/knqyf263/trivy/pkg/scanner/library/composer.Scanner.saveVulnerabilities.func1
/root/project/pkg/scanner/library/composer/advisory.go:98
- failed to create a bucket:
github.com/knqyf263/trivy/pkg/db.Put
/root/project/pkg/db/db.go:99
- bucket name required
@patrickbaber @alextaujenis @jarik2995 Thank you for the report! I've fixed this issue on #87.
Most helpful comment
@patrickbaber @alextaujenis @jarik2995 Thank you for the report! I've fixed this issue on #87.