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

Print message when verifying with old TUF targets #1468

Merged
merged 2 commits into from
Feb 16, 2022

Conversation

haydentherapper
Copy link
Contributor

Summary

This adds console messages when the TUF metadata
used for Rekor or the CTFE key is marked as expired.

I haven't added a log message for Fulcio yet. The way
that certificates are verified is different. Instead of
multiple verifications where we can easily determine
which key successfully verified an object, the x509
library uses a CertPool and returns a valid chain.
I'll need to plumb through the TUF information.

Ticket Link

Fixes

Release Note

Added information when old TUF targets are used to verify signatures

Typical verification used VerifyBundle, which called
GetRekorKeys, which fetches keys from the TUF repo.
If the bundle was not present or for a specific error
when a duplicate log entry was present, then the tlog
entry would be verified using a public key fetched from
Rekor's API. This key was not verified using TUF metadata.

This change simply removes the API call and uses Rekor
public keys from the TUF repo.

Tested locally by not including the Rekor bundle in
the OCI signature, which will hit the code path to
fetch the entry from the log.

Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>
This adds console messages when the TUF metadata
used for Rekor or the CTFE key is marked as expired.

I haven't added a log message for Fulcio yet. The way
that certificates are verified is different. Instead of
multiple verifications where we can easily determine
which key successfully verified an object, the x509
library uses a CertPool and returns a valid chain.
I'll need to plumb through the TUF information.

Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>
@haydentherapper
Copy link
Contributor Author

Note that this includes the commit from #1467 too. Let me know if you have any feedback on the UX of this. I don't want this to be a scary warning, but I do think users should still be notified.

cc @asraa @dlorenc

@dlorenc
Copy link
Member

dlorenc commented Feb 16, 2022

The UX here is fine, is there any way we could make this work for machine readable output too? Maybe include the TUF root we verified against?

@haydentherapper
Copy link
Contributor Author

I'll take a look at piping some information to stdout. Is there any existing format for machine readable output? Just print JSON?

@dlorenc
Copy link
Member

dlorenc commented Feb 16, 2022

I'll take a look at piping some information to stdout. Is there any existing format for machine readable output? Just print JSON?

This can come in a separate PR - but yeah it's typically just when we do --format=json. The basic idea is just that if we feel information is important enough to display to a person, it probably makes sense to make it parseable in a script too.

@dlorenc dlorenc merged commit 18d2ce0 into sigstore:main Feb 16, 2022
@github-actions github-actions bot added this to the v1.6.0 milestone Feb 16, 2022
hatmarch pushed a commit to hatmarch/cosign that referenced this pull request Apr 19, 2022
* Verify tlog entries using the Rekor public keys from TUF

Typical verification used VerifyBundle, which called
GetRekorKeys, which fetches keys from the TUF repo.
If the bundle was not present or for a specific error
when a duplicate log entry was present, then the tlog
entry would be verified using a public key fetched from
Rekor's API. This key was not verified using TUF metadata.

This change simply removes the API call and uses Rekor
public keys from the TUF repo.

Tested locally by not including the Rekor bundle in
the OCI signature, which will hit the code path to
fetch the entry from the log.

Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>

* Print message when verifying with old TUF targets

This adds console messages when the TUF metadata
used for Rekor or the CTFE key is marked as expired.

I haven't added a log message for Fulcio yet. The way
that certificates are verified is different. Instead of
multiple verifications where we can easily determine
which key successfully verified an object, the x509
library uses a CertPool and returns a valid chain.
I'll need to plumb through the TUF information.

Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>
mlieberman85 pushed a commit to mlieberman85/cosign that referenced this pull request May 6, 2022
* Verify tlog entries using the Rekor public keys from TUF

Typical verification used VerifyBundle, which called
GetRekorKeys, which fetches keys from the TUF repo.
If the bundle was not present or for a specific error
when a duplicate log entry was present, then the tlog
entry would be verified using a public key fetched from
Rekor's API. This key was not verified using TUF metadata.

This change simply removes the API call and uses Rekor
public keys from the TUF repo.

Tested locally by not including the Rekor bundle in
the OCI signature, which will hit the code path to
fetch the entry from the log.

Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>

* Print message when verifying with old TUF targets

This adds console messages when the TUF metadata
used for Rekor or the CTFE key is marked as expired.

I haven't added a log message for Fulcio yet. The way
that certificates are verified is different. Instead of
multiple verifications where we can easily determine
which key successfully verified an object, the x509
library uses a CertPool and returns a valid chain.
I'll need to plumb through the TUF information.

Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>
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.

3 participants