Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for signature filtering. #131

Merged
merged 2 commits into from Feb 7, 2022
Merged

Add support for signature filtering. #131

merged 2 commits into from Feb 7, 2022

Conversation

priteshbandi
Copy link
Contributor

Why we need this change

An OCI artifact can have multiple signatures associated with it. To efficiently perform the signature verification we need a mechanism to filter out the signatures based on the user trust criteria. Otherwise, we will have to download and evaluate all the associated signatures(until a match is found). Also, there is no upper bound on the number of signatures that can be associated with an artifact, this poses an availability risk as signature evaluation as signature verification workflow might timeout(if configured) or run for a long time.

Supported filtering criteria

Filter based on SHA256 of signing certificate and certificate chain.

Mechanism/Design

To filter out signatures based on the aforementioned trust criteria, we need to surface this trust criteria information in the signature artifact manifest. The only entry in the signature artifact manifest that allows arbitrary data is annotations, so we are using annotations to surface certificate(s) identifier i.e. SHA-256 fingerprints of certificate and certificate chain.

Signed-off-by: Pritesh Bandi pritesb@amazon.com

Signed-off-by: Pritesh Bandi <pritesb@amazon.com>
@priteshbandi priteshbandi changed the title Adds support for signature filtering. Add support for signature filtering. Feb 4, 2022
Copy link
Contributor

@SteveLasker SteveLasker left a comment

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: Pritesh Bandi <pritesb@amazon.com>
@gokarnm
Copy link
Contributor

gokarnm commented Feb 5, 2022

LGTM!

Copy link
Contributor

@shizhMSFT shizhMSFT left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -20,7 +20,8 @@ The signature manifest has an artifact type which specifies it's a Notary V2 sig
- **`blobs`** (*array of objects*): This REQUIRED property contains collection of only one [artifact descriptor](https://github.com/oras-project/artifacts-spec/blob/main/descriptor.md) referencing signature envelope.
- **`mediaType`** (*string*): This REQUIRED property contains media type of signature envelope blob. The supported value is `application/jose+json`
- **`subject`** (*descriptor*): A REQUIRED artifact descriptor referencing the signed manifest, including, but not limited to image manifest, image index, oras-artifact manifest.
- **`annotations`** (*string-string map*): This OPTIONAL property contains arbitrary metadata for the artifact manifest. It can be used to store information about the signature.
- **`annotations`** (*string-string map*): This REQUIRED property contains metadata for the artifact manifest. It is being used to store information about the signature. Keys using the `org.cncf.notary` namespace are reserved for use in Notary and MUST NOT be used by other specifications.
- **`org.cncf.notary.x509certs.fingerprint.sha256`**: A REQUIRED annotation whose value contains the list of SHA-256 fingerprint of signing certificate and certificate chain used for signature generation. The list of fingerprints is present as a JSON array string.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: On the naming of fingerprint and thumbprint, which one is more popular or consistent?

@@ -20,7 +20,8 @@ The signature manifest has an artifact type which specifies it's a Notary V2 sig
- **`blobs`** (*array of objects*): This REQUIRED property contains collection of only one [artifact descriptor](https://github.com/oras-project/artifacts-spec/blob/main/descriptor.md) referencing signature envelope.
- **`mediaType`** (*string*): This REQUIRED property contains media type of signature envelope blob. The supported value is `application/jose+json`
- **`subject`** (*descriptor*): A REQUIRED artifact descriptor referencing the signed manifest, including, but not limited to image manifest, image index, oras-artifact manifest.
- **`annotations`** (*string-string map*): This OPTIONAL property contains arbitrary metadata for the artifact manifest. It can be used to store information about the signature.
- **`annotations`** (*string-string map*): This REQUIRED property contains metadata for the artifact manifest. It is being used to store information about the signature. Keys using the `org.cncf.notary` namespace are reserved for use in Notary and MUST NOT be used by other specifications.
- **`org.cncf.notary.x509certs.fingerprint.sha256`**: A REQUIRED annotation whose value contains the list of SHA-256 fingerprint of signing certificate and certificate chain used for signature generation. The list of fingerprints is present as a JSON array string.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: You may also want to note that the fingerprint is in HEX format.

@SteveLasker SteveLasker merged commit 1621554 into notaryproject:main Feb 7, 2022
@gokarnm gokarnm mentioned this pull request Mar 29, 2022
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.

None yet

4 participants