Skip to content

Add cosigning and provenance attestation to image builds - #645

Merged
averevki merged 1 commit into
mainfrom
builds-cosigning-and-provenance
Jul 7, 2026
Merged

averevki merged 1 commit into
mainfrom
builds-cosigning-and-provenance

Conversation

@averevki

@averevki averevki commented Jun 30, 2026 •

Copy link
Copy Markdown
Member

Summary

Part of the work on Kuadrant/kuadrant-operator#2038

Context

This improves the Signed-Releases (https://github.com/ossf/scorecard/blob/main/docs/checks.md#signed-releases) check from the OpenSSF Scorecard (https://scorecard.dev/). Merging this should bring this section score from current 0 to 10.

Verification

Image builds cosigning and attestation was verified with the kuadrant-operator image builds (Kuadrant/kuadrant-operator#2073), the successful run of which can be found here, with the images pushed here.

Summary by CodeRabbit

  • Security / Trust Enhancements
    • Image releases now include digital signing and build provenance attestation for improved trust and traceability.
    • Published images are now verified using the image digest during release.

@averevki averevki self-assigned this Jun 30, 2026
@coderabbitai

coderabbitai Bot commented Jun 30, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The merge job in the image build workflow now has explicit OIDC and attestation permissions. It captures the image manifest digest, signs the image with Cosign, and publishes a build provenance attestation to the registry.

Changes

Image Signing and Attestation

Layer / File(s) Summary
Permissions, digest capture, Cosign signing, and attestation
.github/workflows/build-images.yaml
The merge job gains id-token: write and attestations: write permissions. The inspect step now writes the manifest digest to $GITHUB_OUTPUT. New steps install Cosign, sign the image at the captured digest, and attest build provenance with push-to-registry enabled; all gated behind if: ${{ !env.ACT }}.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant merge as merge job
  participant cosign as Cosign
  participant attest as actions/attest
  participant registry as registry

  merge->>merge: inspect image and capture manifest digest
  merge->>cosign: install and sign image by digest
  merge->>attest: create build provenance attestation
  attest->>registry: push attestation for subject digest
Loading

Poem

🐇 I hop to the registry, neat and bright,
With digest in paw and Cosign in sight.
I stamp provenance with a tidy cheer,
Then nudge the attestation right over here.
Hooray for signed images, secure and clear!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding cosigning and provenance attestation to image builds.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch builds-cosigning-and-provenance

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Signed-off-by: averevki <sandyverevkin@gmail.com>
@averevki
averevki force-pushed the builds-cosigning-and-provenance branch from 40c5a45 to 87f9c03 Compare July 2, 2026 10:27

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
.github/workflows/build-images.yaml (1)

137-149: 🔒 Security & Privacy | 🔵 Trivial | 💤 Low value

Quote the image ref in these run steps. Moving the expression into env and quoting the shell variable avoids shell-parsing edge cases.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/build-images.yaml around lines 137 - 149, The image
reference in the workflow’s inspect and cosign sign run steps should be quoted
to avoid shell parsing issues. Move the full image ref expression used in the
`inspect` step and the `cosign sign` step into shell variables or `env`, then
use those quoted variables in the `run` commands. Keep the fix localized to the
workflow job around `inspect` and `Sign image with cosign`.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.github/workflows/build-images.yaml:
- Around line 137-149: The image reference in the workflow’s inspect and cosign
sign run steps should be quoted to avoid shell parsing issues. Move the full
image ref expression used in the `inspect` step and the `cosign sign` step into
shell variables or `env`, then use those quoted variables in the `run` commands.
Keep the fix localized to the workflow job around `inspect` and `Sign image with
cosign`.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7411979a-a90f-4960-b365-9df2f960078d

📥 Commits

Reviewing files that changed from the base of the PR and between 40c5a45 and 87f9c03.

📒 Files selected for processing (1)
  • .github/workflows/build-images.yaml

@guicassolato guicassolato left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Image

@averevki
averevki added this pull request to the merge queue Jul 7, 2026
Merged via the queue into main with commit e4f5893 Jul 7, 2026
22 checks passed
@github-project-automation github-project-automation Bot moved this to Done in Kuadrant Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants