daemon: sign attestations on submit - #259
Open
aparcar wants to merge 1 commit into
Open
Conversation
The daemon only signed attestations on the first "attestation request" instead of on receive. Instead, move the daemon signing to the point where a attestation is submitted from the worker. For the time being, the "sign on request" is left in place to allow an easier migration, it should be eventually removed. Signed-off-by: Paul Spooren <mail@aparcar.org>
There was a problem hiding this comment.
Pull request overview
This PR updates the daemon’s attestation flow so that (when enabled) attestations are signed at the time a worker submits a rebuild report, instead of only being signed lazily when the attestation is later fetched.
Changes:
- Add the daemon private key extractor to
submit_rebuild_reportand sign received attestations on submission whentransparently_sign_attestationsis enabled. - Keep the legacy “sign on GET” logic in
get_build_artifact_attestationfor a migration period, with updated TODO commentary.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
171
to
175
| if let Some(attestation) = &artifact_report.attestation { | ||
| Some(if is_zstd_compressed(attestation) { | ||
| let bytes = if is_zstd_compressed(attestation) { | ||
| attestation.clone() | ||
| } else { | ||
| zstd_compress(&attestation[..]).await.map_err(Error::from)? |
Comment on lines
+178
to
+182
| let bytes = if cfg.transparently_sign_attestations { | ||
| attestation::compressed_attestation_sign_if_necessary( | ||
| bytes, | ||
| &private_key, | ||
| ) |
Comment on lines
+178
to
+184
| let bytes = if cfg.transparently_sign_attestations { | ||
| attestation::compressed_attestation_sign_if_necessary( | ||
| bytes, | ||
| &private_key, | ||
| ) | ||
| .await? | ||
| .0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The daemon only signed attestations on the first "attestation request" instead of on receive. Instead, move the daemon signing to the point where a attestation is submitted from the worker.
For the time being, the "sign on request" is left in place to allow an easier migration, it should be eventually removed.