Description
Trying to refresh database.
What did you expect to happen?
Vulnerabilities database to be updated.
What happened instead?
Error during redhat update
Output of run with -debug:
$ trivy --refresh --debug
2019-09-27T15:44:28.946+0300 DEBUG cache dir: /Users/adel/Library/Caches/trivy
2019-09-27T15:44:28.946+0300 DEBUG db path: /Users/adel/Library/Caches/trivy/db/trivy.db
2019-09-27T15:44:28.946+0300 INFO Refreshing DB...
2019-09-27T15:44:28.949+0300 DEBUG db path: /Users/adel/Library/Caches/trivy/db/trivy.db
2019-09-27T15:44:28.953+0300 INFO Updating vulnerability database...
2019-09-27T15:44:28.953+0300 DEBUG git pull
2019-09-27T15:44:33.989+0300 DEBUG total updated files: 286031
2019-09-27T15:44:33.989+0300 INFO Updating debian-oval data...
2019-09-27T15:44:34.052+0300 DEBUG Debian OVAL updated files: 62310
61689 / 62310 [==================================================================================================================================================================================================================================================================================================>--] 99.00%2019-09-27T15:44:41.997+0300 DEBUG Saving Debian OVAL
62310 / 62310 [==================================================================================================================================================================================================================================================================================================] 100.00% 9s
2019-09-27T15:44:43.082+0300 INFO Updating ubuntu data...
2019-09-27T15:44:43.116+0300 DEBUG Ubuntu OVAL updated files: 31346
30665 / 31346 [==============================================================================================================================================================================================================================================================================================>------] 97.83%2019-09-27T15:44:50.259+0300 DEBUG Saving Ubuntu DB
31346 / 31346 [==================================================================================================================================================================================================================================================================================================] 100.00% 7s
2019-09-27T15:44:50.955+0300 INFO Updating nvd data...
2019-09-27T15:44:51.045+0300 DEBUG NVD updated files: 129277
129238 / 129277 [===================================================================================================================================================================================================================================================================================================] 99.97%2019-09-27T15:45:32.073+0300 DEBUG NVD batch update
129277 / 129277 [===============================================================================================================================================================================================================================================================================================] 100.00% 44s
2019-09-27T15:45:35.136+0300 INFO Updating alpine data...
2019-09-27T15:45:35.165+0300 DEBUG Alpine updated files: 13746
12969 / 13746 [====================================================================================================================================================================================================================================================================================>----------------] 94.35%2019-09-27T15:45:37.892+0300 DEBUG Saving Alpine DB
13746 / 13746 [==================================================================================================================================================================================================================================================================================================] 100.00% 2s
2019-09-27T15:45:38.123+0300 INFO Updating redhat data...
2019-09-27T15:45:38.150+0300 DEBUG Red Hat updated files: 20032
2369 / 20032 [==================================>----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 11.83% 0s
2019-09-27T15:45:38.567+0300 FATAL error in vulnerability DB update:
github.com/aquasecurity/trivy/pkg.Run
/root/project/pkg/run.go:111
- error in redhat update:
github.com/aquasecurity/trivy/pkg/vulnsrc.Update
/root/project/pkg/vulnsrc/vulnsrc.go:68
- error in RedHat walk:
github.com/aquasecurity/trivy/pkg/vulnsrc/redhat.Update
/root/project/pkg/vulnsrc/redhat/redhat.go:96
- error in file walk:
github.com/aquasecurity/trivy/pkg/utils.FileWalk
/root/project/pkg/utils/utils.go:65
- failed to decode RedHat JSON:
github.com/aquasecurity/trivy/pkg/vulnsrc/redhat.Update.func1
/root/project/pkg/vulnsrc/redhat/redhat.go:54
- json: cannot unmarshal object into Go struct field RedhatCVE.mitigation of type string
Output of trivy -v:
$ trivy -v
trivy version 0.1.6
We have the same problem for a few hours:
# trivy --refresh
2019-09-27T13:15:38.210Z FATAL error in vulnerability DB update: error in redhat update: error in RedHat walk: error in file walk: failed to decode RedHat JSON: json: cannot unmarshal object into Go struct field RedhatCVE.mitigation of type string
@adel-s @galdorjt Thank you for reporting it.
The JSON format of RedHat API has suddenly changed. I fixed it temporarily. Would you try it again?
Confirm. Works as it should. Thanks!
It solved the problem for us. Thank you so much for fixing it so quickly!