[TEP 109] Add feature to extract structured signable targets and store them in subjects and materials in intoto provenance
Implementation of TEP 109. Example usage for Maven packages:
results:
- name: img_1-ARTIFACT_INPUTS
value:
uri: gcr.io/foo/bar
digest: sha123@qwe
- name: mvn1_pkg-ARTIFACT_OUTPUTS
value:
uri: maven-test-0.0.1.jar
digest: sha256@abc
- name: mvn1_pom-ARTIFACT_OUTPUTS
value:
uri: maven-test-0.0.1.pom
digest: sha256@def
- name: mvn1_src-ARTIFACT_OUTPUTS
value:
uri: maven-test-0.0.1-sources.jar
digest: sha256@xyz
From this, we will generate subjects in intoto provenence:
{"name": "maven-test-0.0.1.jar", "digest": {"sha256": "abc"}}
{"name": "maven-test-0.0.1.pom", "digest": {"sha256": "def"}}
{"name": "maven-test-0.0.1-sources.jar", "digest": {"sha256": "xyz"}}
In materials:
{"uri": "gcr.io/foo/bar", "digest": {"sha123": "qwe"}}
The feature requires Pipeline v0.38 or later.
/draft
The following is the coverage report on the affected files.
Say /test pull-tekton-chains-go-coverage to re-run this coverage report
| File | Old Coverage | New Coverage | Delta |
|---|---|---|---|
| pkg/artifacts/signable.go | 75.3% | 76.8% | 1.5 |
| pkg/chains/formats/intotoite6/intotoite6.go | 88.6% | 89.7% | 1.1 |
/open
/assign wlynch
The following is the coverage report on the affected files.
Say /test pull-tekton-chains-go-coverage to re-run this coverage report
| File | Old Coverage | New Coverage | Delta |
|---|---|---|---|
| pkg/artifacts/signable.go | 75.3% | 76.8% | 1.5 |
| pkg/chains/formats/intotoite6/intotoite6.go | 88.6% | 89.7% | 1.1 |
The following is the coverage report on the affected files.
Say /test pull-tekton-chains-go-coverage to re-run this coverage report
| File | Old Coverage | New Coverage | Delta |
|---|---|---|---|
| pkg/artifacts/signable.go | 68.9% | 70.5% | 1.6 |
| pkg/chains/formats/intotoite6/taskrun/taskrun.go | 74.6% | 76.7% | 2.1 |
/retest
@wlynch Hi Billy, do you mind reviewing this PR? Thanks!
The following is the coverage report on the affected files.
Say /test pull-tekton-chains-go-coverage to re-run this coverage report
| File | Old Coverage | New Coverage | Delta |
|---|---|---|---|
| pkg/artifacts/signable.go | 68.9% | 70.5% | 1.6 |
| pkg/chains/formats/intotoite6/taskrun/taskrun.go | 74.6% | 76.7% | 2.1 |
@ywluogg Can you please update https://github.com/tektoncd/chains/blob/main/docs/intoto.md#type-hinting to document the new type hinting fields xx_ARTIFACT_INPUTS and xx_ARTIFACT_OUTPUTS we are introducing here? Thanks
We might also need to change the function retrieveAllArtifactIdentifiers in https://github.com/tektoncd/chains/blob/main/pkg/chains/storage/grafeas/grafeas.go to get artifacts from StructuredTargets. Also please check if changes are needed for other storage as well.
/assign jagathprakash
We might also need to change the function retrieveAllArtifactIdentifiers in https://github.com/tektoncd/chains/blob/main/pkg/chains/storage/grafeas/grafeas.go to get artifacts from StructuredTargets. Also please check if changes are needed for other storage as well.
This is a great catch! Thanks @jagathprakash . I just changed that function in grafeas to get URIs directly from intoto subjects instead of calling individual helpers. In future, we don't need to worry the changes made to the Subject function in other places then. So let's keep this out of scope of this PR for now.
We might also need to change the function retrieveAllArtifactIdentifiers in https://github.com/tektoncd/chains/blob/main/pkg/chains/storage/grafeas/grafeas.go to get artifacts from StructuredTargets. Also please check if changes are needed for other storage as well.
This is a great catch! Thanks @jagathprakash . I just changed that function in grafeas to get URIs directly from intoto subjects instead of calling individual helpers. In future, we don't need to worry the changes made to the Subject function in other places then. So let's keep this out of scope of this PR for now.
Thanks @chuangw6 for fixing this.
The following is the coverage report on the affected files.
Say /test pull-tekton-chains-go-coverage to re-run this coverage report
| File | Old Coverage | New Coverage | Delta |
|---|---|---|---|
| pkg/artifacts/signable.go | 68.9% | 62.5% | -6.4 |
| pkg/chains/formats/intotoite6/pipelinerun/pipelinerun.go | 76.7% | 77.3% | 0.5 |
| pkg/chains/formats/intotoite6/taskrun/taskrun.go | 74.6% | 75.0% | 0.4 |
The following is the coverage report on the affected files.
Say /test pull-tekton-chains-go-coverage to re-run this coverage report
| File | Old Coverage | New Coverage | Delta |
|---|---|---|---|
| pkg/artifacts/signable.go | 68.9% | 62.5% | -6.4 |
| pkg/chains/formats/intotoite6/pipelinerun/pipelinerun.go | 76.7% | 77.3% | 0.5 |
| pkg/chains/formats/intotoite6/taskrun/taskrun.go | 74.6% | 75.0% | 0.4 |
/hold
@ywluogg Can you please update https://github.com/tektoncd/chains/blob/main/docs/intoto.md#type-hinting to document the new type hinting fields
xx_ARTIFACT_INPUTSandxx_ARTIFACT_OUTPUTSwe are introducing here? Thanks
Will do!
The following is the coverage report on the affected files.
Say /test pull-tekton-chains-go-coverage to re-run this coverage report
| File | Old Coverage | New Coverage | Delta |
|---|---|---|---|
| pkg/artifacts/signable.go | 68.9% | 62.5% | -6.4 |
| pkg/chains/formats/intotoite6/pipelinerun/pipelinerun.go | 76.7% | 77.3% | 0.5 |
| pkg/chains/formats/intotoite6/taskrun/taskrun.go | 74.6% | 75.0% | 0.4 |
The following is the coverage report on the affected files.
Say /test pull-tekton-chains-go-coverage to re-run this coverage report
| File | Old Coverage | New Coverage | Delta |
|---|---|---|---|
| pkg/artifacts/signable.go | 68.9% | 62.5% | -6.4 |
| pkg/chains/formats/intotoite6/pipelinerun/pipelinerun.go | 76.7% | 77.3% | 0.5 |
| pkg/chains/formats/intotoite6/taskrun/taskrun.go | 74.6% | 75.0% | 0.4 |
The following is the coverage report on the affected files.
Say /test pull-tekton-chains-go-coverage to re-run this coverage report
| File | Old Coverage | New Coverage | Delta |
|---|---|---|---|
| pkg/artifacts/signable.go | 68.9% | 59.2% | -9.7 |
| pkg/chains/formats/intotoite6/pipelinerun/pipelinerun.go | 76.7% | 77.0% | 0.3 |
| pkg/chains/formats/intotoite6/taskrun/taskrun.go | 74.6% | 75.0% | 0.4 |
The following is the coverage report on the affected files.
Say /test pull-tekton-chains-go-coverage to re-run this coverage report
| File | Old Coverage | New Coverage | Delta |
|---|---|---|---|
| pkg/artifacts/signable.go | 68.9% | 59.2% | -9.7 |
| pkg/chains/formats/intotoite6/pipelinerun/pipelinerun.go | 76.7% | 77.0% | 0.3 |
| pkg/chains/formats/intotoite6/taskrun/taskrun.go | 74.6% | 75.0% | 0.4 |
The following is the coverage report on the affected files.
Say /test pull-tekton-chains-go-coverage to re-run this coverage report
| File | Old Coverage | New Coverage | Delta |
|---|---|---|---|
| pkg/artifacts/signable.go | 68.9% | 59.2% | -9.7 |
| pkg/chains/formats/intotoite6/pipelinerun/pipelinerun.go | 76.7% | 77.0% | 0.3 |
| pkg/chains/formats/intotoite6/taskrun/taskrun.go | 74.6% | 75.0% | 0.4 |
The following is the coverage report on the affected files.
Say /test pull-tekton-chains-go-coverage to re-run this coverage report
| File | Old Coverage | New Coverage | Delta |
|---|---|---|---|
| pkg/chains/formats/intotoite6/pipelinerun/pipelinerun.go | 76.7% | 77.5% | 0.8 |
| pkg/chains/formats/intotoite6/taskrun/taskrun.go | 74.6% | 75.7% | 1.1 |
The following is the coverage report on the affected files.
Say /test pull-tekton-chains-go-coverage to re-run this coverage report
| File | Old Coverage | New Coverage | Delta |
|---|---|---|---|
| pkg/artifacts/signable.go | 68.9% | 74.1% | 5.2 |
| pkg/chains/formats/intotoite6/pipelinerun/pipelinerun.go | 76.7% | 77.5% | 0.8 |
| pkg/chains/formats/intotoite6/taskrun/taskrun.go | 74.6% | 75.7% | 1.1 |
The following is the coverage report on the affected files.
Say /test pull-tekton-chains-go-coverage to re-run this coverage report
| File | Old Coverage | New Coverage | Delta |
|---|---|---|---|
| pkg/chains/formats/intotoite6/pipelinerun/pipelinerun.go | 76.7% | 77.5% | 0.8 |
| pkg/chains/formats/intotoite6/taskrun/taskrun.go | 74.6% | 75.7% | 1.1 |
The following is the coverage report on the affected files.
Say /test pull-tekton-chains-go-coverage to re-run this coverage report
| File | Old Coverage | New Coverage | Delta |
|---|---|---|---|
| pkg/artifacts/signable.go | 68.9% | 73.8% | 4.8 |
| pkg/chains/formats/intotoite6/pipelinerun/pipelinerun.go | 76.7% | 77.5% | 0.8 |
| pkg/chains/formats/intotoite6/taskrun/taskrun.go | 74.6% | 75.7% | 1.1 |
The following is the coverage report on the affected files.
Say /test pull-tekton-chains-go-coverage to re-run this coverage report
| File | Old Coverage | New Coverage | Delta |
|---|---|---|---|
| pkg/artifacts/signable.go | 68.9% | 73.8% | 4.8 |
| pkg/chains/formats/intotoite6/extract/extract.go | Do not exist | 51.4% | |
| pkg/chains/formats/intotoite6/pipelinerun/pipelinerun.go | 76.7% | 77.5% | 0.8 |
| pkg/chains/formats/intotoite6/taskrun/taskrun.go | 74.6% | 75.7% | 1.1 |
The following is the coverage report on the affected files.
Say /test pull-tekton-chains-go-coverage to re-run this coverage report
| File | Old Coverage | New Coverage | Delta |
|---|---|---|---|
| pkg/artifacts/signable.go | 68.9% | 73.8% | 4.8 |
| pkg/chains/formats/intotoite6/extract/extract.go | Do not exist | 51.4% | |
| pkg/chains/formats/intotoite6/pipelinerun/pipelinerun.go | 76.7% | 77.3% | 0.5 |
| pkg/chains/formats/intotoite6/taskrun/taskrun.go | 74.6% | 75.7% | 1.1 |
The following is the coverage report on the affected files.
Say /test pull-tekton-chains-go-coverage to re-run this coverage report
| File | Old Coverage | New Coverage | Delta |
|---|---|---|---|
| pkg/artifacts/signable.go | 68.9% | 73.8% | 4.8 |
| pkg/chains/formats/intotoite6/extract/extract.go | Do not exist | 51.4% | |
| pkg/chains/formats/intotoite6/pipelinerun/pipelinerun.go | 76.7% | 77.3% | 0.5 |
| pkg/chains/formats/intotoite6/taskrun/taskrun.go | 74.6% | 75.4% | 0.7 |