Skip to content

Add new flag to support skipping image signature checks#3122

Merged
simonbaird merged 3 commits intoconforma:mainfrom
simonbaird:skip-image-validation
Feb 26, 2026
Merged

Add new flag to support skipping image signature checks#3122
simonbaird merged 3 commits intoconforma:mainfrom
simonbaird:skip-image-validation

Conversation

@simonbaird
Copy link
Member

@simonbaird simonbaird commented Feb 24, 2026

See commit messages for more explanation.

Ref: https://issues.redhat.com/browse/EC-1647

@qodo-code-review
Copy link
Contributor

Review Summary by Qodo

Add flag to skip image signature validation checks

✨ Enhancement 🧪 Tests

Grey Divider

Walkthroughs

Description
• Add --skip-image-sig-check flag to skip image signature validation
• Implement conditional image signature check based on flag setting
• Add comprehensive unit and acceptance tests for new functionality
• Update policy structures to support skip image signature option
Diagram
flowchart LR
  CLI["CLI Flag<br/>--skip-image-sig-check"]
  CMD["Command Handler<br/>cmd/validate/image.go"]
  POLICY["Policy Options<br/>SkipImageSigCheck"]
  VALIDATE["ValidateImage<br/>internal/image/validate.go"]
  RESULT["Conditional<br/>Image Sig Check"]
  
  CLI -->|"Sets flag"| CMD
  CMD -->|"Passes to Options"| POLICY
  POLICY -->|"Reads from SigstoreOpts"| VALIDATE
  VALIDATE -->|"Skips if enabled"| RESULT
Loading

Grey Divider

File Changes

1. cmd/validate/image.go ✨ Enhancement +9/-4

Add CLI flag for skipping image signature checks

• Add skipImageSigCheck field to imageData struct
• Register new --skip-image-sig-check CLI flag with description
• Pass SkipImageSigCheck to policy Options during validation
• Align struct field formatting for consistency

cmd/validate/image.go


2. internal/image/validate.go ✨ Enhancement +4/-1

Implement conditional image signature validation logic

• Conditionally call ValidateImageSignature based on SkipImageSigCheck option
• Skip image signature check result when flag is enabled
• Attestation signature check always runs regardless of flag

internal/image/validate.go


3. internal/image/validate_test.go 🧪 Tests +137/-0

Add unit tests for skip image signature check feature

• Add comprehensive test TestValidateImageSkipImageSigCheck with two scenarios
• Test default behavior (skip disabled) and skip enabled behavior
• Verify image signature check is skipped when flag enabled
• Verify attestation signature check always runs
• Validate skipped checks don't appear in violations or successes

internal/image/validate_test.go


View more (5)
4. internal/policy/policy.go ✨ Enhancement +11/-6

Add skip image signature check to policy structures

• Add SkipImageSigCheck field to SigstoreOpts struct with JSON tag
• Add skipImageSigCheck field to internal policy struct
• Update Options struct to include SkipImageSigCheck field
• Populate SkipImageSigCheck in SigstoreOpts() method
• Set skipImageSigCheck in NewPolicy() function
• Align struct field formatting for consistency

internal/policy/policy.go


5. docs/modules/ROOT/pages/ec_validate_image.adoc 📝 Documentation +1/-0

Document skip image signature check flag

• Document new --skip-image-sig-check flag in command reference
• Specify default value as false
• Describe flag purpose as skipping image signature validation checks

docs/modules/ROOT/pages/ec_validate_image.adoc


6. features/validate_image.feature 🧪 Tests +58/-0

Add acceptance tests for skip image signature check

• Add acceptance test scenario "happy day with skip-image-sig-check flag"
• Add acceptance test scenario "invalid image signature with valid att sig and skip-image-sig-check
 flag"
• Test that validation passes when image signature is skipped
• Test that attestation signature check still runs when image check is skipped
• Verify flag works with both valid and invalid image signatures

features/validate_image.feature


7. go.sum Dependencies +0/-2

Update sigstore dependency version

• Update sigstore dependency from v1.10.3 to v1.10.4
• Remove old v1.10.3 entries and keep only v1.10.4

go.sum


8. acceptance/go.sum Dependencies +0/-2

Update sigstore dependency version

• Update sigstore dependency from v1.10.3 to v1.10.4
• Remove old v1.10.3 entries and keep only v1.10.4

acceptance/go.sum


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Contributor

qodo-code-review bot commented Feb 24, 2026

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (2) 📎 Requirement gaps (0)

Grey Divider


Action required

1. SigstoreOpts() error ignored 📘 Rule violation ⛨ Security
Description
The new skip-logic silently disables image signature validation when p.SigstoreOpts() fails, even
if SkipImageSigCheck is not enabled. This creates an unhandled edge case where signature
verification may be bypassed without any error surfaced to the caller.
Code

internal/image/validate.go[R77-80]

+	// Skip image signature check if configured to do so
+	if sigstoreOpts, err := p.SigstoreOpts(); err == nil && !sigstoreOpts.SkipImageSigCheck {
+		out.SetImageSignatureCheckFromError(a.ValidateImageSignature(ctx))
+	}
Evidence
PR Compliance ID 3 requires handling failure points and avoiding silent failures; the added
conditional only runs ValidateImageSignature when SigstoreOpts() returns no error, otherwise it
skips the check without logging or returning an error.

Rule 3: Generic: Robust Error Handling and Edge Case Management
internal/image/validate.go[77-80]

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

## Issue description
`ValidateImage` currently skips `ValidateImageSignature` when `p.SigstoreOpts()` returns an error, which can silently bypass image signature verification.

## Issue Context
This bypass can occur even when `SkipImageSigCheck` is not set, because the condition is `err == nil &amp;&amp; !sigstoreOpts.SkipImageSigCheck`. If `SigstoreOpts()` fails, there is no log, no returned error, and no explicit failed check recorded.

## Fix Focus Areas
- internal/image/validate.go[77-80]

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



Remediation recommended

2. Skip flag not audited 📘 Rule violation ✧ Quality
Description
The new SkipImageSigCheck bypass is not logged or recorded as an explicit “skipped” outcome,
reducing traceability of a security-relevant action. This makes it difficult to reconstruct whether
validation results were produced with signature verification disabled.
Code

internal/image/validate.go[R77-80]

+	// Skip image signature check if configured to do so
+	if sigstoreOpts, err := p.SigstoreOpts(); err == nil && !sigstoreOpts.SkipImageSigCheck {
+		out.SetImageSignatureCheckFromError(a.ValidateImageSignature(ctx))
+	}
Evidence
PR Compliance ID 1 requires critical security-relevant actions to be logged with clear context and
outcome; the added skip branch omits any audit log/event indicating the image signature check was
intentionally skipped.

Rule 1: Generic: Comprehensive Audit Trails
internal/image/validate.go[77-80]

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 verification is skipped via `SkipImageSigCheck`, the code does not log or otherwise record that a critical validation step was bypassed.

## Issue Context
This flag changes the security posture of validation. Without an explicit log/event or a &quot;skipped&quot; status in results, it is hard to audit runs and understand why certain checks are missing.

## Fix Focus Areas
- internal/image/validate.go[77-80]
- cmd/validate/image.go[496-497]

ⓘ 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

@simonbaird simonbaird force-pushed the skip-image-validation branch from 7c8bfbe to e8a8e10 Compare February 24, 2026 19:16
@simonbaird simonbaird force-pushed the skip-image-validation branch from e8a8e10 to 48959b1 Compare February 24, 2026 21:09
@codecov
Copy link

codecov bot commented Feb 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
acceptance 55.59% <100.00%> (+0.04%) ⬆️
generative 18.49% <0.00%> (-0.02%) ⬇️
integration 27.50% <50.00%> (+<0.01%) ⬆️
unit 68.44% <85.71%> (+<0.01%) ⬆️

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

Files with missing lines Coverage Δ
cmd/validate/image.go 91.32% <100.00%> (+0.06%) ⬆️
internal/image/validate.go 70.80% <100.00%> (+0.65%) ⬆️
internal/policy/policy.go 92.03% <100.00%> (+0.07%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Not related to, but done in the PR for...

Ref: https://issues.redhat.com/browse/EC-1647
@simonbaird simonbaird force-pushed the skip-image-validation branch from 48959b1 to b17215c Compare February 25, 2026 04:33
st3penta
st3penta previously approved these changes Feb 25, 2026
Copy link
Contributor

@st3penta st3penta left a comment

Choose a reason for hiding this comment

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

lgtm, just one nitpick

simonbaird and others added 2 commits February 25, 2026 16:17
This adds a --skip-image-sig-check flag to ec validate image. It
defaults to false currently so we're not changing the default
behavior.

Motivation: It's been suggested that the image signing that Tekton
Chains does is low value, since it will sign whatever image ref is
found in a task or pipeline result. See
tektoncd/chains#1346 which suggests it
should stop doing it. (Attestation signing remains crucial though
since Chains is the thing creating those.)

Additionally, we need to support verifying "keyless" signatures in
our Tekton task, which IIUC will require providing different oidc
identities for each component image, since in Konflux the service
account is different for different components, and a different
identity to verify the attestation signature. Conforma doesn't
support this currently. We could implement support for providing
multiple oidc identities, but being able to skip the image signature
check means we can more quickly support verifying keylessly signed
attestations.

Ref: https://issues.redhat.com/browse/EC-1647
Co-authored-by: Claude Code <noreply@anthropic.com>
Covers scenarios where the image sig is valid, and also when it is
invalid.

Ref: https://issues.redhat.com/browse/EC-1647
@simonbaird
Copy link
Member Author

New revision to reverse bool check nitpick. No change otherwise.

@simonbaird
Copy link
Member Author

The previous review is not considered current. I'll merge if someone gives a fresh approve.

@simonbaird simonbaird merged commit 0bdf841 into conforma:main Feb 26, 2026
14 checks passed
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