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

feat: use docker buildx to create attestation files. #387

Closed
wants to merge 0 commits into from

Conversation

jvanz
Copy link
Member

@jvanz jvanz commented Oct 1, 2024

Description

Updates the Github workflow to use the Docker buildx to generate the SLSA attestation and SBOM files. Furthermore, the previous workflow used to generate the SBOM files has been updated to download the data from the container registry and upload them to the release page as it does before.

Fix #384

@jvanz jvanz self-assigned this Oct 1, 2024
Copy link

codecov bot commented Oct 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.39%. Comparing base (7c28dee) to head (c8e34f7).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #387   +/-   ##
=======================================
  Coverage   72.39%   72.39%           
=======================================
  Files          11       11           
  Lines        1228     1228           
=======================================
  Hits          889      889           
  Misses        266      266           
  Partials       73       73           
Flag Coverage Δ
unit-tests 72.39% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jvanz jvanz force-pushed the main branch 7 times, most recently from 1d2c492 to 5db79e1 Compare October 2, 2024 20:09
@jvanz jvanz marked this pull request as ready for review October 2, 2024 20:23
@jvanz jvanz requested a review from a team as a code owner October 2, 2024 20:23
@jvanz jvanz changed the title feat: enable provenance and SBOM in Docker build feat: use docker buildx to create attestation files. Oct 2, 2024
Copy link
Member

@flavio flavio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, I left one minor comment.

I think we should also provide instructions about:

  • How to download the SBOM and provenance files from our repository
  • How to verify the SBOM and provenance files published on our repository
  • How to verify the SBOM and provenance files attached to our GH release

These instructions could be part of our README.md file, we've already this section talking about the SBOM.

.github/workflows/release.yml Outdated Show resolved Hide resolved
.github/workflows/sbom.yml Outdated Show resolved Hide resolved
.github/workflows/sbom.yml Outdated Show resolved Hide resolved
@jvanz jvanz force-pushed the main branch 5 times, most recently from 3e9cf75 to 6855b15 Compare October 3, 2024 21:00
Copy link
Member

@flavio flavio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but please don't forget to update the README as I requested inside of this comment

Copy link
Member

@viccuad viccuad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but we need to pass BUILDKIT_SBOM_SCAN_STAGE=true on the Dockerfile.

For the readme (just in case), we could tell the users to use the following instead of crane:

$ docker buildx imagetools inspect <namespace>/<image>:<version> \
      --format "{{ json .SBOM.SPDX }}"
$  docker buildx imagetools inspect <namespace>/<image>:<version> \
    --format "{{ json .Provenance.SLSA }}"

.github/workflows/container-image.yml Outdated Show resolved Hide resolved
.github/workflows/attestation.yml Outdated Show resolved Hide resolved
.github/workflows/attestation.yml Outdated Show resolved Hide resolved
.github/workflows/attestation.yml Outdated Show resolved Hide resolved
.github/workflows/attestation.yml Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@jvanz jvanz force-pushed the main branch 5 times, most recently from 586c25f to dd280a2 Compare October 8, 2024 20:49
@jvanz jvanz requested a review from pjbgf October 8, 2024 20:49
@jvanz
Copy link
Member Author

jvanz commented Oct 8, 2024

@pjbgf @kubewarden/kubewarden-developers I've updated the PR to have a checksum file for the SBOM and provenance files and verify the signatures using full URL.

Copy link
Contributor

@jhkrug jhkrug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor suggestions for consideration.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Copy link
Contributor

@jhkrug jhkrug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more minor suggestion

README.md Outdated Show resolved Hide resolved
@jvanz jvanz force-pushed the main branch 5 times, most recently from 1394b6f to cee5491 Compare October 11, 2024 13:00
Copy link

@pjbgf pjbgf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small nits, otherwise LGTM.

README.md Outdated Show resolved Hide resolved
.github/workflows/attestation.yml Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@jvanz jvanz force-pushed the main branch 2 times, most recently from 28a9f65 to a62fb99 Compare October 11, 2024 13:16
@jvanz jvanz requested a review from pjbgf October 11, 2024 13:17
Copy link

@pjbgf pjbgf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@viccuad viccuad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

.github/workflows/container-image.yml Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@viccuad
Copy link
Member

viccuad commented Oct 18, 2024

I'm sorry, while fixing the conflicts, and pushing I managed to incorrectly close this PR. Opened #397 as a follow-up with the conflicts fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ensure SLSA Lvl 3 in audit-scanner
5 participants