scout-cli icon indicating copy to clipboard operation
scout-cli copied to clipboard

Docker Scout does not honor Chainguard's advisory data/secdb

Open amdawson opened this issue 2 years ago β€’ 9 comments

As the owner of its own distro, Chainguard maintains advisory data that captures the results of investigations into potential vulnerabilities. This includes cases where Chainguard determines a vulnerability to be a false positive.

Chainguard publishes guidance for vulnerability scanner integration here. Scanners are expected to honor Chainguard's advisory data, including these "false positive" designations, so that the vulnerability report output from supported scanners is as accurate as possible.

Even though the Docker docs show that both the Wolfi (open source) and Chainguard (commercial) advisory feeds are used by Docker Scout, it appears that Docker Scout does not correctly implement support for our false positive data in all cases. According to this output, when Docker Scout finds matches to language ecosystem (e.g. NPM) packages, Docker Scout doesn't correctly suppress the result when these matches are noted in Chainguard's secdb as false positives.

This means Docker Scout fails to meet an expectation defined in Chainguard's Vulnerability Scanner Support docs, specifically on this page, item 4a.

Please let us know when integration with the Wolfi and Chainguard secdb data is planned.

amdawson avatar Nov 15 '23 17:11 amdawson

Thanks for raising this.

Please let us know when integration with the Wolfi and Chainguard secdb data is planned.

Will do. Currently we do not have a definitive date to address this but will consider it based on customer feedback.

cdupuis avatar Nov 23 '23 08:11 cdupuis

Great, thanks @cdupuis! Ping me if I can help, too. πŸ˜ƒ

luhring avatar Nov 26 '23 16:11 luhring

Hi @cdupuis just a followup on this one, we are hearing about some false positives on scout scans, is this one getting worked? see my OP for links to guidance on scanner support for chainguard, the links give you all the details.

amdawson avatar Apr 12 '24 03:04 amdawson

We are now publishing our security advisory feeds in OSV format, if that helps @cdupuis

MordodeMaru avatar May 31 '24 12:05 MordodeMaru

We are now publishing our security advisory feeds in OSV format, if that helps @cdupuis

Thanks for pointing that out. I clearly missed this and I can't find any reference in https://github.com/chainguard-dev/vulnerability-scanner-support/blob/main/docs/foundational_concepts.md#security-data. Is this still the right place?

Regarding the issue here, I fail to reproduce the behaviour described above for the sample image provided. See the following output:

❯ docker scout cves cgr.dev/chainguard/metrics-server
    βœ“ SBOM obtained from attestation, 11 packages found
    βœ“ No vulnerable package detected


## Overview

                    β”‚               Analyzed Image
────────────────────┼─────────────────────────────────────────────
  Target            β”‚  cgr.dev/chainguard/metrics-server:latest
    digest          β”‚  313936368ee3
    platform        β”‚ linux/arm64
    vulnerabilities β”‚    0C     0H     0M     0L
    size            β”‚ 18 MB
    packages        β”‚ 11


## Packages and Vulnerabilities

  No vulnerable packages detected

Could you please provide an example of such a false positive report for us to verify?

cdupuis avatar Jun 05 '24 17:06 cdupuis

Note that since this issue was opened we started using the cosign delivered SBOMs for analysis on these images so the behaviour has changed.

justincormack avatar Jun 05 '24 17:06 justincormack

Thanks @cdupuis and @justincormack! With the recent changes, I think we're in a much better state. I'll reach back out if I see anything else come up πŸ™‡

luhring avatar Jun 06 '24 12:06 luhring

Thank you Chainguard team. I’ll close this here. Please feel free to open a new issue if you end up seeing other issues.

cdupuis avatar Jun 06 '24 14:06 cdupuis

After looking at more test cases, it looks like this isn't entirely fixed yet. 😞

Specifically, if Chainguard Images are being used as base images to build other images, Scout starts producing false positives again. Here's an example:

First, Scan the latest (as of today) Python dev image:

$ docker scout cves cgr.dev/chainguard/python@sha256:b179fd2b12dadbc3fceb0fda5133020269da349083eef7d1a6378a338fa4ee4b
    βœ“ SBOM obtained from attestation, 150 packages found
    βœ“ No vulnerable package detected
...

No CVEs, which is correct.

Then, use this image as a base image to build a new image. In this case, we won't even modify the filesystem or image configuration at all.

Dockerfile:

FROM cgr.dev/chainguard/python@sha256:b179fd2b12dadbc3fceb0fda5133020269da349083eef7d1a6378a338fa4ee4b

# That's it!

Build the image, and then scan it:

$ docker build -t test.local/python .
...
$ docker scout cves test.local/python
    βœ“ Image stored for indexing
    βœ“ Indexed 83 packages
    βœ“ Provenance obtained from attestation
    βœ— Detected 1 vulnerable package with 1 vulnerability


## Overview

                    β”‚       Analyzed Image
────────────────────┼──────────────────────────────
  Target            β”‚  test.local/python:latest
    digest          β”‚  a00018200a26
    platform        β”‚ linux/arm64
    vulnerabilities β”‚    0C     1H     0M     0L
    size            β”‚ 181 MB
    packages        β”‚ 83


## Packages and Vulnerabilities

   0C     1H     0M     0L  pip 24.1.1
pkg:pypi/[email protected]

    βœ— HIGH CVE-2018-20225 [OWASP Top Ten 2017 Category A9 - Using Components with Known Vulnerabilities]
      https://scout.docker.com/v/CVE-2018-20225
      Affected range : >=0
      Fixed version  : not fixed
      CVSS Score     : 7.8
      CVSS Vector    : CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Here, Docker Scout should be applying false positive data from Chainguard's security feed, but since it's not, it's still CVE-2018-20225 in pip β€”Β notably the exact same software bits as are in the 0-CVE Chainguard Image.

luhring avatar Jul 05 '24 20:07 luhring