-
Notifications
You must be signed in to change notification settings - Fork 32
fix!: use Fulcio certificate instead of public key and upgrade Sigstore Cosign from v2 to v3 #1726
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix!: use Fulcio certificate instead of public key and upgrade Sigstore Cosign from v2 to v3 #1726
Conversation
Comprehensive documentation of the Sigstore v2 to v3 upgrade compatibility testing. Includes: - Pre-signed test component details and creation process - Automated verification workflow explanation - Test matrix covering all 4 verification combinations - Technical details of the upgrade - Relationship to other PRs (sigstore/sigstore bump) - Conclusions and recommendations This documentation serves as proof of compatibility for PR open-component-model#1726. On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com> Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
dae2fbd to
5ab3744
Compare
Upgrade all Sigstore dependencies from v2 to v3. - Updated imports from cosign/v2 to cosign/v3: - github.com/sigstore/cosign/v3/cmd/cosign/cli/fulcio - github.com/sigstore/cosign/v3/cmd/cosign/cli/options - github.com/sigstore/cosign/v3/pkg/cosign - Updated import from cosign/v2 to cosign/v3: - github.com/sigstore/cosign/v3/pkg/providers/all - Removed: github.com/sigstore/cosign/v2 v2.6.1 - Added: github.com/sigstore/cosign/v3 v3.0.2 Checked entire codebase for v2 references: ```bash grep -r "sigstore/cosign/v2" --include="*.go" --include="go.mod" --include="go.sum" . ``` This upgrade maintains signature compatibility: - v3 can verify signatures created with v2 (backward compatible) - v2 can verify signatures created with v3 (forward compatible) Verified by compatibility test workflow using pre-signed components. On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com> Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com> Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com> Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com> Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
0f280ff to
9ae5880
Compare
On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com> Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com> Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com> Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com> Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com> Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
…s; regenerate docs to align On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com> Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com> Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com> Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com> Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
|
all comments answered and feedback integrated. |
api/tech/signing/handlers/sigstore/testdata/component-descriptor-signed.yaml
Outdated
Show resolved
Hide resolved
|
Maybe you want to add a test to (or kind of like in ocm/api/ocm/tools/signing/handler_test.go Line 66 in 1245fc4
|
On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com> Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
@fabianburth added a tiny test that just does |
On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com> Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com> Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
jakobmoellerdev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code change okay. if there are other docs on website etc they probably need adjustment. best to double check!
sigstore/cosign is not mentioned on the website in any guide. I can find it only in the reference documentation that we link from ocm/open-component-model CLI docs. |
On-behalf-of: Gerald Morrison (SAP) gerald.morrison@sap.com
This PR introduces two breaking changes:
Breaking change 1: Correct Sigstore bundle content in signatures
OCM now bundles the short‑lived Fulcio certificate instead of just a raw public key into signatures when using keyless signing. To preserve backwards compatibility for existing components, we introduced a new signing algorithm
sigstore-v2and retain the legacysigstorealgorithm:sigstore: Stores only the public key in the Rekor entry. Existing signatures remain verifiable.sigstore-v2: Stores the Fulcio certificate in the Rekor entry, conforming to the Sigstore Bundle spec. Recommended algorithm to be used for new signatures.OCM CLI Examples
Create a new signature using
sigstore-v2:ocm sign componentversion --signature mysig --algorithm sigstore-v2 --keyless <component-version>Verify a signature (correct algorithm is determined from signature name
mysig)ocm verify componentversion --signature mysig --keyless <component-version>Breaking change 2: Cosign v3 changes OIDC token handling in GitHub Actions
GitHub no longer auto‑injects an ID token when
SIGSTORE_ID_TOKENis missing; workflows must explicitly request and export it.Typical CI error if
SIGSTORE_ID_TOKENis missing:getting ID token: executing OIDC flow: failed to start browserMigration on GitHub Actions
Add
id-token: writepermission and explicitly request an OIDC ID token with audiencesigstore, then export it asSIGSTORE_ID_TOKENprior to anyocm sign componentversion --keylesssteps.Below you find a snippet from an example workflow step that gets an OIDC token and exports it to the GitHub env for further use.
Other CI platforms are not affected
This problem is specific to GitHub Actions. Other CI/CD platforms have always required explicit handling of OIDC tokens and environment variables for Sigstore keyless flows. Therefore, no migration is needed outside GitHub Actions.
Recommended path forward
sigstoresignatures — they remain valid.sigstore-v2to ensure Sigstore Bundle compliance.SIGSTORE_ID_TOKENas shown above.References