Package and index formats#
shirudo publishes packages (.bee files) to an OCI registry and lists
them in a signed repository index. The operator writes them with bpm
build and bpm push (see shirudo bpm). The target reads
them with bpm repo update, bpm install and bpm upgrade. The
Beefile a package is built from is in Beefile, the .upatch
files inside in .upatch format, and the upatch tree, which
publishes single upatches of a package, in upatch tree.
CBMC proves the target’s readers of these formats within the bounds Proof coverage lists: the tar headers and member names, the registry’s challenges, tokens, headers and descriptors, and the package names and versions. Lean 4 proves the version order total for versions of every length, and that every member name the archive check takes, of any length, extracts strictly below the package’s directory.
What is signed#
Figure 1 shows the objects of one registry namespace, the packages, the index and a upatch tree, and which of them are signed and which are pinned by a digest in a signed one. The table gives each object’s protection.
Figure 1. Which objects of a registry namespace are signed, pinned by digest, or neither.#
Object |
Protection |
Checked by |
|---|---|---|
|
CMS signature, ML-DSA-87, over |
The kernel, at every load and unload. |
Repository index document |
Detached CMS signature over the exact document bytes. |
|
Package manifest and |
Not signed. The signed index pins them by |
|
Package installed by |
Not signed and not pinned. The reference names a tag. |
Only the per- |
|
Its public key must equal the public key of the target’s
|
|
|
Not signed. Covered by the archive digest when the index pins it. |
None beyond the archive digest. |
Certificate referrer manifest |
Not signed. |
Not read by shirudo. |
The detached signatures, of an index here and of a tree publication
(upatch tree), use the same CMS profile as the .upatch
signature: DER SignedData, no encapsulated content, no certificates,
ML-DSA-87, signer named by subject key identifier. The verifier checks it
without a validity-time check: against the repository certificate for
an index, or any active, enrolled BPF signer for a tree publication.
Names#
Name |
Source |
Rule |
|---|---|---|
Package name |
Beefile |
Starts with a letter or digit, then |
Package version |
|
A SemVer 2.0.0 version such as |
upatch name |
The source file’s basename without |
The Beefile cannot override it. 1 to 255 characters of
|
Package archive#
bpm build writes <name>-<version>.bee, a gzip-compressed ustar
archive with one top-level directory <name>-<version>/. Members carry
uid and gid 0 and mtime 0.
Member |
Content |
|---|---|
|
The top-level directory, mode 0755. |
|
The Beefile the package was built from. |
|
Each |
|
Each |
|
The matching unload directive, at its |
|
Present when the package directory has one. |
|
The signing certificate, DER. |
|
Build record, see below. |
Beefile, README.md, cert.der and build-environment.json are
reserved and cannot be [[files]] or upatch targets.
Beefile describes the Beefile.
On install the target loads every regular file in the archive’s
upatches/ whose name ends in .upatch but not in
.unload.upatch, in name order. Uninstall
and upgrade apply the package’s <base>.unload.upatch files in reverse
name order, and a rolled back install or upgrade reloads each one’s
<base>.upatch. A name that starts with . is neither.
Archive reader rules#
The target refuses an archive that breaks any of these:
Each header is a 512-byte ustar header with a valid checksum, a name that is NUL-terminated within its 100 bytes, an empty prefix field and a size field of octal digits.
Every member lies under the one top-level directory. No path is absolute or has an empty,
.or..component, so an archive rooted at./is refused, as the member readers would find nothing in it.Every member is a regular file or a directory.
At most 4096 members and 256 MiB of content.
No regular file appears twice.
build-environment.json#
Key |
Value |
|---|---|
|
|
|
|
|
UTC time, |
|
Package name and version. |
|
|
|
shirudo version of the builder. |
|
Path and version of the building binary. |
|
SHA-256 of the DER |
|
Per upatch: |
Package in the registry#
bpm push <package> oci://<registry>/<repository> uploads:
Object |
Content |
|---|---|
Package manifest |
OCI image manifest, |
Certificate referrer |
OCI image manifest with |
Index entry |
Added when signing material is given ( |
The last path component of <repository> follows the package name rule.
A manifest shirudo reads, for a package, an index, a tree publication or
an artifact, is refused unless each of its layers is an object with a
mediaType, a sha256: digest and a size.
Repository index#
One index per registry namespace, at
<registry>/<namespace>/bpm-index:stable.
Object |
Content |
|---|---|
Index manifest |
OCI image manifest, |
Document layer |
The index document, media type
|
Signature layer |
Detached CMS signature over the document layer’s bytes, media type
|
The index document:
{"schema": 1,
"generated_at": "<utc-time>",
"packages": [
{"name": "<package>", "version": "<version>",
"repository": "<repository>",
"manifest_digest": "sha256:<hex>",
"package_digest": "sha256:<hex>",
"package_size": <bytes>,
"signer_fingerprint": "<hex>"}]}
Key |
Value |
|---|---|
|
|
|
UTC time of the push. Not read by the target. |
|
Required. At most 512 entries. |
|
Package name and version. |
|
Repository path on the index’s registry, without the host. |
|
Digest of the package manifest. The target fetches the manifest by this digest and refuses other bytes. |
|
Digest of the |
|
Size of the |
|
|
A published version is immutable: bpm push refuses to list a name and
version again with a different manifest_digest or package_digest.
The target keeps the verified document as
/var/lib/shirudo/bpm/repos/<source>/index.json.
Limits#
Item |
Limit |
|---|---|
Package file read by |
256 MiB |
Archive members |
4096 members, 256 MiB of content |
Member name |
fewer than 100 bytes, no ustar prefix |
|
4 MiB |
Index entries |
512 |
JSON document |
8 MiB |
Detached signature |
64 KiB (writer) |