-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add vulnerability definition date info to scan results #37
Comments
@shawngmc do you mean the date the vulnerability information was updated from the upstream source, or are you asking for a per-CVE update date such as when a specific CVE was created/updated in the upstream source? |
I mean the date the vulnerability information DB was pulled from upstream. If a CVE comes out today and I scan on an air-gapped instance tomorrow, I'll have no indication when the vulnerability definitions are from. I'm not expecting Harbor to necessarily show this in the UI. Harbor has a JSON endpoint at projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/additions/vulnerabilities which provides a JSON report of what Harbor knows about the scan. There is a very limited amount of metadata, including the date of the scan (generated_at) and a scanner metadata block (scanner) which has name, vendor and version attributes. Currently, the Anchore version reported is 1.0.0; I'm using anchore-scanner-adapter v1.0.1 and anchore community v1.1.0. Instead, this info is currently hard-coded at
I'm wondering if this block is flexible. I'm not sure if it's populated at scanner config time or scan time. It might be possible for the harbor-scanner-adapter to at lease update it periodically. Trivy seems to populate it at scanner-adapter build time (https://github.com/aquasecurity/harbor-scanner-trivy/blob/9be8b31a00fad4b44d529a57b1eecca28884cbb5/.goreleaser.yml). If we can't add any other fields, I wonder if instead it could, for the version, be something like:
I understand there are the multiple vulnerability streams, etc. - but having some information would be a good Minimum Viable Product. |
I've done a bit of digging as part of something else I was doing, and Harbor should be able to support something here. In the harbor DB, tables:
The json report in the scan_record table contains the name/vendor/version fields. Given that the stored JSON document is being generated by the scanner adapter (the scan_record table has a mime_type column, and for anchore results has the "application/vnd.scanner.adapter.vuln.report.harbor+json; version=1.0" produced by the scanner adapter. It looks like the scanner metadata is added to the report here in ToHarborScanResult. Currently, this just pulls from that version listed line 15 I mentioned earlier. ToHarborScanResult has access to the ImageVulnerabilityReport struct, but that doesn't appear to have any metadata on the engine state. Looking at the Engine API docs:
So while it would be an additional API call or two to Anchore, these should be lightweight calls, the FeedGroup model already exists in the Anchore go library, and it would make the scan report Harbor has much more useful. |
Currently, a scan with this appears to simply show the version of Anchore - given that the Anchore version doesn't change often, and the vulnerability definitions are far more important, is there anywhere to append that information - at least a 'last updated' date?
The text was updated successfully, but these errors were encountered: