Signing and verification
ZIGNOS verifies the integrity of distributed packages and recipes with
Ed25519 detached signatures. It does not depend on GPG or external
libraries; key generation, signing and verification all happen in the single
zpkg binary.
What is protected
Section titled “What is protected”| Target | What is signed | What it protects |
|---|---|---|
| binpkg repository | The raw bytes of index.json |
Tampering with package contents, manifests and version information |
| Recipe tree | recipes.manifest (sha256/size/mode of every file) |
Tampering with recipes, build scripts and bundled patches |
| Rollback | generation and the last accepted state |
Swapping in an older signed index/manifest |
| Expiry | expires |
Reuse of a signature left unused for a long time |
A recipe’s checksums are included in the manifest, so verification extends
from the recipe tree signature to the source tarball sha256.
Key generation and management
Section titled “Key generation and management”# signing key pair (private key is 0600, existing files are not overwritten)zpkg key generate --private ~/zignos-signing.key --public ~/zignos-signing.pub
# client: trust the public keyzpkg key import zignos-signing.pubzpkg key list- The key ID is the SHA-256 (64 hex) of the 32-byte Ed25519 public key
- Trusted keys live in
$ZPKG_ROOT/etc/zpkg/trusted.d/*.pub - There is no TOFU (automatic trust on first use). Verify the public key fingerprint over a separate channel before importing
- Do not place private keys inside repositories or recipe trees.
zpkg mkindexandzpkg sign-recipesrefuse when the private key is inside the target directory - When rotating keys, import the new public key, sign with the new key, and
finally remove the old key with
zpkg key remove <keyid>
Signing a binpkg repository
Section titled “Signing a binpkg repository”Recommended layout:
binrepo/├── index.json├── index.json.sig├── keys/<keyid>.pub└── packages/ ├── gcc.pkg.tar.gz ├── gcc.manifest └── gcc.meta.jsonzpkg mkindex --key ~/zignos-signing.key \ --generation 42 --expires 90d /srv/binrepoindex.jsonis schema 2 and carriesgeneration/expires/keyidindex.json.sigis a signature over the raw bytes ofindex.json- Each entry’s
sha256andmanifest_sha256bind the binpkg payload and file list keys/<keyid>.pubis also written automatically. If you distribute it, publish this key’s fingerprint over a separate channel (website, release notes, etc.)
If --generation is omitted, it becomes the existing index.json generation
-
- A new repository starts at 1.
--expiresaccepts RFC3339 or90d/720h(default +90 days).
- A new repository starts at 1.
Signing a recipe tree
Section titled “Signing a recipe tree”zpkg sign-recipes --key ~/zignos-signing.key \ --generation 42 --expires 90d /path/to/zignos-recipesrecipes.manifest lists path / sha256 / size / mode for every regular
file except .git and the signatures themselves. recipes.manifest.sig is a
signature over the raw bytes of that manifest.
zpkg sync verifies the following against the unpacked staging tree.
- The manifest signature and key ID
- Expiry and generation
- The sha256 / size of every file (and mode on Unix)
- That there are no extra files not listed in the manifest
The same verification runs for any input: a directory, a recipe tarball or a stage3 tarball.
For channel trees (stable/ / testing/ / unstable/), the entire tree
is signed by one recipes.manifest. The distributed recipe tarball contains
all channels, so a single sync verifies every channel. stage3 bundles only the
stable subtree, which has no manifest of its own and is therefore still
treated as unsigned.
Client-side verification
Section titled “Client-side verification”# register a trusted keyzpkg key import zignos-signing.pub
# update to a signed recipe treezpkg sync --from zignos-recipes.tar.xz
# use the binpkg repositoryexport ZPKG_BINREPO=https://example.com/zignos/binpkgszpkg install <pkg>If verification fails, install and sync stop with an error. They never
silently fall back to a source build from a tampered repository.
Rollback and expiry
Section titled “Rollback and expiry”The last accepted generation and SHA-256 are stored in
$ZPKG_DB/.security.json.
- A new generation smaller than the stored value → rejected as a rollback
- The same generation with different contents → rejected as a same-generation swap
expiresis in the past → rejected
Explicit exceptions
Section titled “Explicit exceptions”| Setting | Meaning |
|---|---|
--allow-unsigned / ZPKG_ALLOW_UNSIGNED=1 |
Allowed only when no signature exists. A broken signature is always rejected |
ZPKG_ALLOW_EXPIRED=1 |
Only expiry is allowed. Signature and rollback verification remain |
The same settings can go in /etc/zpkg/security.conf.
TRUSTED_KEYS=/etc/zpkg/trusted.dALLOW_UNSIGNED=0ALLOW_EXPIRED=0Current distribution status
Section titled “Current distribution status”The signing mechanism is implemented in zpkg, but the official signing key is
not yet in operation. The current stage3 / recipe tarballs are therefore
unsigned. When running zpkg sync on an unsigned distribution, specify the
exception explicitly.
zpkg sync --from zignos-recipes-....tar.xz --allow-unsignedOnce the official key is generated and published, operation will move to
trusting it with zpkg key import and running without --allow-unsigned.
Keys can be generated with zpkg key generate.
Limitations
Section titled “Limitations”- A leaked private key or a compromised root account cannot be prevented
- Key revocation lists (CRL) are not supported. Key rotation is used instead
- Initial trust depends on out-of-band fingerprint verification
- Secure Boot (GRUB/kernel signing) is a separate mechanism from package signing and is not supported
- GPG/OpenPGP is not supported. It will be added in the future by extending
the signature envelope’s
algorithm
