slsa-github-generator icon indicating copy to clipboard operation
slsa-github-generator copied to clipboard

Dockerfile workflow

Open ianlewis opened this issue 2 years ago • 7 comments

We can provide a builder which builds a Docker image based on a Dockerfile as the build artifact and generate SLSA provenance for it.

ianlewis avatar May 18 '22 05:05 ianlewis

A good point of comparison would be the docker actions for building and pushing images. They use buildx in their case and support building for different architectures using qemu. https://github.com/marketplace/actions/build-and-push-docker-images

ianlewis avatar Jun 10 '22 06:06 ianlewis

Generating a provenance based off a Dockerfile is a great start. You may also want to see how the same could be done for builds using tools like ko and buildpacks. These are both very popular alternatives to managing Dockerfiles.

chipzoller avatar Jun 17 '22 12:06 chipzoller

For sure. I think @laurentsimon shared https://github.com/laurentsimon/slsa-github-generator-ko with you on slack maybe, but the idea is we will eventually merge that workflow here as well.

Buildpacks is a good idea but I think getting provenance generation for simple Dockerfiles working is probably a higher priority for now. We're happy to take issues and contributions if folks want to take on specific workflows or features.

ianlewis avatar Jun 17 '22 16:06 ianlewis

This sounds like it can be a very useful workflow. Any progress on it? Doesn't look like it has been picked yet.

tahirraza avatar Nov 04 '22 23:11 tahirraza

This sounds like it can be a very useful workflow. Any progress on it? Doesn't look like it has been picked yet.

Here is the top-level tracking issue: https://github.com/project-oak/transparent-release/issues/145 We hope to have an initial version by the end of Q4'22.

rbehjati avatar Nov 07 '22 12:11 rbehjati

Is this done?

raoganeshr avatar Sep 26 '23 06:09 raoganeshr

It is not. @ianlewis started it but it's not complete yet. Maybe in the meantime you could use:

  • https://github.com/slsa-framework/slsa-github-generator/tree/main/internal/builders/docker. You create an image as a dockerfile and use that to build your artifact. See https://slsa.dev/blog/2023/06/slsa-github-worfklows-container-based
  • https://github.com/slsa-framework/slsa-github-generator/tree/main/internal/builders/container build the docker image yourself and get an attestation for it

laurentsimon avatar Sep 27 '23 17:09 laurentsimon