notaryproject / roadmap

Roadmap for Notary Project
7 stars 6 forks source link

Notation CLI support for Timestamp Authority signatures #59

Open iamsamirzon opened 2 years ago

iamsamirzon commented 2 years ago

Summary - Notation client to support TSA signatures and verification support as per RFC 3161 Intended Outcome - The implementation matches with the specification

iamsamirzon commented 2 years ago

@gokarnm - This is the roadmap item related to timestamping.

iamsamirzon commented 2 years ago

@FeynmanZhou - We discussed this in our NV2 community meeting today. Propose we include the "Sign" part in RC-1 and the "Verify" part of it can come in "RC-2". Do discuss with @shizhMSFT on it.

FeynmanZhou commented 2 years ago

@iamsamirzon It looks like Notation CLI has supported timestamp, see https://github.com/notaryproject/notation/pull/171/files#diff-4f0565caf9b5f059f3b256722911a83386beb3d5c0dc75b30b6fc91d451e551cR65

iamsamirzon commented 2 years ago

Yes, there was support added back in Alpha-1. This roadmap item is to ensure the implementation ( along with tests) meets the agreed on spec

FeynmanZhou commented 2 years ago

Yes, there was support added back in Alpha-1. This roadmap item is to ensure the implementation ( along with tests) meets the agreed on spec

Okay, we need to verify it for the next step.

gokarnm commented 2 years ago

There are open questions and work related to

iamsamirzon commented 2 years ago

@shizhMSFT , @dtzar - We need to bring in the signing part back into RC-1. This item is not yet complete for RC-1.

dtzar commented 2 years ago

Looks like this work could be included in whomever implements https://github.com/notaryproject/notation-go/issues/78 I would recommend putting the three bullets from @gokarnm above either into that issue or a separate issue(s) depending on the rough size of the work to be done.

dtzar commented 2 years ago

This issue also relevant to the completion of this item: https://github.com/notaryproject/notation-go/issues/13

iamsamirzon commented 2 years ago

@dtzar - There was an item in the spreadsheet for this , row #22. It is marked green ( to indicate complete), but it is not. @shizhMSFT team was looking to implement this. Lets touch base on this with them

shizhMSFT commented 2 years ago

The default TSA to use during signing

As discussed in previous Notary community meetings, we will not provide a default TSA for signing. Users must specify their trusted TSA when signing.

Distribute public TSA roots in a default named trust store x509/tsa/public-tsa

This item is a successor of distributing roots for x509/ca/....

Improvements to custom CMS verification code for TSA verification

We need more clarification on the "improvements".

iamsamirzon commented 2 years ago

@gokarnm , @rgnote - Could you elaborate on the "improvements" https://github.com/notaryproject/roadmap/issues/59#issuecomment-1160734080

iamsamirzon commented 1 year ago

Based on the agreement in NV2 community call on 12/5/2022, moving this out of RC-2

zosocanuck commented 1 year ago

It would be great if we can accelerate TSA signature support for an upcoming release, and as such would like to get feedback around the potential to leverage an existing golang timestamping library to implement this roadmap item.

I have a positive experience with the library and it is even being used by the Sigstore/cosign project.

@priteshbandi

shizhMSFT commented 1 year ago

The prerequisites of TSA signature support are

Unfortunately, there are no known reliable mature go libraries implementing RFC 3161 and RFC 2315.

The timestamp library github.com/digitorus/timestamp, which is also used by cosign, is built on top of github.com/digitorus/pkcs7, which is a fork of https://github.com/mozilla-services/pkcs7 with enhanced features (but not security). However, the maturity of those libraries are still in an early stage and should not be used for production.

Here are some code snippets from github.com/digitorus/pkcs7:

Note: Unit tests in github.com/digitorus/pkcs7 are failing due to lack of maintenance :(

shizhMSFT commented 1 year ago

To ensure security of notation, we need to ensure that we have production-level CMS and Timestamp go libraries (we don't need to implement the full spec but implement what we need).

There was an attempt in notation-core-go but it was at a prototype maturity (insufficient unit tests) and has its own security vulnerability.