-
Notifications
You must be signed in to change notification settings - Fork 51
Skip keyless image signature checks in tekton tasks #3191
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -371,9 +371,16 @@ spec: | |
| ) | ||
| fi | ||
|
|
||
| # Force --ignore-rekor to false since we need rekor | ||
| cmd_args+=( | ||
| # Force --ignore-rekor to false since we need rekor | ||
| --ignore-rekor=false | ||
|
|
||
| # Conforma expects that the attestation and the image are signed in the | ||
| # same way. But actually for Tekton Chains doing keyless signing that's | ||
| # not the cases. As a workaround, skip the image sig check and only do the | ||
| # attestation sig check. This means we're expecting the --certificate-* | ||
| # params provided to be applicable for verifying the attestation signature. | ||
| --skip-image-sig-check=true | ||
| ) | ||
|
Comment on lines
+375
to
384
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid unconditional Line 383 applies the same implicit weakening of verification guarantees: any keyless run skips image signature checks. This should be controlled by an explicit task param (default As per coding guidelines, 🤖 Prompt for AI Agents
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a reasonable suggestion, but I don't want to add that right now. I know the only use case for this task is with Tekton Chains produced signatures, and I know (or at least I'm fairly certain) we'll have to skip the image sig check for those. I don't want to force consumers of these tasks (i.e. the Konflux release pipeline) to have to introduce a new param to make things work. I like the idea of making "default to more secure", but for now we're preferring "default to most likely to work". There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| else | ||
| # Assume traditional signing secret verification | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -316,9 +316,16 @@ spec: | |
| ) | ||
| fi | ||
|
|
||
| # Force --ignore-rekor to false since we need rekor | ||
| cmd_args+=( | ||
| # Force --ignore-rekor to false since we need rekor | ||
| --ignore-rekor=false | ||
|
|
||
| # Conforma expects that the attestation and the image are signed in the | ||
| # same way. But actually for Tekton Chains doing keyless signing that's | ||
| # not the cases. As a workaround, skip the image sig check and only do the | ||
| # attestation sig check. This means we're expecting the --certificate-* | ||
| # params provided to be applicable for verifying the attestation signature. | ||
| --skip-image-sig-check=true | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1. Image signature verification disabled Both tasks now unconditionally add --skip-image-sig-check=true whenever any keyless CERTIFICATE_* param is set, disabling image signature validation and allowing images with invalid/missing signatures to pass as long as attestation verification succeeds. Agent Prompt
|
||
| ) | ||
|
Comment on lines
+320
to
329
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make image-signature skipping explicit instead of unconditional. In Line 328, keyless mode now always disables image signature verification. That’s a security guarantee downgrade for all existing keyless users and should be an explicit opt-in task parameter (or a fail-closed path) rather than implicit behavior. Suggested hardening (opt-in switch)+ - name: SKIP_IMAGE_SIG_CHECK
+ type: string
+ description: >-
+ Allow keyless verification without image signature verification.
+ Use only when image and attestation are expected to use different identities.
+ default: "false"
...
- cmd_args+=(
- # Force --ignore-rekor to false since we need rekor
- --ignore-rekor=false
-
- # Conforma expects that the attestation and the image are signed in the
- # same way. But actually for Tekton Chains doing keyless signing that's
- # not the cases. As a workaround, skip the image sig check and only do the
- # attestation sig check. This means we're expecting the --certificate-*
- # params provided to be applicable for verifying the attestation signature.
- --skip-image-sig-check=true
- )
+ cmd_args+=(
+ # Force --ignore-rekor to false since we need rekor
+ --ignore-rekor=false
+ )
+ if [[ "${SKIP_IMAGE_SIG_CHECK}" == "true" ]]; then
+ cmd_args+=(
+ --skip-image-sig-check=true
+ )
+ fi
...
+ - name: SKIP_IMAGE_SIG_CHECK
+ value: "$(params.SKIP_IMAGE_SIG_CHECK)"As per coding guidelines, 🤖 Prompt for AI Agents
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same response as for the other similar suggestion, though honestly it would be easier here, since we own the integration test pipeline where this is used. Still, I'd rather be consistent with the other task. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| else | ||
| # Assume traditional signing secret verification | ||
|
|
||
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.
This is not entirely true. The same identity is used for the image signature and attestation signature. The change that we're pursuing in Konflux is that we want to make Chains stop signing the image altogether and instead sign the image from the build pipeline itself (tektoncd/chains#1346). That is unrelated to keyless. We could achieve the same with long-lived keys - keyless just makes this much more feasible.