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

Fix keyless verification of openvex attesatations #147

Merged
merged 3 commits into from
Dec 6, 2023

Conversation

puerco
Copy link
Member

@puerco puerco commented Dec 6, 2023

TLDR

This is a large PR that fixes keyless verification of the OpenVEX attestations as reported in #143

This is a solid but temporary fix, the functionality in this PR will be moved to openvex/discoery and an upcoming trust module but it should do the work while we finish those new modules.

The summary of changes

  1. We now upload the signatures to rekor
  2. Results of signing operation and appending to the tlog are now recorded in the attestation struct
  3. We now add the needed OCI annotations when attaching images to enable keyless verification

Commit 4e44f21: Refactor attestation.Sign() + Tlog append

The main goal is to add two missing features:

  1. Register the signature data to Rekor

    After signing, we now register the signature in the sigstore transparency
    log. This is essential to allow for keyless verification.

  2. New SignatureData Field

    The attestation now has a new SignatureData field that captures the results
    of the signing operation. This is required to make data like the cert and the
    proof of inclusion available externally (eg to record them in oci annotations).

The attestation.Sign() method has been heavily refactored but should be simppler
as the work it does is now broken into three internal functions:

  • initSigning: creates context and options
  • signAttestation: Performs the actual signing
  • appendSignatureDataToTLog: Uploads data to rekor

Commit 5aa0d44: OCI Annotations

This commit modifies the attachAttestation function of the vexctl
implementation to add the OCI annotations required to keylessly
verify OpenVEX attestations.

/cc @cpanato
Fixes #143

Signed-off-by: Adolfo García Veytia (Puerco) [email protected]

This is a large commit that refactors the Sign() method of the attestation.
The main goal is to add two missing features:

1. Register the signature data to Rekor

After signing, we now register the signature in the sigstore transparency
log. This is essentail to allow for keyless verification.

2. New SignatureData Field

The attestation now has a new SignatureData field that captures the results
of the signing operation. This is required to make data like the cert and the
proof of inlclusion available externally (eg to record them in oci annotations).

The attestation.Sign() method has been heavily refactored but should be simppler
as the work it does is now broken into three internal functions:

 initSigning: creates context and options
 signAttestation: Performs the actual signing
 appendSignatureDataToTLog: Uploads data to rekor

Signed-off-by: Adolfo García Veytia (Puerco) <[email protected]>
@puerco puerco added the bug Something isn't working label Dec 6, 2023
@puerco puerco requested a review from cpanato December 6, 2023 03:57
This commit modifies the attachAttestation function of the vexctl
implementation to add the OCI annotations required to keylessly
verify OpenVEX attestations.

Signed-off-by: Adolfo García Veytia (Puerco) <[email protected]>
Signed-off-by: Adolfo García Veytia (Puerco) <[email protected]>
@puerco
Copy link
Member Author

puerco commented Dec 6, 2023

cosign verify attestation now works

image

@cpanato
Copy link
Member

cpanato commented Dec 6, 2023

thanks

@cpanato cpanato merged commit f168a82 into openvex:main Dec 6, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vexctl attest --sign doesn't create a verifiable attestation
2 participants