-
Notifications
You must be signed in to change notification settings - Fork 18
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
Container provenance #88
Conversation
d4a0eb4
to
7c55097
Compare
Generating the provenance works now. $ bin/slsa-provenance generate -github_context "{… left for brevity … }" -runner_context '{}' -container_repo ghcr.io/philips-labs/slsa-provenance -container_tags 'v0.4.0 33ba3da2213c83ce02df0f2f6ba925ec79037f9d' -artifact_path README.md -container_digest sha256:194b471a878add368bf02a7935fa099024576c029491bcefaeb87f81efa093a3
Generating provenance for 'ghcr.io/philips-labs/slsa-provenance' tags:
- v0.4.0
- 33ba3da2213c83ce02df0f2f6ba925ec79037f9d
Saving provenance to build.provenance
$ cat build.provenance
{
"_type": "https://in-toto.io/Statement/v0.1",
"subject": [
{
"name": "ghcr.io/philips-labs/slsa-provenance:v0.4.0",
"digest": {
"sha256": "194b471a878add368bf02a7935fa099024576c029491bcefaeb87f81efa093a3"
}
},
{
"name": "ghcr.io/philips-labs/slsa-provenance:33ba3da2213c83ce02df0f2f6ba925ec79037f9d",
"digest": {
"sha256": "194b471a878add368bf02a7935fa099024576c029491bcefaeb87f81efa093a3"
}
}
],
"predicateType": "https://slsa.dev/provenance/v0.2",
"predicate": {
"builder": {
"id": "https://github.com/philips-labs/slsa-provenance-action/Attestations/SelfHostedActions@v1"
},
"buildType": "https://github.com/Attestations/GitHubActionsWorkflow@v1",
"invocation": {
"configSource": {
"entryPoint": "Integration test file provenance",
"uri": "git+https://github.com/philips-labs/slsa-provenance-action",
"digest": {
"sha1": "c4f679f131dfb7f810fd411ac9475549d1c393df"
}
},
"parameters": null,
"environment": null
},
"metadata": {
"buildInvocationId": "https://github.com/philips-labs/slsa-provenance-action/actions/runs/1332651620",
"buildFinishedOn": "2021-11-22T15:35:01Z",
"completeness": {
"parameters": true,
"environment": false,
"materials": false
},
"reproducible": false
},
"materials": [
{
"uri": "git+https://github.com/philips-labs/slsa-provenance-action",
"digest": {
"sha1": "c4f679f131dfb7f810fd411ac9475549d1c393df"
}
}
]
}
} Codebase needs cleanup before merge as explained in #93 to make this more predictable. |
c1a49e7
to
0e46eaa
Compare
Codecov Report
@@ Coverage Diff @@
## main #88 +/- ##
==========================================
+ Coverage 78.21% 78.33% +0.11%
==========================================
Files 12 15 +3
Lines 505 623 +118
==========================================
+ Hits 395 488 +93
- Misses 76 95 +19
- Partials 34 40 +6
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
4d7e48c
to
a5f7cb7
Compare
791aaf0
to
512b525
Compare
0d8322c
to
90b6047
Compare
Hey Marco! Quick question.. if a tag is specified, wouldn't it be possible to determine the digest of the image outwith the binary? and therefore no need for a parameter? |
31d9068
to
b6d870d
Compare
@ChaosInTheCRD I have been trying to get the image digest in various ways. The image digest is only available after pushing the image to a registry. Currently we use the approach to run the provenance in a clean Github actions runner, by running that step in a separate job to not have any side effects from prior steps. Besides that consumers of this Github Action might have their own versioning strategy of their docker images. So in that case we do not know for which tags we have to do the provenance. Therefore I decided to take the input arguments for now, to keep that flexibility. Then my code is verifying that image digest matches up with the tags to have some kind of validation. Totally agree this is not the cleanest and easiest approach, but it also seems docker/oci registries have a way to pull all image tags for a given digest. Preferably I would have pulled all the tags from a given repository by digest. In that case I only need 2 arguments to pull all the images by digest and have this integrated in our CLI. |
@marcofranssen thanks for the reply. I think the decision to allow the user to pass in the digest, and compare it (see here) against the tags provided is a good idea for validation purposes. I guess you could argue that getting the digest for the image built in the workflow is out-with the scope of the action. |
I am considering whether expanding this command to also include flags that allow the user to present a provenance key to sign and upload the image to the registry would be worthwhile. However, this would clash with #91 |
Once both PRs are ready I would love to reuse the signing logic and also do the attaching to docker image automagically. Just like we do with the github-release subcommand that auto uploads the provenance to the github release |
What I want to know @marcofranssen is whether the SLSA framework advocates for knitting the provenance generation, signing and uploading as close as possible. My rationale is, if I create the provenance with
Maybe someone from the SLSA team could comment 😊 |
Oh I see I am confused here. Does the github-release subcommand auto-upload the provenance straight after its generation? Meaning no need to save the provenance to disk? |
cdccf62
to
474fee8
Compare
Signed-off-by: Marco Franssen <[email protected]>
474fee8
to
38647bf
Compare
Co-authored-by: Jeroen Knoops <[email protected]> Signed-off-by: Marco Franssen <[email protected]>
Co-authored-by: Jeroen Knoops <[email protected]> Signed-off-by: Marco Franssen <[email protected]>
Signed-off-by: Marco Franssen <[email protected]>
Signed-off-by: Marco Franssen <[email protected]>
Signed-off-by: Marco Franssen <[email protected]>
38647bf
to
0fb7b57
Compare
Signed-off-by: Marco Franssen <[email protected]>
Signed-off-by: Marco Franssen <[email protected]>
Signed-off-by: Marco Franssen <[email protected]>
Signed-off-by: Marco Franssen <[email protected]>
7d14248
to
7b62f2c
Compare
Signed-off-by: Marco Franssen <[email protected]>
Signed-off-by: Marco Franssen <[email protected]>
Signed-off-by: Marco Franssen <[email protected]>
Signed-off-by: Marco Franssen <[email protected]>
7b62f2c
to
204d953
Compare
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.
Awesome!!!
resolves #73