Skip to content

Commit

Permalink
Record invocation.configSource section in slsa provenance
Browse files Browse the repository at this point in the history
Related to tektoncd#521 and tektoncd/pipeline#5397

Prior to this PR, `invocation.configSource` section in slsa provenance
was missing.

In this change, we want to record the configSource information for the
remote resources i.e. git, bundle, catalog.

Signed-off-by: Chuang Wang <[email protected]>
  • Loading branch information
chuangw6 committed Nov 18, 2022
1 parent 40b43e9 commit 6f8ce45
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 94 deletions.
7 changes: 7 additions & 0 deletions pkg/chains/formats/intotoite6/intotoite6_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,13 @@ func TestTaskRunCreatePayload2(t *testing.T) {
{URI: "git+https://git.test.com.git", Digest: slsa.DigestSet{"sha1": "sha:taskdefault"}},
},
Invocation: slsa.ProvenanceInvocation{
ConfigSource: slsa.ConfigSource{
URI: "https://github.com/test/tekton-test.git",
Digest: slsa.DigestSet{
"sha256": "123fdf35b4e7b1a56a84b2796aab2827edd65c25",
},
EntryPoint: "task.yaml",
},
Parameters: map[string]v1beta1.ArrayOrString{
"CHAINS-GIT_COMMIT": {Type: "string", StringVal: "sha:taskdefault"},
"CHAINS-GIT_URL": {Type: "string", StringVal: "https://git.test.com"},
Expand Down
188 changes: 94 additions & 94 deletions pkg/chains/formats/intotoite6/testdata/taskrun2.json
Original file line number Diff line number Diff line change
@@ -1,96 +1,96 @@
{
"metadata": {
"name": "git-clone",
"labels": {
"tekton.dev/pipelineTask": "git-clone"
}
},
"spec": {
"params": [
{
"name": "url",
"value": "https://git.test.com"
},
{
"name": "revision",
"value": ""
}
],
"taskRef": {
"name": "git-clone",
"kind": "Task"
},
"serviceAccountName": "default"
},
"status": {
"startTime": "2021-03-29T09:50:00Z",
"completionTime": "2021-03-29T09:50:15Z",
"conditions": [
{
"type": "Succeeded",
"status": "True",
"lastTransitionTime": "2021-03-29T09:50:15Z",
"reason": "Succeeded",
"message": "All Steps have completed executing"
}
],
"podName": "test-pod-name",
"steps": [
{
"name": "step1",
"container": "step-step1",
"imageID": "docker-pullable://gcr.io/test1/test1@sha256:d4b63d3e24d6eef04a6dc0795cf8a73470688803d97c52cffa3c8d4efd3397b6"
}
],
"taskResults": [
{
"name": "some-uri_DIGEST",
"value": "sha256:d4b63d3e24d6eef04a6dc0795cf8a73470688803d97c52cffa3c8d4efd3397b6"
},
{
"name": "some-uri",
"value": "pkg:deb/debian/[email protected]"
}
],
"taskSpec": {
"steps": [
{
"env": [
{
"name": "HOME",
"value": "$(params.userHome)"
},
{
"name": "PARAM_URL",
"value": "$(params.url)"
}
],
"name": "step1",
"script": "git clone"
}
],
"params": [
{
"name": "CHAINS-GIT_COMMIT",
"type": "string",
"default": "sha:taskdefault"
},
{
"name": "CHAINS-GIT_URL",
"type": "string",
"default": "https://git.test.com"
}
],
"results": [
{
"name": "some-uri_DIGEST",
"description": "Digest of a file to push."
},
{
"name": "some-uri",
"description": "some calculated uri"
}
]
}
}
"metadata": {
"name": "git-clone",
"labels": {
"tekton.dev/pipelineTask": "git-clone"
}
},
"spec": {
"params": [
{
"name": "url",
"value": "https://git.test.com"
},
{
"name": "revision",
"value": ""
}
],
"taskRef": {
"name": "git-clone",
"kind": "Task"
},
"serviceAccountName": "default"
},
"status": {
"startTime": "2021-03-29T09:50:00Z",
"completionTime": "2021-03-29T09:50:15Z",
"conditions": [
{
"type": "Succeeded",
"status": "True",
"lastTransitionTime": "2021-03-29T09:50:15Z",
"reason": "Succeeded",
"message": "All Steps have completed executing"
}
],
"podName": "test-pod-name",
"steps": [
{
"name": "step1",
"container": "step-step1",
"imageID": "docker-pullable://gcr.io/test1/test1@sha256:d4b63d3e24d6eef04a6dc0795cf8a73470688803d97c52cffa3c8d4efd3397b6"
}
],
"taskResults": [
{
"name": "some-uri_DIGEST",
"value": "sha256:d4b63d3e24d6eef04a6dc0795cf8a73470688803d97c52cffa3c8d4efd3397b6"
},
{
"name": "some-uri",
"value": "pkg:deb/debian/[email protected]"
}
],
"taskSpec": {
"steps": [
{
"env": [
{
"name": "HOME",
"value": "$(params.userHome)"
},
{
"name": "PARAM_URL",
"value": "$(params.url)"
}
],
"name": "step1",
"script": "git clone"
}
],
"params": [
{
"name": "CHAINS-GIT_COMMIT",
"type": "string",
"default": "sha:taskdefault"
},
{
"name": "CHAINS-GIT_URL",
"type": "string",
"default": "https://git.test.com"
}
],
"results": [
{
"name": "some-uri_DIGEST",
"description": "Digest of a file to push."
},
{
"name": "some-uri",
"description": "some calculated uri"
}
]
}
}
}

0 comments on commit 6f8ce45

Please sign in to comment.