-
Notifications
You must be signed in to change notification settings - Fork 1.2k
docs(hub): Add app signing guide #7012
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,158 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Sign Hub Apps | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ============= | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| This guide explains how app signing works in Flower Hub and how to use it in practice. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Before an app can be reviewed and signed, it must already be published to Flower Hub. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| The app does not need to be published by the same account that reviews and signs it. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .. note:: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| App signing and app-page verification metadata are preview features. They may | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| change over time. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| How App Signing Works | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --------------------- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| At a high level: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1. An app exists on Flower Hub. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2. The reviewer has an Ed25519 key pair and has registered the public key in | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| their Flower account profile. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3. The reviewer downloads the FAB and signs it with the matching Ed25519 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private key via :code:`flwr app review`. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4. The signature is attached to app verification metadata in Flower Hub. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5. Users can inspect the app's verification metadata on the app page and decide | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| which signers they trust. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Prerequisites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ------------- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - Ensure :code:`flwr` is installed | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - A Flower account and active login | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - An Ed25519 OpenSSH key pair for signing | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - The corresponding public key added to your Flower account profile | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - An app on Flower Hub to review and sign | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Log in to your Flower account on SuperGrid: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .. code-block:: bash | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| flwr login supergrid | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Create a Signing Key | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -------------------- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Generate an Ed25519 key pair in OpenSSH format: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .. code-block:: bash | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ssh-keygen -t ed25519 -f hub_signing_key -C "hub-review-key" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| This creates: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - :code:`hub_signing_key` (private key, keep secret) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - :code:`hub_signing_key.pub` (public key) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+49
to
+59
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Generate an Ed25519 key pair in OpenSSH format: | |
| .. code-block:: bash | |
| ssh-keygen -t ed25519 -f hub_signing_key -C "hub-review-key" | |
| This creates: | |
| - :code:`hub_signing_key` (private key, keep secret) | |
| - :code:`hub_signing_key.pub` (public key) | |
| Generate an unencrypted Ed25519 key pair in OpenSSH format: | |
| .. code-block:: bash | |
| ssh-keygen -t ed25519 -f hub_signing_key -C "hub-review-key" -N "" | |
| This creates: | |
| - :code:`hub_signing_key` (private key, keep secret) | |
| - :code:`hub_signing_key.pub` (public key) | |
| .. note:: | |
| The private key used with :code:`flwr app review` must currently be | |
| unencrypted. Passphrase-protected OpenSSH private keys are not supported by | |
| the current loader, so use an empty passphrase when generating the key. |
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.
The
ssh-keygenexample here can produce a passphrase-protected key, butflwr app reviewcurrently loads keys withserialization.load_ssh_private_key(..., password=None)(framework/py/flwr/supercore/primitives/asymmetric_ed25519.py:169-173), so encrypted OpenSSH keys fail during signing. Users who follow this guide and set a passphrase will hit private-key load errors despite using Ed25519/OpenSSH, so this step should explicitly require an unencrypted key (or document that passphrase-protected keys are unsupported).Useful? React with 👍 / 👎.