Skip to content

Latest commit

 

History

History
155 lines (129 loc) · 8.21 KB

signing.md

File metadata and controls

155 lines (129 loc) · 8.21 KB

Production signing

Ignition signs runtime cores with Ed25519. Source builds contain no embedded publisher profiles. Supply a public profile with --publisher-keys, import it during CLI or desktop acquisition, or provision profiles when building a distribution as described in runtime core protection.

Publisher profiles verify signatures; they do not verify identity. Flare checks identity through publisher.json at the root of the core's official source repository. Execution requires first-use acceptance. Private keys never belong in source control, cores, or publisher profiles.

The CLI and Windows desktop client can review and import a public profile published with a payload-format core at its acquisition commit. This permits downloading cores signed with a development key from another preparation host. Both clients verify the signed catalog and require the exact namespace for explicit key import. Imported profiles persist in the shared trust file without accepting execution. See CLI acquisition and desktop acquisition.

Publish the verification key

Upload the publisher.json that key creation wrote, unchanged, to the root of every repository named as an official source. Flare fetches <official source>/resolve/main/publisher.json, the root of the main branch, on every online load and requires it to list the key under the publisher namespace. The file is a list, so a rotated key stays valid by keeping the previous profile in it, and removing a profile revokes that key for every core it signed. A repository whose publisher.json omits the signing key makes the core fail to load everywhere; a repository without the file leaves the identity unverified, and users must then supply the profile with --publisher-keys.

Each repository should also hold the license file its model card names. The exporter records the license name and a link to that file from the model card front matter, Flare shows both before acceptance, and typing the namespace agrees to the terms at the link.

Create and protect a key

Run key creation in your own interactive terminal:

.venv/bin/ignition keygen \
  --directory ~/.config/flare/signing/example-publisher \
  --name 'Example Publisher' --namespace example-publisher

This creates a random Ed25519 key encrypted as PKCS#8 PEM using the entered passphrase, and a separate publisher.json containing only its public identity. The directory must not already exist; key creation never overwrites a key. On POSIX, the directory is mode 0700 and both files are mode 0600. Generating another key creates a different identity and fingerprint.

Use a unique, randomly generated passphrase stored in a password manager. Ignition requires at least 16 UTF-8 bytes and confirms the passphrase. Enter it only at the terminal prompt, never in chat, shell arguments, configuration, or an environment variable. Signing also prompts in the terminal and refuses a prompt whose input cannot be hidden.

Keep an encrypted backup of signing-key.pem and its public profile on separate storage, with the passphrase recoverable separately. Verify that the backup can be decrypted before depending on it. Losing either the key or its passphrase prevents further signatures under that identity. File permissions and encryption protect the stored key; they do not protect an unlocked signing process from a compromised account or root. Sign only on a trusted host and review the core being promoted.

For rotation, generate into a different directory and supply the replacement public profile through --publisher-keys or a provisioned distribution. Previously signed cores require their original public key; execution acceptance is specific to the key and namespace. If a private key is compromised, remove its identity from distributed builds and revoke its acceptance in affected trust stores with flare trust revoke FINGERPRINT.

Change the passphrase

.venv/bin/ignition key-password \
  --signing-key ~/.config/flare/signing/example-publisher/signing-key.pem

The command prompts for the existing passphrase of an encrypted key, then the replacement twice; the replacement needs at least 16 UTF-8 bytes. It writes an encrypted temporary file with owner-only permissions beside the key, flushes it to disk, and atomically replaces the key file. The key and fingerprint stay the same; publisher profiles, Helios builds, and signed cores need no changes. A wrong existing passphrase or mismatched confirmation leaves the file untouched. An interruption before replacement can leave an encrypted hidden temporary file beside the key.

Update the encrypted backup after changing the passphrase. Existing backups still use their previous passphrase. A passphrase change does not revoke copies of the private key; use key rotation if a copy may be compromised.

Promote a development core

Use a distinct destination and the actual repository URL where the production core will be published:

.venv/bin/ignition sign /data/flare-runtime/development \
  --output /data/flare-runtime/production \
  --signing-key ~/.config/flare/signing/example-publisher/signing-key.pem \
  --namespace example-publisher \
  --official-source https://huggingface.co/example-publisher/REPOSITORY

Replace example-publisher and REPOSITORY with your namespace and repository. The command does not upload anything. The three publishing values can instead come from [publishing] in the configuration file; explicit flags take precedence. It locates development-publisher.json beside that config file. For a core prepared elsewhere, supply the original trusted public profile with --development-publisher PATH. That file must contain exactly one profile. The development private key is unnecessary.

Signing a payload-format core verifies its source signatures and stored payloads, then signs its deployments and ranks under the production identity with a fresh core ID. Weight bytes, the model license the export recorded from the model card, and prepared execution contracts are preserved. Executable resources are authenticated, decoded, and re-encoded as independent zstd level-3 frames; decoded bytes remain exact, while compressed frame bytes may change.

The output uses the directory canonical form with readable companion names. Use ignition convert --form packed to produce a single-file core afterward. The payload format has no canonical size-sharded form or shard-size setting. ignition sign rejects logical-resource containers, which are cores that are not in the payload format; export the model again with Ignition to obtain a payload core.

Invalid cores fail before publication, and existing destinations are never overwritten. Weight identities remain independent of executable resources.

No checkpoint reload, compilation, graph capture, or GPU access is required. The operation hashes every source payload once, including the weight bytes, as it installs the payload in the output. A source companion that is already the payload's deterministic wrapper is hard-linked into the output on the same filesystem and hashed through the link; other payloads, and every payload on another filesystem, are copied and the written bytes hashed. Up to eight payloads install concurrently. ignition combine, which merges the deployments of several cores signed under one namespace into one signed core (signing and local development), first hashes their payloads with progress, because derivation planning reads them. Allow disk space for temporary decoded executable resources, and for copied payloads when the output is on another filesystem. Temporary files reside in a private directory beside the destination and are removed on normal completion or error. A forced kill can leave that directory; remove it only after confirming no signing process is using it. The source core remains intact. See core snapshots for conversion that preserves an existing signature without a private key.

Rebuild Flare after changing embedded public profiles. A separately built or installed executable retains the profiles it was built with.