Skip to content

Skip keyless image signature checks in tekton tasks#3191

Draft
simonbaird wants to merge 1 commit intoconforma:mainfrom
simonbaird:skip-image-sig-check-for-keyless
Draft

Skip keyless image signature checks in tekton tasks#3191
simonbaird wants to merge 1 commit intoconforma:mainfrom
simonbaird:skip-image-sig-check-for-keyless

Conversation

@simonbaird
Copy link
Member

As explained in the comments, the reason for this is we're expecting that we need to use different identities to verify the image vs the attestation, and currently it's not possible.

For the record, I think for the image sig check we'll need this:

--certificate-oidc-identity-regexp="^https://kubernetes.io/namespaces/[a-z0-9-]+-tenant/serviceaccounts/build-pipeline-[a-z0-9-]+$"

and for the attestation sig check we'll need this:

--certificate-oidc-identity="https://kubernetes.io/namespaces/openshift-pipelines/serviceaccounts/tekton-chains-controller"

but it's not easy to confirm that right now without a working cluster, so we'll aim to confirm it in future.

Ref: https://redhat.atlassian.net/browse/EC-1647

As explained in the comments, the reason for this is we're expecting
that we need to use different identities to verify the image vs the
attestation, and currently it's not possible.

For the record, I think for the image sig check we'll need this:
    --certificate-oidc-identity-regexp="^https://kubernetes.io/namespaces/[a-z0-9-]+-tenant/serviceaccounts/build-pipeline-[a-z0-9-]+$"

and for the attestation sig check we'll need this:
    --certificate-oidc-identity="https://kubernetes.io/namespaces/openshift-pipelines/serviceaccounts/tekton-chains-controller"

but it's not easy to confirm that right now without a working
cluster, so we'll aim to confirm it in future.

Ref: https://redhat.atlassian.net/browse/EC-1647
@qodo-code-review
Copy link
Contributor

Review Summary by Qodo

Skip keyless image signature checks in Tekton verification tasks

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Skip keyless image signature checks in Tekton tasks
• Add --skip-image-sig-check=true flag to Conforma verification
• Workaround for different signing identities between image and attestation
• Improve code formatting with better comment placement
Diagram
flowchart LR
  A["Tekton Tasks"] -->|Add flag| B["--skip-image-sig-check=true"]
  B -->|Skip| C["Image Signature Check"]
  B -->|Verify| D["Attestation Signature Only"]
  D -->|Use| E["Certificate OIDC Parameters"]
Loading

Grey Divider

File Changes

1. tasks/verify-conforma-konflux-ta/0.1/verify-conforma-konflux-ta.yaml ✨ Enhancement +8/-1

Add skip image signature check flag

• Added --skip-image-sig-check=true flag to Conforma command arguments
• Moved comment about --ignore-rekor=false inside the argument array
• Added detailed explanation comment about signing identity mismatch workaround
• Clarifies that certificate parameters apply to attestation verification only

tasks/verify-conforma-konflux-ta/0.1/verify-conforma-konflux-ta.yaml


2. tasks/verify-enterprise-contract/0.1/verify-enterprise-contract.yaml ✨ Enhancement +8/-1

Add skip image signature check flag

• Added --skip-image-sig-check=true flag to Conforma command arguments
• Moved comment about --ignore-rekor=false inside the argument array
• Added detailed explanation comment about signing identity mismatch workaround
• Clarifies that certificate parameters apply to attestation verification only

tasks/verify-enterprise-contract/0.1/verify-enterprise-contract.yaml


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Contributor

qodo-code-review bot commented Mar 24, 2026

Code Review by Qodo

🐞 Bugs (3) 📘 Rule violations (0) 📎 Requirement gaps (0) 📐 Spec deviations (0)

Grey Divider


Action required

1. Image signature verification disabled 🐞 Bug ⛨ Security
Description
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.
Code

tasks/verify-enterprise-contract/0.1/verify-enterprise-contract.yaml[328]

+            --skip-image-sig-check=true
Evidence
The PR adds the flag in the keyless branch for both tasks. In the CLI, this flag explicitly bypasses
ValidateImageSignature(), and repo acceptance tests demonstrate that with --skip-image-sig-check
an invalid image signature can still return exit status 0 if the attestation signature is valid.
These tasks are used in release pipelines, so this change weakens supply-chain verification in a
critical path.

tasks/verify-enterprise-contract/0.1/verify-enterprise-contract.yaml[292-336]
tasks/verify-conforma-konflux-ta/0.1/verify-conforma-konflux-ta.yaml[344-391]
internal/image/validate.go[77-87]
features/validate_image.feature[189-217]
release/cli.yaml[102-147]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The Tekton tasks currently add `--skip-image-sig-check=true` automatically for any keyless verification configuration, which disables image signature validation in a broad, implicit way.

### Issue Context
The CLI supports `--skip-image-sig-check` and it bypasses image signature validation (`ValidateImageSignature`). Repo tests show this can make validation succeed even when the image signature is invalid.

### How to fix
- Add a **new task param** (e.g., `SKIP_IMAGE_SIG_CHECK`, default `"false"`).
- Only append `--skip-image-sig-check` when that param is true (and ideally emit a clear log line warning about the security tradeoff).
- Update both task READMEs to document the param and the security implication.

### Fix Focus Areas
- tasks/verify-enterprise-contract/0.1/verify-enterprise-contract.yaml[292-336]
- tasks/verify-conforma-konflux-ta/0.1/verify-conforma-konflux-ta.yaml[344-391]
- tasks/verify-enterprise-contract/0.1/README.md[1-60]
- tasks/verify-conforma-konflux-ta/0.1/README.md[1-80]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Skipped check appears failed 🐞 Bug ✧ Quality
Description
When --skip-image-sig-check is used, imageSignatureCheck is left unset (no Result) and passed
remains false, so outputs can show imageSignatureCheck.passed=false even when the overall
validation succeeds, which is misleading for report consumers.
Code

tasks/verify-conforma-konflux-ta/0.1/verify-conforma-konflux-ta.yaml[383]

+            --skip-image-sig-check=true
Evidence
With SkipImageSigCheck, validation skips calling SetImageSignatureCheckFromError, so
ImageSignatureCheck stays at its zero value (Passed=false, Result=nil). Since passed is
always serialized in JSON, consumers reading report-json.json can interpret this as a failed
check, despite component/report success being derived from the *absence of violations* (and skipped
checks do not contribute violations because Result is nil). The PR increases the frequency of this
confusing output by enabling skip-by-default in keyless Tekton runs.

internal/image/validate.go[77-85]
internal/output/output.go[42-60]
internal/output/output.go[76-90]
internal/validate/report.go[44-91]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
When image signature checking is skipped, output JSON can show `imageSignatureCheck.passed=false` while overall success is true. This is confusing/misleading for humans and downstream automation.

### Issue Context
`SkipImageSigCheck()` bypasses setting the `ImageSignatureCheck` fields, leaving the struct at its zero value. JSON always includes `passed`.

### How to fix
Choose one:
1) Add an explicit **skipped state** to `VerificationStatus` (e.g., `Skipped bool`) and ensure JSON output reflects `skipped=true` when `--skip-image-sig-check` is set.
2) Alternatively, set an explicit `Result` for the image signature check when skipped (with metadata/code and message "Skipped") and ensure aggregation logic treats it as neither violation nor success.

### Fix Focus Areas
- internal/image/validate.go[77-85]
- internal/output/output.go[42-60]
- internal/output/output.go[116-139]
- internal/validate/report.go[44-91]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Task docs omit new behavior 🐞 Bug ⚙ Maintainability
Description
The tasks’ documentation does not mention that keyless runs now skip image signature verification,
so users will assume image signatures are still checked when configuring keyless CERTIFICATE_*
parameters.
Code

tasks/verify-enterprise-contract/0.1/verify-enterprise-contract.yaml[R323-329]

+            # 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
          )
Evidence
The PR changes task behavior (automatic --skip-image-sig-check=true in keyless mode), but the task
README’s parameter documentation does not describe this skip or its implications, creating a
high-risk mismatch between configured expectations and actual verification performed.

tasks/verify-enterprise-contract/0.1/verify-enterprise-contract.yaml[292-336]
tasks/verify-enterprise-contract/0.1/README.md[27-56]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
Task behavior now differs from what the README implies: in keyless mode the task skips image signature verification.

### Issue Context
This is a security-relevant behavior change and must be documented to avoid accidental reliance on image signature verification.

### How to fix
- Update READMEs to explicitly state the behavior for keyless verification.
- If you implement an opt-in param (recommended), document it and its default.

### Fix Focus Areas
- tasks/verify-enterprise-contract/0.1/README.md[1-70]
- tasks/verify-conforma-konflux-ta/0.1/README.md[1-90]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@coderabbitai
Copy link

coderabbitai bot commented Mar 24, 2026

📝 Walkthrough

Walkthrough

Two Tekton task YAML files are modified to add --skip-image-sig-check=true to the ec validate command in their keyless verification branches. This changes behavior to skip image signature verification while maintaining attestation signature verification via provided certificate parameters.

Changes

Cohort / File(s) Summary
Verification Task Configuration
tasks/verify-conforma-konflux-ta/0.1/verify-conforma-konflux-ta.yaml, tasks/verify-enterprise-contract/0.1/verify-enterprise-contract.yaml
Added --skip-image-sig-check=true flag to the ec validate command within the keyless verification branch (when CERTIFICATE_* parameters are provided). This skips image signature checks while preserving attestation signature verification.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: disabling keyless image signature checks in Tekton tasks.
Description check ✅ Passed The description is directly related to the changeset, explaining the technical rationale for skipping image signature checks and referencing the associated issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@tasks/verify-conforma-konflux-ta/0.1/verify-conforma-konflux-ta.yaml`:
- Around line 375-384: Remove the unconditional --skip-image-sig-check=true flag
and instead add an explicit task parameter (e.g., params.skipImageSigCheck,
default false) to the task definition, then conditionally append the
--skip-image-sig-check=true argument to the Conforma step args only when
params.skipImageSigCheck is true (so callers must opt in for reduced
validation); reference the existing --skip-image-sig-check flag and the task
params block when making the change.

In `@tasks/verify-enterprise-contract/0.1/verify-enterprise-contract.yaml`:
- Around line 320-329: The task unconditionally sets --skip-image-sig-check=true
for keyless signing, weakening security; update verify-enterprise-contract.yaml
to make image signature skipping explicit and opt-in: introduce a task parameter
(e.g., skipImageSigCheck or allowKeylessImageSkip) defaulting to false, wire
that parameter into the command generation instead of hardcoding
--skip-image-sig-check=true, and if keyless mode is detected without the opt-in
parameter set, fail-closed (return an error/exit) to force explicit
authorization; ensure you modify the code that emits the --skip-image-sig-check
flag so it only appears when the new parameter is true and keep the explanatory
comment near the flag.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cadb290c-c845-4e88-aa06-73d4c0feb900

📥 Commits

Reviewing files that changed from the base of the PR and between 8332d47 and 4642855.

⛔ Files ignored due to path filters (1)
  • features/__snapshots__/task_validate_image.snap is excluded by !**/*.snap
📒 Files selected for processing (2)
  • tasks/verify-conforma-konflux-ta/0.1/verify-conforma-konflux-ta.yaml
  • tasks/verify-enterprise-contract/0.1/verify-enterprise-contract.yaml

Comment on lines +375 to 384
# 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
)
Copy link

@coderabbitai coderabbitai bot Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Avoid unconditional --skip-image-sig-check in keyless mode.

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 false) so callers intentionally opt into this reduced validation mode.

As per coding guidelines, **: -Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tasks/verify-conforma-konflux-ta/0.1/verify-conforma-konflux-ta.yaml` around
lines 375 - 384, Remove the unconditional --skip-image-sig-check=true flag and
instead add an explicit task parameter (e.g., params.skipImageSigCheck, default
false) to the task definition, then conditionally append the
--skip-image-sig-check=true argument to the Conforma step args only when
params.skipImageSigCheck is true (so callers must opt in for reduced
validation); reference the existing --skip-image-sig-check flag and the task
params block when making the change.

Copy link
Member Author

Choose a reason for hiding this comment

The 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".

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@simonbaird, understood — the trade-off makes sense given the fixed use case. Deferring to the PR author here.


📝 Learnings were identified and not saved (knowledge base disabled). Enable

Comment on lines +320 to 329
# 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
)
Copy link

@coderabbitai coderabbitai bot Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

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, **: -Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tasks/verify-enterprise-contract/0.1/verify-enterprise-contract.yaml` around
lines 320 - 329, The task unconditionally sets --skip-image-sig-check=true for
keyless signing, weakening security; update verify-enterprise-contract.yaml to
make image signature skipping explicit and opt-in: introduce a task parameter
(e.g., skipImageSigCheck or allowKeylessImageSkip) defaulting to false, wire
that parameter into the command generation instead of hardcoding
--skip-image-sig-check=true, and if keyless mode is detected without the opt-in
parameter set, fail-closed (return an error/exit) to force explicit
authorization; ensure you modify the code that emits the --skip-image-sig-check
flag so it only appears when the new parameter is true and keep the explanatory
comment near the flag.

Copy link
Member Author

Choose a reason for hiding this comment

The 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.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@simonbaird, understood — consistency between the two tasks is a reasonable priority. I'll defer to your judgment here.


📝 Learnings were identified and not saved (knowledge base disabled). Enable

--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
Copy link
Contributor

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.

# 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Image signature verification disabled 🐞 Bug ⛨ Security

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
### Issue description
The Tekton tasks currently add `--skip-image-sig-check=true` automatically for any keyless verification configuration, which disables image signature validation in a broad, implicit way.

### Issue Context
The CLI supports `--skip-image-sig-check` and it bypasses image signature validation (`ValidateImageSignature`). Repo tests show this can make validation succeed even when the image signature is invalid.

### How to fix
- Add a **new task param** (e.g., `SKIP_IMAGE_SIG_CHECK`, default `"false"`).
- Only append `--skip-image-sig-check` when that param is true (and ideally emit a clear log line warning about the security tradeoff).
- Update both task READMEs to document the param and the security implication.

### Fix Focus Areas
- tasks/verify-enterprise-contract/0.1/verify-enterprise-contract.yaml[292-336]
- tasks/verify-conforma-konflux-ta/0.1/verify-conforma-konflux-ta.yaml[344-391]
- tasks/verify-enterprise-contract/0.1/README.md[1-60]
- tasks/verify-conforma-konflux-ta/0.1/README.md[1-80]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@codecov
Copy link

codecov bot commented Mar 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
acceptance 55.16% <ø> (ø)
generative 17.90% <ø> (ø)
integration 26.63% <ø> (ø)
unit 69.01% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@simonbaird
Copy link
Member Author

I think I was wrong about the purpose of buildIdentityRegexp so my long comments are incorrect. Moving to draft.

@simonbaird simonbaird marked this pull request as draft March 24, 2026 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants