Skip to content

Conversation

@cmurphy
Copy link
Contributor

@cmurphy cmurphy commented Jun 12, 2025

When deducing the Rekor log key ID, cosign universally assumes a Rekor v1 type checkpoint, which is not C2SP compliant. Rekor v2 is compliant for all different types of keys, which means the log ID must be calculated differently. This affects the trusted-root create tool which must generate the log ID from the public key. This change adds the ability for the trusted-root command to parse a ":" in the --rekor-key flag to indicate that the trusted material should be generated for a Rekor v2 log and that the origin string following the ":" should be used to calculate it. This is backwards compatible and will not affect Rekor v1 which needs no origin string.

This addresses the issue strictly for this command so that trusted_root files can be created for Rekor v2 servers. A later change will make more general changes to the TUF client to ensure the trusted material is generated properly for the server it relates to.

Summary

Release Note

Added support in cosign trusted-root create for generating a transparency log trusted root entry with a C2SP-conformant key ID, which is required for use with Rekor v2. Use --rekor-key=</path/to/key>,<server-name> to get key material for this kind of transparency log.

Documentation

@cmurphy cmurphy requested review from a team as code owners June 12, 2025 20:03
@haydentherapper
Copy link
Contributor

Can you run make docgen?

@codecov
Copy link

codecov bot commented Jun 12, 2025

Codecov Report

Attention: Patch coverage is 57.14286% with 9 lines in your changes missing coverage. Please review.

Project coverage is 34.37%. Comparing base (2ef6022) to head (9a9c0a7).
Report is 409 commits behind head on main.

Files with missing lines Patch % Lines
cmd/cosign/cli/trustedroot/trustedroot.go 66.66% 4 Missing and 2 partials ⚠️
cmd/cosign/cli/options/trustedroot.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4242      +/-   ##
==========================================
- Coverage   40.10%   34.37%   -5.73%     
==========================================
  Files         155      211      +56     
  Lines       10044    14060    +4016     
==========================================
+ Hits         4028     4833     +805     
- Misses       5530     8614    +3084     
- Partials      486      613     +127     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@haydentherapper
Copy link
Contributor

I'm not seeing anything different with file creation, I wonder if the windows test is a flake.

@haydentherapper
Copy link
Contributor

Looks like it's not a flake, I'd add additional logging to determine where it's failing. Windows paths are fun.


trustedrootCreate := CreateCmd{
CertChain: []string{fulcioChainPath},
RekorKeyPath: []string{rekorV1KeyPath, rekorV2KeyPath + ":rekor.server"},

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

@cmurphy cmurphy force-pushed the rekor-v2-cp branch 2 times, most recently from f174358 to 36d6da0 Compare June 13, 2025 17:50
When deducing the Rekor log key ID, cosign universally assumes a Rekor
v1 type checkpoint, which is not C2SP compliant. Rekor v2 is compliant
for all different types of keys, which means the log ID must be
calculated differently. This affects the `trusted-root create` tool
which must generate the log ID from the public key. This change adds the
ability for the trusted-root command to parse a ":" in the --rekor-key
flag to indicate that the trusted material should be generated for a
Rekor v2 log and that the origin string following the ":" should be used
to calculate it. This is backwards compatible and will not affect Rekor
v1 which needs no origin string.

This addresses the issue strictly for this command so that trusted_root
files can be created for Rekor v2 servers. A later change will make more
general changes to the TUF client to ensure the trusted material is
generated properly for the server it relates to.

Signed-off-by: Colleen Murphy <[email protected]>
@haydentherapper haydentherapper merged commit a7345fb into sigstore:main Jun 16, 2025
29 checks passed
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Jun 17, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [cosign](https://github.com/sigstore/cosign) | patch | `2.5.0` -> `2.5.1` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>sigstore/cosign (cosign)</summary>

### [`v2.5.1`](https://github.com/sigstore/cosign/blob/HEAD/CHANGELOG.md#v251)

[Compare Source](sigstore/cosign@v2.5.0...v2.5.1)

#### Features

- Add Rekor v2 support for trusted-root create ([#&#8203;4242](sigstore/cosign#4242))
- Add baseUrl and Uri to trusted-root create command
- Upgrade to TUF v2 client with trusted root
- Don't verify SCT for a private PKI cert ([#&#8203;4225](sigstore/cosign#4225))
- Bump TSA library to relax EKU chain validation rules ([#&#8203;4219](sigstore/cosign#4219))

#### Bug Fixes

- Bump sigstore-go to pick up log index=0 fix ([#&#8203;4162](sigstore/cosign#4162))
- remove unused recursive flag on attest command ([#&#8203;4187](sigstore/cosign#4187))

#### Docs

- Fix indentation in `verify-blob` cmd examples ([#&#8203;4160](sigstore/cosign#4160))

#### Releases

- ensure we copy the latest tags on each release ([#&#8203;4157](sigstore/cosign#4157))

#### Contributors

- arthurus-rex
- Babak K. Shandiz
- Bob Callaway
- Carlos Tadeu Panato Junior
- Colleen Murphy
- Dmitry Savintsev
- Emmanuel Ferdman
- Hayden B
- Ville Skyttä

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MC41Ny4xIiwidXBkYXRlZEluVmVyIjoiNDAuNTcuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants