-
Notifications
You must be signed in to change notification settings - Fork 17
Description
I was scanning the SBOM provided for the bellsoft-liberica buildpack and was expecting to see 5 vulnerabilities reported using grype. However, zero vulnerabilities where detected because the version in the SBOM is 11.0.16 however, the version of java packaged by the buildpack in 9.8.0 I believe is version 11.0.16.1 as reported from my running container.
$ /layers/paketo-buildpacks_bellsoft-liberica/jre/bin/java -version
Picked up JAVA_TOOL_OPTIONS: -Dmanagement.endpoint.health.probes.add-additional-paths="true" -Dmanagement.endpoint.health.show-details=always -Dmanagement.endpoints.web.base-path="/actuator" -Dmanagement.endpoints.web.exposure.include=* -Dmanagement.health.probes.enabled="true" -Dmanagement.server.port="8081" -Dserver.port="8080" -Dserver.shutdown.grace-period="24s"
openjdk version "11.0.16.1" 2022-08-12 LTS
OpenJDK Runtime Environment (build 11.0.16.1+1-LTS)
OpenJDK 64-Bit Server VM (build 11.0.16.1+1-LTS, mixed mode)
Expected Behavior
I would expect the cpes section of the SBOM to be equal to 11.0.16.1
for both JDK and JRE
"cpe:2.3:a:oracle:jdk:11.0.16.1:*:*:*:*:*:*:*"
"cpe:2.3:a:oracle:jre:11.0.16.1:*:*:*:*:*:*:*"
Current Behavior
The version returned is 11.0.16
Possible Solution
My understanding is the SBOM is generated using the information in the buildpack.toml.
Steps to Reproduce
- Use kpack or pack to build the image using v9.8.0 of this buildpack.
- Use the
pack
cli to download the sbompack sbom download localhost:5000/supply-chain/tanzu-java-web-app-default@sha256:333bb5b40eea3306b9425f6f167b71ee5e41c9aae1734d6fda8bcb68b90b4a95 --remote
- Use the
grype
cli to perform a scan of the SBOM to generate a vulnerability reportgrype layers/sbom/launch/paketo-buildpacks_bellsoft-liberica/jre/sbom.syft.json
- Notice the output indicates that there are no vulnerabilities found.
Motivations
Scanners such as grype, trivy, etc, have a difficult time discovering the JRE flavor and version included via buildpacks. To accomplish this outcome we need to scan the SBOM for the bellsoft layer, in addition, the performing a full image scan. Performing a full image scan will not detect the JRE installed.