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

buildah/0.3: support generating SPDX SBOMs #1825

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

chmeliik
Copy link
Contributor

See commit messages for more details

Depends on #1798 and a subsequent Renovate update (the current revision of the sbom-utility-scripts image doesn't include the SPDX support yet)

Tested in redhat-appstudio/rh-syft#105 (using a test build of the sbom-utility-scripts image)

Merge all the syft SBOMs with the cachi2 SBOM (if present) using the
merge_sboms.py script, which supports this since
konflux-ci/build-tasks-dockerfiles#208

Also change the shebang to #/bin/bash with the usual 'set' options to
avoid ShellCheck warnings about arrays being undefined in Posix sh.

Signed-off-by: Adam Cmiel <[email protected]>
Add an SBOM_TYPE parameter, defaulting to 'cyclonedx' for now. This
parameter determines the format of the Syft-generated SBOMs. These must
match the format of the SBOM coming from the prefetch task (if any),
otherwise the SBOM merging will fail.

Only the 0.3 version gets this parameter. The 0.2 version still has the
Java SBOM code, whose SPDX support status is unknown.

Signed-off-by: Adam Cmiel <[email protected]>
For SPDX, the add_image_reference script has to run before the
base_images script.

The reason: for each base image, the base_images script also adds
a `<base image> BUILD_TOOL_OF <output image>` relationship to the SBOM.
The script identifies the output image by searching for
`<document root> DESCRIBES <package>` relationships and checks that
there is exactly one such relationship. Before the add_image_reference
script runs, there can be multiple DESCRIBES relationships.

Signed-off-by: Adam Cmiel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant