Skip to content

Commit 3b0743c

Browse files
author
Patrick Zheng
authored
docs: update spec for timestamping (#290)
* specs related to Timestamping Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * updated Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * updated per review Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * updated per review Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * updated per review Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * updated per review Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * nit Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update per review Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update timestamping spec Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * revise based on discussions Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * revise based on discussions Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * revise based on discussions Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * timestamp Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * timestamp Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * clean up Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * refactored to trust policy 2.0 Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * trust policy 2.0 Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * updated per comments Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * updated per review Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update per 5/20 community meeting Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * added diagram for better understanding Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * clean up Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * clean up Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * nit update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * nit updates Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * nit updates Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * updated per review Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * update Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> * updated based on review Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> --------- Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com>
1 parent 5a75830 commit 3b0743c

File tree

7 files changed

+209
-101
lines changed

7 files changed

+209
-101
lines changed

specs/plugin-extensibility.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ This interface targets plugins that integrate with providers of basic cryptograp
232232
1. Check if `response.signingAlgorithm` is one of [supported signing algorithms](./signature-specification.md#algorithm-selection).
233233
2. Check that the plugin did not modify `request.payload` before generating the signature, and the signature is valid for the given payload. Verify the hash of the `request.payload` against `response.signature`, using the public key of signing certificate (leaf certificate) in `response.certificateChain` along with the `response.signingAlgorithm`. This step does not include certificate chain validation (certificate chain leads to a trusted root configured in Notation's Trust Store), or revocation check.
234234
3. Check that the `response.certificateChain` conforms to [Certificate Requirements](./signature-specification.md#certificate-requirements).
235-
5. Assemble the JWS Signature envelope using `response.signature`, `response.signingAlgorithm` and `response.certificateChain`. Notation may also generate and include timestamp signature in this step.
235+
5. Assemble the signature envelope using `response.signature`, `response.signingAlgorithm` and `response.certificateChain`. If the signing scheme is [`notary.x509`](./signing-scheme.md/#notaryx509), implementations SHOULD also request and include TSA timestamp countersignature in this step. The `certReq` field in the [timestamping request](https://datatracker.ietf.org/doc/html/rfc3161#section-2.4.1) MUST be set to true.
236236
6. Generate a signature manifest for the given signature envelope.
237237
2. Else if, plugin supports capability `SIGNATURE_GENERATOR.ENVELOPE` *(covered in next section)*
238238
3. Return an error
@@ -355,7 +355,7 @@ All response attributes are required.
355355

356356
### Signature Envelope Generator
357357

358-
This interface targets plugins that in addition to signature generation want to generate the complete signature envelope. This interface allows plugins to have full control over the generated signature envelope, and can append additional signed and unsigned metadata, including timestamp signatures. The plugin must be signature envelope format aware, and implement new formats when Notary Project adopts new formats.
358+
This interface targets plugins that in addition to signature generation want to generate the complete signature envelope. This interface allows plugins to have full control over the generated signature envelope, and can append additional signed and unsigned metadata, including timestamp countersignatures. The plugin must be signature envelope format aware, and implement new formats when Notary Project adopts new formats.
359359

360360
#### Signing workflow using plugin
361361

@@ -366,14 +366,15 @@ This interface targets plugins that in addition to signature generation want to
366366
1. Execute the plugin with `get-plugin-metadata` command
367367
1. If plugin supports capability `SIGNATURE_GENERATOR.ENVELOPE`
368368
1. Execute the plugin with `generate-envelope` command. Set `request.keyId` and the optional `request.pluginConfig` to corresponding values associated with signing key `keyName` in `config.json`. Set `request.payload` to base64 encoded the [Notary Project signature Payload](./signature-specification.md#payload), `request.payloadType` to `application/vnd.cncf.notary.payload.v1+json` and `request.signatureEnvelopeType` to a pre-defined type (`application/jose+json` for JWS).
369-
2. `response.signatureEnvelope` contains the base64 encoded signature envelope, value of `response.signatureEnvelopeType` MUST match `request.signatureEnvelopeType`.
370-
3. Validate the generated signature, return an error if of the checks fails.
369+
2. If plugin supports timestamping under signing scheme [`notary.x509`](./signing-scheme.md/#notaryx509), the plugin SHOULD request and include TSA timestamp countersignature in the signature envelope at this step. The timestamp countersignature MUST be [RFC 3161](https://datatracker.ietf.org/doc/html/rfc3161#section-2.4.2) compliant. The `certReq` field in the [timestamping request](https://datatracker.ietf.org/doc/html/rfc3161#section-2.4.1) MUST be set to true.
370+
3. `response.signatureEnvelope` contains the base64 encoded signature envelope, value of `response.signatureEnvelopeType` MUST match `request.signatureEnvelopeType`.
371+
4. Validate the generated signature envelope, return an error if any of the checks fails.
371372
1. Check if `response.signatureEnvelopeType` is a supported envelope type and `response.signatureEnvelope`'s format matches `response.signatureEnvelopeType`.
372373
2. Check if the signing algorithm in the signature envelope is one of [supported signing algorithms](./signature-specification.md#algorithm-selection).
373374
3. Check that the [`targetArtifact` descriptor](./signature-specification.md#payload) in JWSPayload in `response.signatureEnvelope` matches `request.payload`. Plugins MAY append additional annotations but MUST NOT replace/override existing descriptor attributes and annotations.
374-
4. Check that `response.signatureEnvelope` can be verified using the public key and signing algorithm specified in the signing certificate, which is embedded as part of certificate chain in `response.signatureEnvelope` . This step does not include certificate chain validation (certificate chain leads to a trusted root configure in Notation), or revocation check.
375-
5. Check that the certificate chain in `response.signatureEnvelope` confirm to [Certificate Requirements].
376-
4. Generate a signature manifest for the given signature envelope, and append `response.annotations` to manifest annotations.
375+
4. Check that `response.signatureEnvelope` can be verified using the public key and signing algorithm specified in the signing certificate, which is embedded as part of certificate chain in `response.signatureEnvelope`. This step does not include certificate chain validation (certificate chain leads to a trusted root configured in Notation), or revocation check.
376+
5. Check that the certificate chain in `response.signatureEnvelope` and [timestamp countersignature](./signature-specification.md#unsigned-attributes) confirm to [certificate requirements](./signature-specification.md#certificate-requirements).
377+
5. Generate a signature manifest for the given signature envelope, and append `response.annotations` to manifest annotations.
377378
2. Else if plugin supports capability `SIGNATURE_GENERATOR.RAW` *(covered in previous section)*
378379
3. Return an error
379380

@@ -510,11 +511,11 @@ This allows implementations of the [Notary Project signature specification](./si
510511
"criticalAttributes" :
511512
{
512513
"contentType" : "application/vnd.cncf.notary.payload.v1+json",
513-
// One of notary.default.x509 or notary.signingAuthority.x509
514-
"signingScheme" : "notary.default.x509" | "notary.signingAuthority.x509",
514+
// One of notary.x509 or notary.x509.signingAuthority
515+
"signingScheme" : "notary.x509" | "notary.x509.signingAuthority",
515516
// Value is always RFC 3339 formatted date time string
516517
"expiry": "2022-10-06T07:01:20Z",
517-
// if signingScheme is notary.signingAuthority.x509.
518+
// if signingScheme is notary.x509.signingAuthority
518519
"authenticSigningTime": "2022-04-06T07:01:20Z",
519520
// Name of the verification plugin
520521
"verificationPlugin": "com.example.nv2plugin",
@@ -604,6 +605,6 @@ All response attributes are required.
604605

605606
## FAQ
606607

607-
**Q: Will Notation generate timestamp signature for Signature Envelope Generator plugin or its responsibility of plugin publisher?**
608+
**Q: Will Notation generate timestamp countersignature for Signature Envelope Generator plugin or its responsibility of plugin publisher?**
608609

609-
**A :** If the envelope generated by a Signature Envelope Generator plugin contains timestamp signature, Notation will not append additional timestamp signature, else it will generate the timestamp signature and append it to the envelope as an unsigned attribute.
610+
**A :** The Signature Envelope Generator plugin has full control over the generated signature envelope including any timestamp countersignature. Notation will NOT add/update/delete any timestamp countersignature in an envelope that's generated by a Signature Envelope Generator plugin.

specs/signature-envelope-cose.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Note: The above examples are represented using the [extended CBOR diagnostic not
128128
- **[`content type`](https://datatracker.ietf.org/doc/html/rfc8152#section-3.1)** (*tstr*): The REQUIRED parameter content type (label `3`) is used to declare the media type of the secured content (the payload). The supported value is `application/vnd.cncf.notary.payload.v1+json`.
129129
- **`io.cncf.notary.signingScheme`** (*tstr*, critical): This REQUIRED header specifies the [Notary Project signing scheme](./signing-scheme.md) used by the signature. Supported values are `notary.x509` and `notary.x509.signingAuthority`.
130130
- **`io.cncf.notary.signingTime`** (*date/time*): This header specifies the time at which the signature was generated. This is an untrusted date/time, and therefore not used in trust decisions. Its value is an Epoch-Based Date/Time defined in [RFC 8949](https://datatracker.ietf.org/doc/html/rfc8949#section-3.4.2). The optional fractional seconds SHOULD NOT be used. This claim is REQUIRED and only valid when signing scheme is `notary.x509`.
131-
- **`io.cncf.notary.authenticSigningTime`** (*date/time*, critical): This header specifies the authenticated time at which the signature was generated. Its value is an Epoch-Based Date/Time defined in [RFC 8949](https://datatracker.ietf.org/doc/html/rfc8949#section-3.4.2). The optional fractional seconds SHOULD NOT be used. This claim is REQUIRED and only valid when signing scheme is `notary.x509.signingAuthority` .
131+
- **`io.cncf.notary.authenticSigningTime`** (*date/time*, critical): This header specifies the authenticated time at which the signature was generated. Its value is an Epoch-Based Date/Time defined in [RFC 8949](https://datatracker.ietf.org/doc/html/rfc8949#section-3.4.2). The optional fractional seconds SHOULD NOT be used. This claim is REQUIRED and only valid when signing scheme is `notary.x509.signingAuthority`.
132132
- **`io.cncf.notary.expiry`** (*date/time*, critical): This OPTIONAL header provides a "best by use" time for the artifact, as defined by the signer. Its value is an Epoch-Based Date/Time defined in [RFC 8949](https://datatracker.ietf.org/doc/html/rfc8949#section-3.4.2). The optional fractional seconds SHOULD NOT be used.
133133

134134
## Unprotected Headers
@@ -154,8 +154,7 @@ The Notary Project signature supports the following unprotected header parameter
154154
Note: `<<` and `>>` are used to notate the CBOR byte string resulting from encoding the data item.
155155

156156
- **[`x5chain`](https://datatracker.ietf.org/doc/html/draft-ietf-cose-x509-08#section-2)** (*array of bstr*): This REQUIRED parameter (label `33` by [IANA](https://www.iana.org/assignments/cose/cose.xhtml#header-parameters)) contains the ordered list of X.509 certificate or certificate chain ([RFC5280](https://datatracker.ietf.org/doc/html/rfc5280)) corresponding to the key used to digitally sign the COSE. The certificate chain is represented as an array of certificate, each certificate in the array is DER encoded and then wrapped in a CBOR byte string. The certificate containing the public key corresponding to the key used to digitally sign the COSE MUST be the first certificate, followed by the intermediate and root certificates in the correct order. Refer [*Certificate Chain* unsigned attribute](signature-specification.md#unsigned-attributes) for more details. Optionally, this header can be presented in the protected header.
157-
- **`io.cncf.notary.timestampSignature`** (*bstr*): This OPTIONAL header is used to store countersignature that provides authentic signing time. Only [RFC3161]([rfc3161](https://datatracker.ietf.org/doc/html/rfc3161#section-2.4.2)) compliant `TimeStampToken` are supported.
158-
- **TODO** Define the opaque datum (hash of envelope) that is sent to TSA, and how TSA response (time stamp token) is represented in this header.
157+
- **`io.cncf.notary.timestampSignature`** (*bstr*): This OPTIONAL header is used to store a countersignature that proves the signature was generated before the timestamp. Only [RFC 3161](https://datatracker.ietf.org/doc/html/rfc3161#section-2.4.2) compliant `TimeStampToken` are supported. If present, this header is validated and used solely under the [`notary.x509`](./signing-scheme.md/#notaryx509) signing scheme. Refer [*Timestamp Signature* unsigned attribute](signature-specification.md#unsigned-attributes) for more details.
159158
- **`io.cncf.notary.signingAgent`** (*tstr*): This OPTIONAL header provides the identifier of a client (e.g. Notation) that produced the signature. E.g. `notation/1.0.0`. Refer [*Signing Agent* unsigned attribute](signature-specification.md#unsigned-attributes) for more details.
160159

161160
## Signature

specs/signature-envelope-jws.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ Example with Signing Scheme `notary.x509.signingAuthority`
120120
- **[`cty`](https://datatracker.ietf.org/doc/html/rfc7515#section-4.1.10)**(*string*): The REQUIRED header content-type is used to declare the media type of the secured content (the payload). The supported value is `application/vnd.cncf.notary.payload.v1+json`.
121121
- **`io.cncf.notary.signingScheme`**(*string*)(critical): This REQUIRED header specifies the [Notary Project signing scheme](./signing-scheme.md) used by the signature. Supported values are `notary.x509` and `notary.x509.signingAuthority`.
122122
- **`io.cncf.notary.signingTime`**(*string*): This header specifies the time at which the signature was generated. This is an untrusted timestamp, and therefore not used in trust decisions. Its value is a [RFC 3339][rfc3339] formatted date time, the optional fractional second ([time-secfrac][rfc3339][[1](https://datatracker.ietf.org/doc/html/rfc3339#section-5.3)]) SHOULD NOT be used. This claim is REQUIRED and only valid when signing scheme is `notary.x509`.
123-
- **`io.cncf.notary.authenticSigningTime`**(*string*)(critical): This header specifies the authenticated time at which the signature was generated. Its value is a [RFC 3339][rfc3339] formatted date time, the optional fractional second ([time-secfrac][rfc3339][[1](https://datatracker.ietf.org/doc/html/rfc3339#section-5.3)]) SHOULD NOT be used. This claim is REQUIRED and only valid when signing scheme is `notary.x509.signingAuthority` .
123+
- **`io.cncf.notary.authenticSigningTime`**(*string*)(critical): This header specifies the authenticated time at which the signature was generated. Its value is a [RFC 3339][rfc3339] formatted date time, the optional fractional second ([time-secfrac][rfc3339][[1](https://datatracker.ietf.org/doc/html/rfc3339#section-5.3)]) SHOULD NOT be used. This claim is REQUIRED and only valid when signing scheme is `notary.x509.signingAuthority`.
124124
- **`io.cncf.notary.expiry`**(*string*)(critical): This OPTIONAL header provides a “best by use” time for the artifact, as defined by the signer. Its value is a [RFC 3339][rfc3339] formatted date time, the optional fractional second ([time-secfrac][rfc3339][[1](https://datatracker.ietf.org/doc/html/rfc3339#section-5.3)]) SHOULD NOT be used.
125125
- **[`crit`](https://datatracker.ietf.org/doc/html/rfc7515#section-4.1.11)**(*array of strings*): This REQUIRED (optional as per JWS spec, but required in Notary Project JWS signature) header lists the headers that implementation MUST understand and process. It MUST only contain headers apart from registered headers (e.g. `alg`, `cty`) in JWS specification. This header MUST contain `io.cncf.notary.signingScheme` which is a required critical header, and optionally contain `io.cncf.notary.authenticSigningTime` and `io.cncf.notary.expiry` if these critical headers are present in the signature.
126126

@@ -144,8 +144,7 @@ The Notary Project signature supports following unprotected headers: `timestamp`
144144
```
145145

146146
- **[`x5c`](https://datatracker.ietf.org/doc/html/rfc7515#section-4.1.6)** (*array of strings*): This REQUIRED header contains the ordered list of X.509 certificate or certificate chain([RFC5280](https://datatracker.ietf.org/doc/html/rfc5280)) corresponding to the key used to digitally sign the JWS. The certificate chain is represented as a JSON array of certificate value strings, each string in the array is a base64-encoded DER certificate value. The certificate containing the public key corresponding to the key used to digitally sign the JWS MUST be the first certificate, followed by the intermediate and root certificates in the correct order. Refer [*Certificate Chain* unsigned attribute](signature-specification.md#unsigned-attributes) for more details.
147-
- **`io.cncf.notary.timestampSignature`** (*string*): This OPTIONAL header is used to store countersignature that provides authentic signing time. Only [RFC3161]([rfc3161](https://datatracker.ietf.org/doc/html/rfc3161#section-2.4.2)) compliant `TimeStampToken` are supported.
148-
- **TODO** Define the opaque datum (hash of envelope) that is sent to TSA, and how TSA response (time stamp token) is represented in this header.
147+
- **`io.cncf.notary.timestampSignature`** (*string*): This OPTIONAL header is used to store a base64-encoded countersignature that proves the signature was generated before the timestamp. Only [RFC 3161](https://datatracker.ietf.org/doc/html/rfc3161#section-2.4.2) compliant `TimeStampToken` are supported. If present, this header is validated and used solely under the [`notary.x509`](./signing-scheme.md/#notaryx509) signing scheme. Refer [*Timestamp Signature* unsigned attribute](signature-specification.md#unsigned-attributes) for more details.
149148
- **`io.cncf.notary.signingAgent`**(*string*): This OPTIONAL header provides the identifier of a client (e.g. Notation) that produced the signature. E.g. “notation/1.0.0”. Refer [*Signing Agent* unsigned attribute](signature-specification.md#unsigned-attributes) for more details.
150149

151150
## Signature

0 commit comments

Comments
 (0)