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 Result message to communicate the result of a verification #520

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

codysoyland
Copy link
Member

Summary

This PR is an attempt at formalizing the output of a verifier using a new message: dev.sigstore.verification.v1.Result.

This initial form was extracted from sigstore-go, from the type VerificationResult, with the following changes:

  • I removed VerifiedIdentity as it seems to echo back the verification inputs and the matching values can all be found in CertificateSummary.
  • Added status and error fields which may be used to communicate a verification failure.
  • Added UnverifiedData which may be used to communicate if there were unverified TSA/Tlog signatures, as described in Include skipped signatures in VerificationResult sigstore-go#48

Things to consider:

  • Is this a good general shape to use?
  • Should we add support for error codes?
  • Any other data that should be included?
    • perhaps the full verified certificate chain?

I haven't generated docs/code yet to keep the review simple.

Fixes #66

Release Note

Documentation

Copy link
Collaborator

@haydentherapper haydentherapper left a comment

Choose a reason for hiding this comment

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

This looks really good!

I think we should duplicate what you've created for (Unverified)TimestampResult for Fulcio and Rekor as well.

I don't think we need to include the cert chain for Fulcio or public key for Rekor, rather we should include some unique ID to correlate back to the trust root. For Fulcio, that could be the URI. For Rekor, that could be the log ID (URI will be unique in the future with Rekor v2).

For Rekor, we should specify what log proofs were unverifiable.

For Fulcio, we could also call this "CertificateAuthorityResult" to handle private PKI verification. We can include the list of cert subject key IDs.

@@ -162,3 +162,164 @@ message Input {
// provided.
optional Artifact artifact = 4;
}

// CertificateSummary contains verified metadata from the certificate
message CertificateSummary {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you think we should get rid of CertificateIdentity? I prefer this new message as clients shouldn't need to know OID values.

Copy link
Member

Choose a reason for hiding this comment

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

They serve different different purposes, the CertificateIdentity is for verifying, as it allows regexps to be set for the SAN.

And it also allows for setting the extensions needed during verification. I agree that clients knowing with OIDs to use os not optimal, but clients can implement helper function here to configure the verification.

message SignatureResult {
// If the bundle contains a public key, the public_key_id field will
// contain the public key ID
string public_key_id = 1;
Copy link
Collaborator

Choose a reason for hiding this comment

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

The bundle should contain a public_key_id if a key is to be used to verify it, so is this repetitive? Though maybe this is useful when a keyset is provided and the bundle doesn't contain the ID (since it's an optional hint)?

Copy link
Member

Choose a reason for hiding this comment

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

minor but this is called hint in the PublicKeyIdentifier message:

Copy link
Member

Choose a reason for hiding this comment

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

Should these be a oneof:

message SignatureResult {
        oneof {
                string public_key_hint = 1;
                CertificateSummary certificate = 2;
        }
}


message TimestampResult {
// The type of timestamp verification; may be `Tlog`, `TimestampAuthority`, or `CurrentTime`
string type = 1;
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: should make it a enum


// The OIDC issuer. Should match `iss` claim of ID token or, in the case of
// a federated login like Dex it should match the issuer URL of the
// upstream issuer. The issuer is not set the extensions are invalid and
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// upstream issuer. The issuer is not set the extensions are invalid and
// upstream issuer. The issuer is not set if the extensions are invalid and

?

// upstream issuer. The issuer is not set the extensions are invalid and
// will fail to render.
// OID 1.3.6.1.4.1.57264.1.8 and 1.3.6.1.4.1.57264.1.1 (Deprecated)
string issuer = 3;
Copy link
Member

Choose a reason for hiding this comment

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

should we maybe align the field numbers with the last component of the OID?

// MUST be application/vnd.dev.sigstore.verificationresult+json;version=0.1
string media_type = 1;

// MUST be either "success" or "failure"
Copy link
Member

Choose a reason for hiding this comment

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

should be an enum?

// MUST be either "success" or "failure"
string status = 2;

// SHOULD contain an error message if status == "failure"
Copy link
Member

Choose a reason for hiding this comment

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

also, MUST be empty if status is success?


// If the bundle contains a DSSE, this result shonuld contain the
// deserialized and verified statement
string statement = 3;
Copy link
Member

Choose a reason for hiding this comment

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

bytes instead of string?

Copy link
Member

Choose a reason for hiding this comment

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

I think the comments should be rephrased a bit.

// If the bundle contains DSSE wrapped in-toto statement , this result contains the
// deserialized in-toto statement

As an in-toto statement is a JSON encoded object, i.e. a string.

// OID 1.3.6.1.4.1.57264.1.8 and 1.3.6.1.4.1.57264.1.1 (Deprecated)
string issuer = 3;

// Deprecated
Copy link
Member

Choose a reason for hiding this comment

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

The deprecated OIDs, can we ignore them here? They were marked as deprecated two years go (almost to the date) sigstore/fulcio#945.

If a specific client want's to support them, that's fine. But from a standard perspective, I think we should only focus on the current extensions.

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.

Define Bundle Verification Result
4 participants