Repository navigation
Sign the final release provenance - #4550
Conversation
6fa8e31 to
15844dc
Compare
15844dc to
fb78017
Compare
e0dc4ba to
6268957
Compare
6268957 to
3428cff
Compare
3428cff to
8ae7669
Compare
8ae7669 to
06ab7ce
Compare
|
@kubernetes/release-engineering PTAL |
|
@kubernetes/release-engineering PTAL |
krel release generated the final provenance attestations and published them unsigned, since the release job signs the artifacts before krel release writes them. They are now signed in place like the stage run signs its provenance, as the account named by GOOGLE_SERVICE_ACCOUNT_NAME, which the release job impersonates to sign the artifacts, before anything of the release is published, so that a signing failure stops it. Without that account the release fails instead of signing with other credentials. A version without a final attestation fails official releases, mock releases skip it with a warning, like they only warn about a stage provenance that doesn't check. The published provenance.json becomes a sigstore bundle. The in-place signing of the krel sign attestation command moves into the attestation package, so that both use it. Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
06ab7ce to
062aa6f
Compare
| // warning, like mock releases only warn when the stage provenance doesn't | ||
| // check. | ||
| func (d *defaultReleaseImpl) SignProvenance(versions []string, required bool) error { | ||
| account := os.Getenv("GOOGLE_SERVICE_ACCOUNT_NAME") |
There was a problem hiding this comment.
nit: SignProvenance reads GOOGLE_SERVICE_ACCOUNT_NAME directly, while everything else in the impl comes from d.options. No other Go code in the repo reads this variable; it only appears in the krel release help text. Could we add it to ReleaseOptions (for example as a --signing-account flag that defaults to the env var)? Then the account would be visible in the options and easier to set in tests. Fine as a follow-up.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: saschagrunert, xmudrii The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Signs the final release provenance in place, like the stage run signs its provenance since #4507.
krel releasegeneratesprovenance-<version>.jsonper version and copies it to the release bucket, but the release build runskrel sign blobsbefore that step, so the publishedprovenance.jsonhas never been signed.PushArtifactsnow signs the final attestations first, as the account named byGOOGLE_SERVICE_ACCOUNT_NAME(krel-staging, which the release step already sets for the image and blob signatures), so a signing failure stops the release before anything is published. Without that variable the release fails instead of signing with other credentials, which the documented verify command would reject. Signing inside krel rather than in a later Cloud Build step keeps the plain statement from ever being public, and krel knows the versions of a release. A version without a final attestation fails official releases (--nomock), so that they never publish without provenance; mock releases skip it with a warning.krel sign attestation --in-placeand this share the newSigner.SignFilesInPlaceandSigner.WriteBundleFile, and thekrel releasehelp says that local runs needGOOGLE_SERVICE_ACCOUNT_NAMEtoo.https://dl.k8s.io/release/<version>/provenance.jsonbecomes a sigstore bundle instead of the plain statement of v1.37.0 and older. It verifies with:Which issue(s) this PR fixes:
Part of #2616
Special notes for your reviewer:
fake_release_impl.gois regenerated with counterfeiter v6.12.2, the version of the other fakes, so it only changes the signing method. A signer factory ondefaultReleaseImpllets the unit test cover the success path, the paths passed and the signing account.The verify command was checked against a staged bundle signed as
krel-staging. The "Verify Signed Kubernetes Artifacts" page on kubernetes.io should get it once this ships.Tested end to end with a mock stage (Cloud Build fc5b9edb in k8s-release) and a mock release (f2b2aac0) of master, with krel built from a branch that combines #4555, #4550 and #4551: the stage attached the signed image provenance to 54 mock images (cosign verify-attestation passes) and signed
provenance.jsonin place; the release verified that stage provenance and all 451 staged artifacts, signed the final provenance in place before publishing, and the publishedprovenance.jsonverifies against the releasedkubectlwithcosign verify-blob-attestation.Does this PR introduce a user-facing change?