You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OS initially detected
If the OS is detected initially, there will be a mismatch between metadata.OS and the package PURLs (their namespace and/or distro qualifier).
Proposed solution
After overriding the OS we should recompute and update the PURLs for OS packages, since OS information is part of the PURL itself.
Description
When the --distro flag is used, we update metadata.OS, but the PURLs for OS packages remain unchanged.
This leads to two problems:
If the OS is not detected initially, we keep the package PURLs empty even after overriding the OS via --distro.
As a result, VEX files cannot be used correctly (see: VEX pkg:identifier fails, because SBOM seems to be missing PURL when --distro alma/9 override is used #9767).
If the OS is detected initially, there will be a mismatch between metadata.OS and the package PURLs (their namespace and/or distro qualifier).
Proposed solution
After overriding the OS we should recompute and update the PURLs for OS packages, since OS information is part of the PURL itself.
Relevant code:
trivy/pkg/scan/local/service.go
Lines 84 to 88 in 719ea29
Discussed in #9767