Skip to content

Conversation

jku
Copy link
Contributor

@jku jku commented Oct 10, 2025

This PR adds support for RFC3161 timestamps in the attestations. It is a draft because:

Supporting timestamps in the annotations is a requirement to using transparency log entries from rekor v2 (see #142 for details and links).

Fixes #142

CC @di

Details

  • Attestations now include timestamps if the Sigstore instance provides a TSA (the public good instance does)
  • The branch name is a little misleading: pypi-attestations still only produces attestations with rekor v1 entries because force_tlog_version is still used (this is tested in test_roundtrip())
  • After this PR attestations with rekor v2 entries are already considered valid (this is tested with a new test asset) -- we could change that but it does not seem necessary

@jku jku force-pushed the rekor-v2 branch 2 times, most recently from d31fcd9 to c272629 Compare October 13, 2025 08:29
jku added 3 commits October 14, 2025 14:39
* One attestation is from staging (rekor2 entry and timestamp)
* Other attestation is from production (rekor1 entry and timestamp)
@jku
Copy link
Contributor Author

jku commented Oct 15, 2025

The offline test likely breaks because I created new test assets. staging trust root has changed fairly recently, and sigstore-python does not contain the most up-to-date one. Test passed for me locally since my cached trust root is up-to-date.

I think the test should have a preparation step that makes sure the trust root has been updated, and then should run the verify in offline mode.

Current test assets require a trust root which is newer
than the one embedded in sigstore-python: Update the trust roots
before running offline tests.

Move the whole offline-test setup into Makefile to make it a little
easier to manage.
timestamps = []
if sigstore_bundle.verification_material.timestamp_verification_data:
ts_data = sigstore_bundle.verification_material.timestamp_verification_data
timestamps = [base64.b64encode(ts.as_bytes()) for ts in ts_data.rfc3161_timestamps]
Copy link
Contributor Author

@jku jku Oct 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose this is the main decision in this PR: A timestamp in the attestations serialization format is the base64 encoded timestamp response as defined in RFC3161.

For reference the timestamp use is defined in sigstore client spec, but it's basically the same as the use of integrated time in rekor1: timestamped data is the signature bytes, at least one timestamp time must be within lifetime of the signing certificate (and its chain) to prove the time of signing.

Copy link
Contributor Author

@jku jku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR currently contains two changes:

  • support for timestamps
  • Stop forcing rekor v1 when signing

We could separate these two as well since the latter one really only makes sense to do after Rekor v2 is recommended for signing in the Sigstore signingconfig (whereas the former change could be merged any time)

@facutuesca
Copy link
Collaborator

This PR currently contains two changes:

  • support for timestamps
  • Stop forcing rekor v1 when signing

We could separate these two as well since the latter one really only makes sense to do after Rekor v2 is recommended for signing in the Sigstore signingconfig (whereas the former change could be merged any time)

Is there an ETA for when Sigstore will start recommending Rekor v2 for signing? If not, let's split the PR.

@jku
Copy link
Contributor Author

jku commented Oct 20, 2025

Is there an ETA for when Sigstore will start recommending Rekor v2 for signing? If not, let's split the PR.

No date is set: We'd like to have more data on rekor v2 compatible client uptake before that. I would expect end of year.

I'll have a look at splitting this.

* Force Rekor tlog version 1 when signing
* Make sure this is the case with a check in test_roundtrip()

Not that rekor v2 entries are still considered valid in verification
already, and that timestamps are included in the attestation
even if the entry is from rekor v1
@jku
Copy link
Contributor Author

jku commented Oct 20, 2025

Ok the PR is split now, current state is documented in the description now:

  • timestamps are included in attestations
  • produced entries are still always rekor v1 -- another PR is required to switch to rekor v2 (after Sigstore Public Good instance enables that)
  • rekor v2 entries are already considered valid in verification

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.

Ensure pypi attestations can handle timestamps (and as result rekorv2 log entries)

2 participants