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

[Epic] provenance generation #856

Open
flavio opened this issue Aug 29, 2024 · 0 comments
Open

[Epic] provenance generation #856

flavio opened this issue Aug 29, 2024 · 0 comments

Comments

@flavio
Copy link
Member

flavio commented Aug 29, 2024

The SLSA requirements define that the provenance must unambiguously identify the output package by cryptographic digest, while also describing how the package was produced. Although SLSA Provenance v1 is recommended, there are no hard requirements on provenance format. Note that Docker buildx only supports v0.2, the upgrade is already on their backlog.

Both the SPDX SBOM and the Provenance can be embedded on a container image at building time by adding two flags to the docker buildx build command:

docker buildx build --push --sbom=true --attest type=provenance,mode=max -t "${IMAGE}" -f Dockerfile .

The provenance must account for the entire build process. When the build process is happening within the Docker buildx context, for example, the building of binaries or fetching of external dependencies must take place within one of the layers of a multi-staged container image.

No pre-built artefacts should be copied into a container image, unless that is tied to a specific version followed by some level of integrity checks. This is something to keep in mind while building the Policy Server container image, since right now the policy-server binary is built with cross-rs and then copied into the image.

The GitHub action docker/build-push-action, can enable the provenance and SBOM by adding these two lines:

     - name: Build and push image
       uses: docker/build-push-action@v6
       with:
         sbom: true
         provenance: mode=max
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

1 participant