ci: attest umbrella chart provenance; advance backend images to attested tags - #1298
Conversation
…ted tags
publish-chart now captures the chart OCI digest from helm push output and
runs actions/attest-build-provenance@v2 on it (push-to-registry: true),
giving the umbrella chart the same keyless SLSA provenance contract as the
container images. Verify:
gh attestation verify oci://ghcr.io/constructorfabric/charts/insight:<ver> \
--repo constructorfabric/insight
Also add rebuild markers to the three backend service Dockerfiles. The
chart currently pins all backend appVersions to a tag built before the
attestation steps landed, so those referenced images carry no provenance
(the attested rebuilds from the attestation PR were never promoted into the
chart: bump-descriptors committed in that run, which skips publish-chart,
and the follow-up run no longer matched the backend path filters). Merging
this PR rebuilds and attests all three services and publishes an umbrella
whose pinned backend tags are all attested.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Roman Mitasov <Roman.Mitasov@constructor.tech>
📝 WalkthroughWalkthroughThis PR enhances the container image publishing pipeline to include SLSA provenance attestation. The workflow now extracts OCI digests from published Helm charts and creates keyless provenance attestations. Dockerfile rebuild markers are added to signal that container images should be republished to align with the new attestation capability. ChangesSLSA Provenance for Published Chart
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/build-images.yml (1)
808-808: 💤 Low valueConsider pinning the attestation action to a commit SHA.
The workflow uses
actions/attest-build-provenance@v2, which is a moving tag. For supply chain security, consider pinning to a specific commit SHA (e.g.,actions/attest-build-provenance@<commit-sha> # v2.x.x).This would align with the existing practice for
docker/build-push-actionat lines 206, 252, 295, 352, 393, and 440, where commit SHAs are used.🤖 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.yml at line 808, The workflow uses the moving tag actions/attest-build-provenance@v2; replace that with a pinned commit SHA (e.g., actions/attest-build-provenance@<commit-sha> # v2.x.x) to avoid using a mutable tag—update the step referencing actions/attest-build-provenance@v2 to the specific commit SHA and add an inline comment with the corresponding v2.x.x version for clarity and consistency with the other pinned actions.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.yml:
- Line 808: The workflow uses the moving tag actions/attest-build-provenance@v2;
replace that with a pinned commit SHA (e.g.,
actions/attest-build-provenance@<commit-sha> # v2.x.x) to avoid using a mutable
tag—update the step referencing actions/attest-build-provenance@v2 to the
specific commit SHA and add an inline comment with the corresponding v2.x.x
version for clarity and consistency with the other pinned actions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 54727ec4-8f02-46e6-bb41-8bdd0b1b5d4f
📒 Files selected for processing (4)
.github/workflows/build-images.ymlsrc/backend/services/analytics-api/Dockerfilesrc/backend/services/api-gateway/Dockerfilesrc/backend/services/identity/Dockerfile
…ort errors (#1300) The "Attest chart provenance" step added in #1298 failed on main with "No credentials found for registry ghcr.io": helm registry login writes to helm's own config, while attest-build-provenance (push-to-registry: true) reads Docker credentials. Add docker/login-action to publish-chart before the attest step, mirroring the image jobs. Because that failure aborted publish-chart before "Commit version bumps back to main", the appVersion bumps from the attested backend rebuilds were lost (chart 0.1.53 was pushed unattested; main still pins the pre-attestation backend tags). Refresh the rebuild markers in the three backend Dockerfiles so the merge of this PR rebuilds + attests the services again and publish-chart re-publishes the umbrella with attested pins — and this time attests and commits back. Also set ignore-error=true on every cache-to: type=gha export: the GitHub Actions cache backend produced three spurious job failures in three days (504 on toolbox, not_found on jira-enrich, 504 on analytics-api). Cache export is an optimization — by that point the image is already built and pushed; a flaky cache service must not fail the job or block chart publication. cache-from already tolerates an unavailable cache. Signed-off-by: Roman Mitasov <Roman.Mitasov@constructor.tech> Co-authored-by: Roman Mitasov <Roman.Mitasov@constructor.tech> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Summary
Follow-up to #1280 closing the two remaining provenance gaps.
1. Umbrella chart attestation
publish-chartnow parses the chart's OCI digest fromhelm pushoutput and attests it withactions/attest-build-provenance@v2(push-to-registry: true) — the same keyless SLSA contract as the container images:2. Backend images: chart pins predate attestation
The chart currently pins all three backend services (
api-gateway,analytics-api,identity) to2026.06.09.10.55-9ef2224— built before the attestation steps landed, sogh attestation verifyfails for every chart-referenced backend image. The attested rebuilds from #1280 were never promoted into the chart:bump-descriptorscommitted in that run (which skipspublish-chart), and the follow-up run no longer matched the backend path filters.Rebuild markers in the three service Dockerfiles make the merge of this PR rebuild + attest all three images;
publish-chartthen advances theirappVersions and publishes an umbrella whose pinned backend tags are all attested — and the chart artifact itself now carries provenance too.Expected CI flow on merge (single run)
changesflags all three backend services → rebuild + push + attest ×3 → connector matrix empty →bump-descriptorsskipped →publish-chartruns in the same run: bumps three subchart appVersions, patch-bumps umbrella, pushes the chart, attests the chart digest.Known-red check
Run E2E suite is red on every PR (pre-existing
cost_centsmigration mismatch on the e2e rig) — unrelated, tracked separately.🤖 Generated with Claude Code
Summary by CodeRabbit