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 support for attesting with complete statement #4032

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

Conversation

codysoyland
Copy link
Member

@codysoyland codysoyland commented Feb 3, 2025

Summary

Add support for signing attestations given a complete statement. This is an alternative to passing in a predicate and having cosign generate the statement.

This adds a new flag to attest and attest-blob, --statement, which accepts a complete in-toto statement. If provided, the predicate flag is ignored and the statement is signed.

Fixes #4019

Release Note

Documentation

Copy link

codecov bot commented Feb 3, 2025

Codecov Report

Attention: Patch coverage is 23.62205% with 97 lines in your changes missing coverage. Please review.

Project coverage is 36.43%. Comparing base (2ef6022) to head (fc7349d).
Report is 289 commits behind head on main.

Files with missing lines Patch % Lines
cmd/cosign/cli/attest/attest.go 0.00% 44 Missing ⚠️
cmd/cosign/cli/attest/attest_blob.go 46.15% 23 Missing and 12 partials ⚠️
cmd/cosign/cli/attest_blob.go 0.00% 9 Missing ⚠️
cmd/cosign/cli/options/predicate.go 0.00% 5 Missing ⚠️
cmd/cosign/cli/attest.go 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4032      +/-   ##
==========================================
- Coverage   40.10%   36.43%   -3.68%     
==========================================
  Files         155      209      +54     
  Lines       10044    13398    +3354     
==========================================
+ Hits         4028     4881     +853     
- Misses       5530     7892    +2362     
- Partials      486      625     +139     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@codysoyland codysoyland force-pushed the attest-with-statement branch from 6a2d714 to a1c349e Compare February 3, 2025 21:26
@codysoyland codysoyland marked this pull request as draft February 3, 2025 22:00
@codysoyland codysoyland force-pushed the attest-with-statement branch from a1c349e to fc7349d Compare February 4, 2025 14:48
@codysoyland codysoyland marked this pull request as ready for review February 4, 2025 15:18
@codysoyland
Copy link
Member Author

We may go another direction with this, see #4019 (comment)

@haydentherapper
Copy link
Contributor

haydentherapper commented Feb 4, 2025

For the attest-blob path, this LGTM.

For the attest path, you've convinced me that it's confusing to have a required parameter for OCI but to ignore the OCI manifest as the subject.

So I think we should either:

  1. Make this its own command, and optionally (later?) add support for uploading an attestation to OCI, with (optional?) subject comparison
  2. Drop attest --statement support from this PR, though now we have somewhat confusing deviations between the two commands, which is why I'm leaning more towards 1 now.

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.

Support signing 'raw' in-toto statements
2 participants