-
Notifications
You must be signed in to change notification settings - Fork 130
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
Support new predicate type for pipelineRun resource #824
Comments
I'm generally fine with this as long as it's gated by config! Is the idea roughly to dump the Run object as it's own intoto predicate? Might be worth throwing together an example. 🤔 /cc @chitrangpatel who might have feedback. |
The SLSA1.0 predicate for chains is designed here. TL;DR:
Would this design cover most of your use cases? Note that we have already started to implement this design as a part of Issue #797 I agree with @wlynch that if there are major deviations from this design then we should definitely gate it by config into a new type. A couple of examples covering different use cases would definitely help here!! |
The SLSA1.0 predicate does cover most of the use cases. The two cases it doesn't cover are the need for the underlying taskRun results and the list of tasks the pipeline ran. The latter is in the pipelineRun spec only if the pipelineSpec is in-lined. The proposal included the whole pipelineRun since having the whole resource in one document may make it easier to evaluate with a policy, but including the underlying taskRuns and pipelineRun status will meet our needs. I will create some examples like in the document @chitrangpatel shared. Thanks! |
Here is an example proposal for the new predicate. The main purpose is so the task results can be evaluated and to capture task information that would only be included in the SLSAv1.0 predicate if the pipelineSpec is in-line. Some of the questions this can answer are inline. This is mostly the buildConfig from SLSAv0.2.
|
Thanks @joejstuart for that example. Some more thoughts: This is what I was imagining:
Alternatively, we could also store the complete
status:
childReferences:
- apiVersion: tekton.dev/v1beta1
kind: TaskRun
name: recipe-time-m2z8r-fetch-the-recipe
pipelineTaskName: fetch-the-recipe
- apiVersion: tekton.dev/v1beta1
kind: TaskRun
name: recipe-time-m2z8r-print-the-recipe
pipelineTaskName: print-the-recipe
completionTime: "2023-06-15T18:40:04Z"
conditions:
- lastTransitionTime: "2023-06-15T18:40:04Z"
message: 'Tasks Completed: 2 (Failed: 0, Cancelled 0), Skipped: 0'
reason: Succeeded
status: "True"
type: Succeeded
pipelineSpec:
tasks:
- name: fetch-the-recipe
taskRef:
kind: Task
name: fetch-secure-data
workspaces:
- name: shared-data
- name: print-the-recipe
runAfter:
- fetch-the-recipe
taskSpec:
metadata: {}
spec: null
steps:
- computeResources: {}
image: ubuntu
name: print-secrets
script: cat $(workspaces.shared-data.path)/recipe.txt
startTime: "2023-06-15T18:39:38Z"
... WDYT? |
I'm mostly concerned with just having that data available. I also think having to use two attestations to evaluate a build is more of a pain than having it in one place and the |
My only friction with putting everything in one place is that it goes against the guidelines suggested by SLSA. I totally see the value in having it all in one place. I can see how a Tekton build verifier might benefit a lot from this. However generic SLSA verifiers will have trouble because it gets too Tekton-specific (especially if the information is not where its supposed to be according to SLSA). Like @wlynch said, if we want to just dump the entire run object as its own predicate, we could do that but gated by config. And may be that could be of better use to Tekton verifiers. But for SLSA predicate, we should try to be in-line with what their recommendations are. |
@chitrangpatel Sorry for the delay in my response. After looking at the SLSAV1.0 spec and reviewing what chains is capturing, I think your first comment makes a lot of sense to store the pipelineSpec/taskSpec (in the non-embedded case) in As for the new predicate type, I think that would be beneficial at some point, but having the above information would be a higher priority for my use cases. |
Created an issue #834 to deal with pipelineSpec and taskSpec in resolved dependencies. |
Thank you! |
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
Stale issues rot after 30d of inactivity. /lifecycle rotten Send feedback to tektoncd/plumbing. |
Feature request
Since the buildConfig field is removed in the SLSA v1 spec, I propose that chains supports a new predicate type to store the pipelineRun and expanded taskRun resources.
This issue was originally brought up in #750.
Use case
The SLSA V1 spec can meet some of these, but not all. For example, the taskRun results need the taskRun resources to be expanded and to verify the taskRun order, the pipelineRun status is needed. Therefore, a new predicate type that contains the pipelineRun status and expanded taskRuns is proposed. I also think including the pipelineRun spec would be a good idea, because that would allow for the whole pipelineRun to be evaluated at once.
The text was updated successfully, but these errors were encountered: