-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add a script for sbom enrichment #181
Conversation
4d2bbe1
to
fc72b1d
Compare
@chmeliik Hey, this is the prerequisite of ISV-5411. Once this is merged I'll continue on the buildah task and remove embedded sbom in image as we agreed. |
sbom-utility-scripts/scripts/add-image-reference-script/README.md
Outdated
Show resolved
Hide resolved
sbom-utility-scripts/scripts/add-image-reference-script/README.md
Outdated
Show resolved
Hide resolved
sbom-utility-scripts/scripts/add-image-reference-script/README.md
Outdated
Show resolved
Hide resolved
sbom-utility-scripts/scripts/add-image-reference-script/README.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly LGTM, some minor concerns
sbom-utility-scripts/scripts/add-image-reference-script/add_image_reference.py
Outdated
Show resolved
Hide resolved
sbom-utility-scripts/scripts/add-image-reference-script/add_image_reference.py
Outdated
Show resolved
Hide resolved
sbom-utility-scripts/scripts/add-image-reference-script/add_image_reference.py
Outdated
Show resolved
Hide resolved
sbom-utility-scripts/scripts/add-image-reference-script/add_image_reference.py
Outdated
Show resolved
Hide resolved
/ok-to-test |
I don't think approach for spdx is correct. Every spdx document on the input (produced either by cachi2 or syft) will have "virtual" or "wrapper "package (I don't have better name for it) in relationship ROOT DESCRIBES SPDXRef-VirtualPackage and then other packages representing real packages are in relation SPDXRef-VirtualPackage CONTAINS SPDXRef-Package-A. Build dependencies (builder images) are in relation SPDXRef-Builder-Image1 BUILD_TOOL_OF SPDXRef-VirtualPackage. If that's correct assumption I think you need to replace existing "VirtualPackage" with SPDXRef-Image instead of adding new package to the list of packages. Btw I tried to run syft convert on cdx sbom with metadata.component to see how syft converts it so we can maybe get some hints there, but it doesn't convert it at all |
Hypothetically, I can imagine a situation where an SPDX SBOM Using
|
The most general handling could look something like this:
|
sbom-utility-scripts/scripts/add-image-reference-script/add_image_reference.py
Outdated
Show resolved
Hide resolved
sbom-utility-scripts/scripts/add-image-reference-script/README.md
Outdated
Show resolved
Hide resolved
sbom-utility-scripts/scripts/add-image-reference-script/add_image_reference.py
Show resolved
Hide resolved
sbom-utility-scripts/scripts/add-image-reference-script/add_image_reference.py
Outdated
Show resolved
Hide resolved
sbom-utility-scripts/scripts/add-image-reference-script/add_image_reference.py
Outdated
Show resolved
Hide resolved
sbom-utility-scripts/scripts/add-image-reference-script/README.md
Outdated
Show resolved
Hide resolved
sbom-utility-scripts/scripts/add-image-reference-script/README.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One CI thing, otherwise LGTM
e42c4a1
to
a642238
Compare
The CI is failing with
indentation problem I think |
The script is responsible for expanding a image sbom by adding a reference pointing to the image into a SBOM content. The script recognize an input format and adds necessary data into the list of components or packages. The script also sets a name of the SBOM based on a pullspec. JIRA: ISV-5411, ISV-5320 Signed-off-by: Ales Raszka <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Giving the team some time for review as well, will merge soon if no other comments |
The pending Konflux check is a false positive, this part of the code has no Konflux pipeline. Merging |
The script is responsible for expanding a image sbom by adding a reference pointing to the image into a SBOM content.
The script recognize an input format and adds necessary data into the list of components or packages. The script also sets a name of the SBOM based on a pullspec.
JIRA: ISV-5411, ISV-5320