Skip to content

Commit

Permalink
fix(report): set created_at and updated_at of trivy to json (future-a…
Browse files Browse the repository at this point in the history
  • Loading branch information
kotakanbe authored Feb 3, 2021
1 parent adb686b commit 64a6222
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions contrib/trivy/parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,24 @@ func Parse(vulnJSON []byte, scanResult *models.ScanResult) (result *models.ScanR
return references[i].Link < references[j].Link
})

var published time.Time
if vuln.PublishedDate != nil {
published = *vuln.PublishedDate
}

var lastModified time.Time
if vuln.LastModifiedDate != nil {
lastModified = *vuln.LastModifiedDate
}

vulnInfo.CveContents = models.CveContents{
models.Trivy: models.CveContent{
Cvss3Severity: vuln.Severity,
References: references,
Title: vuln.Title,
Summary: vuln.Description,
Published: published,
LastModified: lastModified,
},
}
// do only if image type is Vuln
Expand Down

0 comments on commit 64a6222

Please sign in to comment.