Skip to content

cli: allow signed manifest updates#2303

Open
davidweisse wants to merge 3 commits intomainfrom
dav/signed-manifest-update
Open

cli: allow signed manifest updates#2303
davidweisse wants to merge 3 commits intomainfrom
dav/signed-manifest-update

Conversation

@davidweisse
Copy link
Copy Markdown
Member

@davidweisse davidweisse commented Apr 8, 2026

This PR allows setting a manifest without the CLI having access to the workload owner key. A user can instead pass a signature to the CLI which, when verified by the Coordinator using one of the workload owner keys from current manifest, authorizes the manifest update.

The user has to use the --dry-run flag of contrast set to obtain the blob to sign:

contrast set --dry-run resources/

The user can then use some other tool with potentially HSM managed keys to generate a signature over the transition blob:

openssl dgst -sha256 -sign <workload-owner-key> -out transition.sig next-transition

The signature is then passed to the CLI instead of a workload owner key:

contrast set --signature transition.sig resources/

@davidweisse davidweisse requested a review from burgerdev April 8, 2026 13:43
@davidweisse davidweisse added the feature Shiny new feature for our users label Apr 8, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

Do the documentation changes need to be backported?

Changes to /docs/docs won't be visible until the next release.
If you are fixing something in the docs that should be immediately visible, the changes needs to be made to both /docs/docs and /docs/versioned_docs/version-X.Y, where X.Y is the version of the latest minor release.
This can be done in this same PR.

  • Yes, this should be backported to the current version of the docs.
  • No, the PR only contains docs changes relevant for future versions.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://edgelesssys.github.io/contrast/pr-preview/pr-2303/

Built to branch gh-pages at 2026-04-08 13:46 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

if err := os.WriteFile(filepath.Join(flags.workspaceDir, nextTransitionHashFilename), []byte(transitionHashHex), 0o644); err != nil {
return fmt.Errorf("writing transition hash: %w", err)
}
fmt.Fprintf(cmd.OutOrStdout(), "✔️ Transition hash %s written to %s\n", transitionHashHex, filepath.Join(flags.workspaceDir, nextTransitionHashFilename))
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to write to a file here or to stdout? I've written it to a file for now since we compute the signature over a file when using openssl.

if grpcSt.Code() == codes.PermissionDenied {
msg := "Permission denied."
if workloadOwnerKey == nil {
msg += " Specify a workload owner key with --workload-owner-key."
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we change something here? I'm not sure if this still makes sense considering an error when validating the manifest signature.

return nil, status.Errorf(codes.FailedPrecondition, "previous transition hash '%x' does not match latest state '%x'", req.GetPreviousTransitionHash(), oldState.LatestTransition().TransitionHash)
}
} else {
// First SetManifest call, initialize seed engine.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also not sure if we need to consider a signed manifest update on a first set manifest call. It doesn't really make sense but it is possible to pass a signature here. The only thing we could do though is check if the signature is valid for a key in the new manifest. For atomic updates we check if the provided previous hash is empty, but here the previous hash would be integrated into the signature...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Shiny new feature for our users

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant