-
Notifications
You must be signed in to change notification settings - Fork 580
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
OS information missing in SPDX format SBOM for a container image #3012
Comments
Thanks for the issue. I've reproduced this on Syft 1.9.0. |
Just to add some supporting evidence for this issue: The package information in v2.3 allows for formats that identify the primary package purpose:
Operating System is included in this enum so including the discovered operating system as a package in spdx would be the correct spot. Syft has data for this in it's underlying |
@kl-sinclair I've tried your reproducer commands with the code in #3462. Check the gist with the outputs: https://gist.github.com/josegomezr/1232cf59eb2f32be52737f363ad2b96a I think it generates the expected result, I can't be 100% certain yet. An extra pair of eyes wouldn't hurt 😅 This is the OS package (sampling from {
"name": "Alpine Linux",
"SPDXID": "SPDXRef-OperatingSystem-alpine",
"versionInfo": "3.20.3",
"supplier": "NOASSERTION",
"downloadLocation": "NOASSERTION",
"filesAnalyzed": false,
"licenseConcluded": "NOASSERTION",
"licenseDeclared": "NOASSERTION",
"description": "Alpine Linux v3.20",
"primaryPackagePurpose": "OPERATING-SYSTEM"
} And the relationships are reflected as well: # [...]
{
"spdxElementId": "SPDXRef-OperatingSystem-alpine",
"relatedSpdxElement": "SPDXRef-Package-apk-zlib-6dd4db84efbbb0de",
"relationshipType": "CONTAINS"
},
{
"spdxElementId": "SPDXRef-DocumentRoot-Image-redis",
"relatedSpdxElement": "SPDXRef-OperatingSystem-alpine",
"relationshipType": "CONTAINS"
},
{
"spdxElementId": "SPDXRef-DOCUMENT",
"relatedSpdxElement": "SPDXRef-DocumentRoot-Image-redis",
"relationshipType": "DESCRIBES"
} |
What happened:
When generating an SPDX for container images like Redis or Ubuntu, only package information is included, but OS information, such as Alpine or Ubuntu, is not included in the Package Information section.
Redis:
https://gist.github.com/kl-sinclair/eec66cc2a577a4c702521b20217a1bac
Ubuntu:
https://gist.github.com/kl-sinclair/dfab9b10e93be204d8d76b69e2662333
What you expected to happen:
OS information should be included as a package. For example, as follows:
or
Steps to reproduce the issue:
Anything else we need to know?:
With CycloneDX, OS information is included as a component:
syft-redis.cdx.json:
syft-ubuntu.cdx.json:
Environment:
syft version
:cat /etc/os-release
or similar):macOS Ventura 13.3
The text was updated successfully, but these errors were encountered: