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

Inconsistent merging of upstream source packages from package SBOM into image SBOM #1507

Open
luhring opened this issue Jan 31, 2025 · 0 comments

Comments

@luhring
Copy link
Member

luhring commented Jan 31, 2025

In chainguard-dev/melange#1474, we updated melange to include SPDX packages in APK SBOMs to represent upstream sources (such as what's found in git-checkout and fetch pipeline steps).

And in #1366, we fixed up some of the apko SBOM logic to account for melange's SBOM enhancements in the image SBOMs.

However, now we're seeing instances of upstream source packages missing from the image SBOM. For example, the Chainguard Image cgr.dev/chainguard/jdk uses the Wolfi package ca-certificates-bundle, which exposes its upstream source in its package SBOM (see SPDX package with ID SPDXRef-Package-gitlab.alpinelinux.org-alpine-ca-certificates...). But that SPDX package is not found in the jdk image's SBOM.

cosign download attestation \
  --platform linux/amd64 \
  --predicate-type=https://spdx.dev/Document \
  cgr.dev/chainguard/jdk:latest | \
  jq '.payload | @base64d | fromjson | .predicate' | \
  grep 'SPDXRef-Package-gitlab.alpinelinux.org-alpine-ca-certificates'

Even stranger, it looks like sometimes this problem doesn't happen. The image cgr.dev/chainguard/go similarly uses ca-certificates-bundle, and its image SBOM does have the upstream source package intact.

cosign download attestation \
  --platform linux/amd64 \
  --predicate-type=https://spdx.dev/Document \
  cgr.dev/chainguard/go:latest | \
  jq '.payload | @base64d | fromjson | .predicate' | \
  grep 'SPDXRef-Package-gitlab.alpinelinux.org-alpine-ca-certificates'

We need to ensure that apko is consistently including all relevant information from the SBOMs of the packages that comprise the image into the image's SBOM.

cc: @dustinkirkland

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

No branches or pull requests

1 participant