-
Notifications
You must be signed in to change notification settings - Fork 51
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 in-toto statement when verifying DSSE #1116
Print in-toto statement when verifying DSSE #1116
Conversation
Signed-off-by: Facundo Tuesca <facundo.tuesca@trailofbits.com>
sigstore/_cli.py
Outdated
@@ -811,8 +811,10 @@ def _verify_identity(args: argparse.Namespace) -> None: | |||
) | |||
|
|||
try: | |||
_verify_common(verifier, hashed, bundle, policy_) | |||
statement = _verify_common(verifier, hashed, bundle, policy_) | |||
print(f"OK: {file}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move this to stderr
:
print(f"OK: {file}") | |
print(f"OK: {file}", file=sys.stderr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed!
CHANGELOG.md
Outdated
|
||
* CLI: The `sigstore verify` command now outputs the inner in-toto statement | ||
when verifying DSSE envelopes. If verification is successful, the output | ||
will be "OK: $FILENAME" followed by the inner in-toto statement. This allows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I think we can remove this part, since OK:
will be on stderr now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Thanks @facutuesca, looks good! Just a few small comments. |
Co-authored-by: William Woodruff <william@yossarian.net> Signed-off-by: Facundo Tuesca <facu@tuesca.com>
Signed-off-by: Facundo Tuesca <facundo.tuesca@trailofbits.com>
/gcbrun |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @facutuesca, nice work!
Summary
Part of #1111. This changes the
sigstore verify
CLI command so that when verifying a bundle containing a DSSE envelope, if verification succeeds the inner in-toto statement is printed to the user.This is done because
sigstore-python
only verifies the subjects of the DSSE envelope match the artifacts being verified, it does not do any verification on the predicate of the statement. This should be done by the user, which is why we print the statement after verification succeeds, so that the user has easy access to it.Release Note
sigstore verify
command now outputs the inner in-toto statementwhen verifying DSSE envelopes. If verification is successful, the output
will be "OK: $FILENAME" followed by the inner in-toto statement. This allows
the user to see the statement's predicate, which
sigstore-python
does notverify and should be verified by the user.
cc @woodruffw