Skip to content
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

bug(report): Trivy duplicates packages if the image contains a package and an SBOM file with that package #6208

Closed
2 tasks done
DmitriyLewen opened this issue Feb 27, 2024 Discussed in #6204 · 2 comments
Closed
2 tasks done
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@DmitriyLewen
Copy link
Contributor

Discussed in #6204

Originally posted by juan131 February 26, 2024

Description

Scanning to report SBOM (trivy image --format spdx-json ...) include duplicated app libraries when they're detected during analysis twice (e.g. it was both detected with "jar" analyzer and "sbom" analyzer).

Desired Behavior

Libraries shouldn't be included twice in the SPDX output.

Actual Behavior

Libraries are duplicated when scanning certain images.

Reproduction Steps

  1. Run trivy image --format spdx-json --output sbom.json bitnami/postgresql:15.5.0-debian-11-r21
  2. Inspect sbom.json (e.g. execute: cat sbom.json | jq -r '.packages[] | select(.name == "org.postgresql:pljava")') to find duplicates

The library is detected twice due to the "jar" analyzer + the "bitnami" analyzer based on the .spdx-postgresql.spdx included in the container image.

Target

Container Image

Scanner

None

Output Format

SPDX

Mode

Standalone

Debug Output

It adds no value

Operating System

macOS sonoma

Version

$ trivy --version
Version: 0.49.1
Vulnerability DB:
  Version: 2
  UpdatedAt: 2024-01-09 12:13:28.274214364 +0000 UTC
  NextUpdate: 2024-01-09 18:13:28.274214053 +0000 UTC
  DownloadedAt: 2024-01-09 15:56:37.96018 +0000 UTC
Java DB:
  Version: 1
  UpdatedAt: 2024-02-26 05:38:21.591482531 +0000 UTC
  NextUpdate: 2024-02-29 05:38:21.591482331 +0000 UTC
  DownloadedAt: 2024-02-26 11:17:18.334661 +0000 UTC

Checklist

@DmitriyLewen DmitriyLewen added the kind/bug Categorizes issue or PR as related to a bug. label Feb 27, 2024
@DmitriyLewen DmitriyLewen closed this as not planned Won't fix, can't repro, duplicate, stale Feb 27, 2024
@itaysk
Copy link
Contributor

itaysk commented Apr 9, 2024

@DmitriyLewen what was the conclusion here?

@DmitriyLewen
Copy link
Contributor Author

I hastened to open the issue and closed it almost immediately.

These were not duplicates.
Packages use different file paths - #6208 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

2 participants