-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Inconsistencies on SBOM vulnerabilities scanning #5812
Comments
Thanks @DmitriyLewen ! I noticed you self-assigned this issue, I really appreciate it. Please don't hesitate to let me know it if you're busy to address it and you want me to drop a PR proposing a solution. |
We are discussing changes to But thanks for your suggestion and help! |
Just wondering. Was there any further discussion done on this topic @DmitriyLewen ? I was checking with Trivy's latest release and this is still noticeable. |
We are still looking for the best way to solve this problem. |
Is that issue fixed in version 0.50.0? |
We've updated the logic for SPDX (#6310). Let me know if you are still having problems with packages/applications being overwritten. |
@DmitriyLewen does it mean we can close this issue? |
@itaysk Looks like users no longer have this problem with the new version. |
@DmitriyLewen thank you and the team for taking care of this! I've tested scanning many SBOMs of container images and I've found no issues whatsoever, but I did see some conflicting results with Helm chart SBOMs. For example, running Trivy on this nginx-helm.json: ❯ trivy sbom nginx-helm.json --quiet --format json | grep VulnerabilityID | wc -l
198
❯ trivy sbom nginx-helm.json --quiet --format json | grep VulnerabilityID | wc -l
179 Let me know if I can help any further and thanks in advance! |
Hello @pablogalegoc This problem is related with multiple OSes in your spdx file. Regards, Dmitriy |
@DmitriyLewen is there anything I can help with in order to get that PR merged? Thanks in advance! |
Hello @pablogalegoc some of the team were on vacation, so there is a delay in reviewing the PRs - #7303 |
Discussed in #5790
Originally posted by juan131 December 15, 2023
Description
SBOM scanning with more than one Python applications result on inconsistent reported vulns.
Given a SPDX file with two Python apps (such as the one shown below) each of them containing dozens of packages, Trivy reports a different number of vulnerabilities on consecutive executions.
The problem seems be related with setting the application file path with an empty string for these apps:
When the nested map below is populated at
ApplyLayers
, given both apps don't have a file path, the resulting "key" used in the map is the same/type:python-pkg
, therefore the last app extracted from the layer overwrites the previous one:As a consequence, the info about the packages included on that application gets lost.
Desired Behavior
Consistency on reported vulnerabilities.
Actual Behavior
Number of reported vulnerabilities differs between executions.
Reproduction Steps
Run the Trivy scanner several times to receive different amount of reported vulnerabilities:
Target
SBOM
Scanner
Vulnerability
Output Format
JSON
Mode
Standalone
Debug Output
Irrelevant
Operating System
macOS sonoma
Version
Checklist
trivy image --reset
The text was updated successfully, but these errors were encountered: