feat(EC-1957): verify base image release signatures - #1780
Conversation
…istries Add a third path in _image_ref_permitted that verifies a base image's release signature using ec.sigstore.verify_image() with a release_public_key from rule data. This provides stronger cryptographic assurance than registry prefix matching. - Add signature verification clause to _image_ref_permitted - Relax allowed_registries_provided to pass when only release_public_key is configured - Add deprecation warn rule when prefixes are used without a release key - Add schema validation for release_public_key (must be a string) - Update example rule_data.yml with release_public_key entry - Regenerate docs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
🤖 Finished Review · ✅ Success · Started 2:11 AM UTC · Completed 2:20 AM UTC |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughBase image release policies now support signature verification through ChangesBase image signature policy
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant RuleData
participant BaseImagePolicy
participant Sigstore
participant PolicyResult
RuleData->>BaseImagePolicy: provide release_public_key
BaseImagePolicy->>Sigstore: verify image signature
Sigstore-->>BaseImagePolicy: return verification result
BaseImagePolicy->>PolicyResult: permit or deny base image
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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.
Inline comments:
In `@antora/docs/modules/ROOT/pages/packages/release_base_image_registries.adoc`:
- Around line 12-16: Update all specified base-image documentation to describe
registry-prefix, snapshot-digest, and release-signature verification. In
antora/docs/modules/ROOT/pages/packages/release_base_image_registries.adoc lines
12-16, include release_public_key in the solution; in lines 24-28, rename the
rule/title and solution to cover all three verification paths. Update the
permitted-image labels in antora/docs/modules/ROOT/pages/release_policy.adoc
lines 35-38, 119-122, and 345-348, and the corresponding navigation label in
antora/docs/modules/ROOT/partials/release_policy_nav.adoc lines 22-26.
In `@antora/docs/modules/ROOT/pages/release_policy.adoc`:
- Around line 362-363: Update the visible label for the xref targeting
github_certificate__gh_workflow_ref to “GitHub Certificate Checks: GitHub
Workflow Ref”; leave the github_certificate__gh_workflow_repository link label
unchanged.
In `@policy/release/base_image_registries/base_image_registries.rego`:
- Around line 235-238: Update the _rule_data_errors rule to distinguish an
absent release key from a present value before type validation, so an explicitly
provided empty array is rejected as a non-string while a missing key remains
allowed. Validate every present release key value with the existing string
check, and add a regression case covering release_public_key: [].
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Enterprise
Run ID: 7be5a78f-860d-4e49-8d34-07fcc03095e5
📒 Files selected for processing (6)
antora/docs/modules/ROOT/pages/packages/release_base_image_registries.adocantora/docs/modules/ROOT/pages/release_policy.adocantora/docs/modules/ROOT/partials/release_policy_nav.adocexample/data/rule_data.ymlpolicy/release/base_image_registries/base_image_registries.regopolicy/release/base_image_registries/base_image_registries_test.rego
ReviewFindingsMedium
Low
Labels: PR adds sigstore signature verification feature with documentation updates Previous runReviewFindingsMedium
Low
Previous run (2)ReviewFindingsMedium
Low
Previous run (3)Review — approveSummaryThis PR adds signature-based base image verification to the AnalysisCorrectness — The signature verification logic is structurally sound. The three-branch Security — The Test adequacy — Eight new tests comprehensively cover: successful signature verification, failed verification, the noop behavior when no key is configured, using only a release key without prefixes, the deprecation warning (presence, absence with key, absence without prefixes), and Documentation — Antora docs, release policy pages, and nav partials are all updated. The new deprecation rule is documented with its warning message, code, and source link. The example Observations
Labels: PR adds new OPA/Rego policy feature for signature-based base image verification |
Move the registry prefix deprecation from a standalone warn rule into _rule_data_errors with warning severity, and rename the deny rule title to "Base image is permitted" since verification is no longer registry-specific. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
🤖 Review · |
|
🤖 Review · Started 3:00 AM UTC |
Codecov Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
…tries Replace _has_sig_errors helper with direct info.success check via object.get, matching the pattern used in trust.rego. Consolidate _release_public_key_provided into _release_public_key to eliminate duplicate rule_data.get calls. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
🤖 Review · |
|
🤖 Review · |
PR Summary by QodoVerify base image release signatures via Sigstore (release_public_key)
AI Description
Diagram
High-Level Assessment
Files changed (7)
|
Captures OPA type system constraints discovered through trial and error when working with ec.sigstore.verify_image. The built-in's return type is declared in ec-cli (internal/rego/sigstore/sigstore.go) and is not visible from ec-policies — understanding it required reading the Go source in the ec-cli repo. Key finding: direct field access and count() both fail on the typed return; object.get() is the workaround. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Code Review by Qodo
Context used✅ Compliance rules (platform):
15 rules 1. Prefixes unchecked when key set
|
|
🤖 Finished Review · ❌ Failure · Started 7:49 PM UTC · Completed 8:08 PM UTC |
|
🤖 Review · |
Use the shared sigstore.opts config as defaults when building verification options, with release_public_key overriding via object.union. This ensures deployments with custom default_sigstore_opts (rekor_url, ignore_rekor, etc.) have those settings respected by base image verification. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
🤖 Finished Review · ✅ Success · Started 10:08 PM UTC · Completed 10:26 PM UTC |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
🤖 Finished Review · ❌ Failure · Started 4:53 PM UTC · Completed 5:14 PM UTC |
Summary
ec.sigstore.verify_image()with arelease_public_keyrule data keyallowed_registry_prefixesis configured withoutrelease_public_keyallowed_registry_prefixesvalidation so having onlyrelease_public_keyis sufficientrelease_public_key(must be string when present)Resolves: EC-1957
Test plan
make cipasses (1005/1005 tests, 0 lint violations)🤖 Generated with Claude Code