trivyを使ってDockerイメージをスキャンした際にエラーが発生しました。
エラー内容を検索しても、それらしい記事が見つからなかったのでメモします。
オプションを1つ追加するだけで解決しました。
エラーログ
$ trivy -s "HIGH,CRITICAL" -o trivy_result.txt centos7:test01
2021-03-17T07:46:41.617Z FATAL error in image scan: failed analysis: analyze error: timeout: context deadline exceeded
--timeout
オプション追加
ログ(オプション追加)
$ trivy --timeout 10m -s "HIGH,CRITICAL" -o trivy_result.txt centos7:test01
2021-03-17T08:31:42.321Z INFO Detecting RHEL/CentOS vulnerabilities...
2021-03-17T08:31:43.305Z INFO Trivy skips scanning programming language libraries because no supported file was detected
centos7:test01 (centos 7.9.2009)
================================
Total: 3 (HIGH: 3, CRITICAL: 0)
以上です。
参考:
https://github.com/aquasecurity/trivy/issues/139
https://github.com/aquasecurity/trivy/pull/143
https://aquasecurity.github.io/trivy/v0.16.0/usage/image/