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

Implement cosign verifier #21

Open
binbin-li opened this issue Jan 15, 2025 · 3 comments · May be fixed by ratify-project/ratify-verifier-go#10
Open

Implement cosign verifier #21

binbin-li opened this issue Jan 15, 2025 · 3 comments · May be fixed by ratify-project/ratify-verifier-go#10
Assignees
Labels
enhancement New feature or request

Comments

@binbin-li
Copy link
Contributor

Is your feature request related to a problem?

n/a

What solution do you propose?

n/a

What alternatives have you considered?

n/a

Any additional context?

No response

@binbin-li binbin-li added the enhancement New feature or request label Jan 15, 2025
@junczhu
Copy link
Contributor

junczhu commented Feb 6, 2025

Please assign this to me

@junczhu
Copy link
Contributor

junczhu commented Feb 11, 2025

Here is the summary about the verifier functionality provided by sigstore/cosign pkg, Stroked on the items that for legacy version support:

  1. Creating Cosign Options: The cosign.CheckOpts struct is used to configure the verification options.

  2. Loading Public Key: The cosign.PemToECDSAKey function is used to load a public key from a PEM-encoded file:

  3. Getting Rekor and CT Log Public Keys: The cosign.GetRekorPubs and cosign.GetCTLogPubs functions are used to fetch the Rekor and Certificate Transparency Log public keys:

  4. Creating Static Signature: The static.NewSignature function is used to create a static signature from the blob content:

(5. Processing AKV Signature: The processAKVSignature function uses the static.NewSignature function to create a static signature after processing the Azure Key Vault signature:)

  1. Loading Verifier: The signature.LoadVerifier function is used to load the appropriate verifier based on the public key type and bytes:

  2. Verifying Image Signature: The cosign.VerifyImageSignature function is used to verify the signature of an image.

@junczhu junczhu linked a pull request Feb 13, 2025 that will close this issue
3 tasks
@junczhu
Copy link
Contributor

junczhu commented Feb 16, 2025

Key verification involves using a public key to verify the signatures. This method ensures that the signatures match the provided public key. Key verification typically includes the following steps:

  • Load Public Key: The public key is loaded from a specified reference (KeyRef).
  • Rekor Client: A Rekor client is used to fetch and verify the transparency log entries.
  • CT Log Public Keys: Certificate Transparency (CT) log public keys are fetched for verifying Signed Certificate Timestamps (SCTs).
  • TSA Certificates: If using signed timestamps, TSA certificates are loaded.
  • Signature Verifier: The public key is used as the signature verifier.

Keyless verification involves using certificates and certificate chains to verify the signatures. This method relies on trusted certificate authorities (CAs) and transparency logs. Keyless verification typically includes the following steps:

  • Load Certificates: Certificates are loaded from specified references (CertRef, CertChain, CARoots, CAIntermediates).
  • Fulcio Roots: If no certificates are provided, Fulcio root certificates are fetched.
  • Rekor Client: A Rekor client is used to fetch and verify the transparency log entries.
  • CT Log Public Keys: Certificate Transparency (CT) log public keys are fetched for verifying Signed Certificate Timestamps (SCTs).
  • Certificate Extensions: Various certificate extensions (e.g., GitHub workflow details) are verified.
  • Signature Verifier: The certificate is used as the signature verifier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants