Trivy can't find installed version when scanning images of SpringBoot app #5770
Replies: 4 comments 4 replies
-
Hello @ASarco Looks like Trivy can't find version for your SpringBoot app. |
Beta Was this translation helpful? Give feedback.
-
I'm not using Gradle, I'm using Maven. |
Beta Was this translation helpful? Give feedback.
-
I can't reproduce this with a minimum SpringBoot 2.7.x project. And I can't send you an image of the real application for obvious reasons. |
Beta Was this translation helpful? Give feedback.
-
I wasn't sure if I should add this here or log a new issue but this looks very similar to what we're seeing.
This is particularly problematic since any attempt to squash layers or to use expressions like: So to summarize: To harden a base image I run a scan, install package upgrades via an enclosing Dockerfile, scan again and see no changes. I'm hoping the issue is simple to resolve with a trivy option of some kind? But I'm guessing that there is something more difficult going on here. If it matters, the following is the Dockerfile with the suggested changes in it:
A scan of the base third-party image shows (among lots of other things) these two packages needing updates:
To verify the image contains the right stuff I ran
Which are upgraded from the baseline and match or exceed what was in the original trivy report. |
Beta Was this translation helpful? Give feedback.
-
IDs
Logback 1.2.13
Description
Trivy doesn't seem to detect the installed version of Logback (or any other dependency) if the version is overriden.
Due to the recent discovery of CVE-2023-6378, we updated Logback from 1.2.12 to 1.2.13
SpringBoot 2.7.x includes Logback 1.2.12 in its dependencies BOM, so to override it, we added:
<logback.version>1.2.13</logback.version>
to the pom.
But this apparently causes Trivy to be unable to find the installed version (1.2.13), and to keep reporting the vulnerability.
This seems to only happens when scanning a Docker image, and not the filesystem:
I don't know if I'm doing something wrong, or there is a bug in Trivy.
Reproduction Steps
Target
Container Image
Scanner
Vulnerability
Target OS
Ubuntu 22.04
Debug Output
Version
Checklist
-f json
that shows data sources and confirmed that the security advisory in data sources was correctBeta Was this translation helpful? Give feedback.
All reactions