-
- Notifications
You must be signed in to change notification settings - Fork 1
Publish SBOMs for operator images #312
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
Conversation
lfrancke left a comment
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.
I haven't checked but I assume shellcheck would complain about missing double quotes everywhere.
Could you run it through shellcheck?
I think I can't |
lfrancke left a comment
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.
I just copied all of it into a shell file and ran shellcheck, no need for it to actually run the script :)
Co-authored-by: Lars Francke <lars.francke@stackable.tech>
Co-authored-by: Lars Francke <lars.francke@stackable.tech>
| Yes, I was confused by this in the beginning as well. The thing that's stored in Harbor is not directly the SBOM itself, but an in-toto attestation wrapped in a DSSE envelope (that's the one carrying the signature metadata). These attestations are tagged with the digest of the artifacts it's attached to and a ".att" suffix ("sha256-20f210167078941709d63ec7b7d9b004a95932148ece9a05a9fe73c55d874f0a.att"). This is similar to signatures (there it's a .sig suffix). So the signature is an "attachment" (via this special tag) to the artifact, containing nothing but the data about the signing process and the signature itself. The SBOM attestation artifact contains the signature plus the base64 encoded SBOM. Harbor supports displaying signature artifacts that are attached to an OCI artifact (those OCI artifacts are then displayed as "signed"). But the SBOM attestation contains the signature in itself (there's no .sig artifact attached to it). That's why it's not displayed as "signed", even though it is (otherwise the cosign verification command would fail). I can try to explain more if needed 🙂 I traversed the whole "attestation verifiaction" flow with |
| Pewww....that comment needs to be captured somewhere. Okay, we can do this as a separate documentation issue, but: We somehow need (I think) an "easy" way for people to download the SBOMs. This can be a separate step where we upload them somewhere for example, |
| Yep. Maybe we can publish them as JSON in separate places (tbd where exactly). I think the current place (Harbor) is more suitable for a "machine-readable" use case: Customers wanting to enforce that all Stackable containers in their cluster have a valid SBOM (signed by one of Stackable's GH Action Workflows) attached. It is possible to get the verified SBOM out of Harbor (with the |

Fixes stackabletech/issues#398.
Successful test run with airflow-operator: https://github.com/stackabletech/airflow-operator/actions/runs/7652323720/job/20851912198
The verified SBOM for the airflow-operator can be fetched with:
Notes and possible next steps:
${DOCKER_REPO}/${ORGANIZATION}/${OPERATOR_NAME}:@$$REPO_DIGEST_OF_IMAGEwhich results in something likeoci.stackable.tech/sdp/airflow-operator:@sha256:b2707e4a282844d314aa4ee261b4680c91c0c5f484ed6d235282d7c4ff10bda2, which is an invalid reference (but cosign ignored it and treated it correctly). Now it's...airflow-operator@sha256:b27...instead of...airflow-operator:@sha256:b27...(first colon removed).Makefile. They look like this:pkg:docker/sdp/airflow-operator@sha256:50c2df6011949ded5e17cf1c85facf568ffdcca679664feb540dd300ea7c07f5?repository_url=oci.stackable.tech. I verified that one using packageurl.rs:.metadata.properties. This includes a description of the UBI minimal image, which we could remove from the image labels during the build process./usr/libexec/platform-python3.6), we could check whether it's needed and where it comes from.cargo cyclonedx), once with the operator binary as source. This did not happen on Linux (even though it was the same version), there it only reported the crates with the SBOM as source (which is what we want). I haven't debugged this further and just passed the--exclude "/usr/local/bin/stackable-${OPERATOR_NAME}"flag to Syft to make sure it does not try to analyze the binary, that way it produced the correct output for me on MacOS and Linux.