sigstore / rekor

Software Supply Chain Transparency Log
https://sigstore.dev
Apache License 2.0
883 stars 163 forks source link

Support Roughtime types in Rekor #831

Open asraa opened 2 years ago

asraa commented 2 years ago

Description

Add an additional timestmaping type to Rekor.

Roughtime is a modern timestamping standard https://blog.cloudflare.com/roughtime/

In addition to supporting RFC 3161 for compatibility (eg https://github.com/sigstore/gitsign/issues/22#issuecomment-1126291036), Rekor could also log Roughtime timestamps.

There is some discussion on and linking from https://github.com/sigstore/rekor/issues/824#event-6600727837 on separating Rekor's TSA and supporting Roughtime.

Adding Roughtime entries to Rekor would also allow clients to fencepost their entry upload, which will allow them to externally verify the system clock used in Rekor's integratedTime fields.

e.g. Rekor may be able to sandwich an entry upload between two roughtime fenceposts on request.

asraa commented 2 years ago

cc @haydentherapper

kommendorkapten commented 2 years ago

Reading the draft RFC for Roughtime: https://datatracker.ietf.org/doc/draft-ietf-ntp-roughtime/ and the blog post above, it seems like it's an alternative to NTP, not as a TSA?

While Roughtime expects a 32byte nonce in each request, is the idea to use the sha256 digest of some entity as the nonce, and so create time-stamping authority via that?

What can be done with Roughtime is to chain requests to cryptographically bind multiple responses into a chain (hash chain). Would the idea here be that let Rekor first query an external Roughtime server, hash the to be stored entry with the response, then use that digest as the nonce when querying the external Roughtime server again, and the persist that result on the ledger?

If the threat we are trying to protect against is not trusting Rekor's internal clock, wouldn't it suffice to integrate with a TSA, and extend the response from Rekor to include that signed timestamp? (the signing can be done over e.g. the signedTimestamp already produced by Rekor, which will bind Rekor's internal clock, log id/index and the digest of the record together with the time from the external trusted TSA).

kommendorkapten commented 2 years ago

Is there any known usage of Roughtime? Or a good client? I found this https://github.com/cloudflare/roughtime and tested it out a bit. Sadly it did not work for any of the provided servers in the listed ecoysystem. Read through this https://github.com/cloudflare/roughtime/issues/25 issue which seems to indicate that the IETF draft have advanced quite a bit, and the current CloudFlare implementation is not up to date. I did some naive testing by changing the version to the specified version in the latest IETF draft and got at least a response from one of the listed servers, but as the response format seems to have been updated it was useless :)