Expand description
§aegis-wire-formats
Signed attestation manifest format for aegis-boot USB sticks. Defines the on-disk ::/aegis-boot-manifest.json shape the flash-time attestation writes and that runtime verifiers (rescue-tui, aegis-boot doctor --stick, aegis-hwsim E6 attestation-roundtrip) read back.
Part of the aegis-boot rescue environment — a signed-chain UEFI Secure Boot stick that boots any ISO.
§Scope
This crate ships:
- Serde types for the manifest envelope (
Manifest,Device,EspPartition,DataPartition,EspFileEntry,PcrEntry). - Schema version constant pinning the wire-format version at 1 (locked by #277).
- Optional JSON Schema generation behind the
schemafeature — enables#[derive(JsonSchema)]on every public type and compiles theaegis-wire-formats-schema-docgenbinary that writesaegis-boot-manifest.schema.jsonconsumers can validate against.
Deliberately not shipped here:
- Writer / signer / filesystem I/O code — that logic is tightly coupled to the
direct_installflow on Linux and lives in theaegis-clicrate. minisignsignature verification — callers receive the manifest body + a detached signature and verify out-of-band.
§Feature flags
schema(off by default) — pullsschemarsin, addsJsonSchemaderives, enables theaegis-wire-formats-schema-docgenbinary used by the parent workspace’s CI drift-check.
§Platform support
Pure Rust, no platform-specific code. Works anywhere serde + serde_json work.
§Status
Pre-1.0. Schema version is locked at 1; API may still gain minor conveniences before a crates.io publish. Consume via the aegis-boot workspace.
§License
Licensed under either of Apache-2.0 or MIT at your option.
§Rust API
The core type is Manifest — the on-disk JSON body that gets
written to ::/aegis-boot-manifest.json + signed into
::/aegis-boot-manifest.json.minisig. Every field is part of a
pinned wire contract; see the comments on each struct for the
invariants a verifier must enforce.
§Schema versioning
SCHEMA_VERSION is the canonical value for schema_version.
Bump it only alongside a shape-breaking change (removing a field,
changing a field’s type). Adding a new optional field is
backwards-compatible and does not require a version bump — the
verifier ignores fields it doesn’t know about.
§JSON Schema
With the schema feature enabled, every public type derives
schemars::JsonSchema. The aegis-wire-formats-schema-docgen
binary emits a validated JSON Schema document to
docs/reference/schemas/aegis-boot-manifest.schema.json in the
parent workspace; third-party verifiers can pin to this schema.
§Two wire formats under one crate
This crate hosts two logically distinct JSON wire formats that both carry aegis-boot provenance:
- On-ESP manifest (
Manifest,SCHEMA_VERSION) — signed record written into::/aegis-boot-manifest.jsonat flash time, read by runtime verifiers. Phase 4a of #286. - Host attestation receipt (
Attestation,ATTESTATION_SCHEMA_VERSION) — per-flash audit record written to$XDG_DATA_HOME/aegis-boot/attestations/for chain-of-custody + fleet inventory. Phase 4c-1 of #286. - CLI envelopes (
Version,ListReport,AttestListReport,VerifyReport,UpdateReport,RecommendReport,CompatReport,CompatSubmitReport,DoctorReport, with their*_SCHEMA_VERSIONconstants) — the--jsonenvelopes emitted byaegis-boot --version --json,... list --json,... attest list --json,... verify --json,... update --json,... recommend --json,... compat --json,... compat --submit --json, and siblings. Phase 4b of #286.
Each contract is independently versioned — a change to one
schema does not require bumping the others. They are co-located
in the same crate because they are all “aegis-boot wire-format
structs for third-party consumers” and sharing the optional
schema feature + docgen infrastructure is cheaper than forking
it across N crates. A future crate rename (aegis-wire-formats
or similar) may follow once the full CLI envelope set lands.
Structs§
- Attest
List Error - Parse-failure entry inside an
AttestListReport. Consumer decision: show the operator which file failed + why, so they can audit / repair / delete. - Attest
List Report - Envelope emitted by
aegis-boot attest list --json. Scans the host’s attestation directory, attempts to parse each file, and reports either a parsed summary or a parse-error placeholder per entry. Enables monitoring / fleet tools to audit chain-of-custody across all flashed sticks on a host. - Attest
List Success - Successfully-parsed attestation summary inside an
AttestListReport. Deliberately a strict subset of the fullAttestation— enough to drive a dashboard without requiring consumers to re-parse each file. Full detail is oneaegis-boot attest show <path>away. - Attestation
- One flash + zero-or-more ISO additions, captured as a single
JSON document on the host. Stored under
$XDG_DATA_HOME/aegis-boot/attestations/(or~/.local/share/aegis-boot/attestations/ifXDG_DATA_HOMEis unset). Theaegis-boot attest list/attest showcommands read these back for chain-of-custody queries. - CliError
- Generic error envelope emitted when a subcommand fails before
it can produce its subcommand-specific
--jsonenvelope. Examples:aegis-boot list --jsonbefore mount-resolution succeeds;aegis-boot verify --jsonbefore a stick is found. - Compat
Catalog Report - Full-catalog variant of
CompatReport. - Compat
Entry - One hardware-compatibility DB row. Mirrors
docs/HARDWARE_COMPAT.md; every entry corresponds to a real operator report (or the QEMU reference environment). - Compat
Miss Report - Miss variant of
CompatReport— the query was well-formed but didn’t match any DB entry. Carriesreport_urlso the operator can file a new entry; deliberately omitstool_versionto match the existing wire format. - Compat
MyMachine Miss Report - My-machine-miss variant of
CompatReport—--my-machineor--submitcouldn’t auto-fill the query from DMI. Minimal envelope (justschema_version+error) to match the existing wire format. - Compat
Single Report - Single-entry variant of
CompatReport. - Compat
Submit Report - Envelope emitted by
aegis-boot compat --submit --json— the draft-a-hardware-report flow. Collects DMI identity + builds a pre-filled GitHub issue URL the operator can open to file a report. Independent schema fromCompatReportbecause the consumer contracts diverge: lookup drives scripted decisions, submit drives an operator workflow. - Data
Partition - Identity of the AEGIS_ISOS data partition (partition 2).
- Device
- Device identity captured at flash time. All values come from the
freshly-written GPT (
blkid+sgdisk -p); the verifier re-reads them at runtime and asserts equality. - Doctor
Report - Envelope emitted by
aegis-boot doctor --json. Reports host + stick health as a rollup score + per-check rows. The monitoring / CI consumer target — a non-zerohas_any_failis the signal to surface to an operator. - Doctor
Row - One check result in a
DoctorReport. - EspFile
Entry - A single file on the ESP with its content hash and size.
- EspPartition
- Identity of the ESP partition (partition 1).
- Failure
Microreport - Tier-A anonymous failure microreport — written by
rescue-tui/ initramfs toAEGIS_ISOS/aegis-boot-logs/<ts>-<hash>.jsonwhen a classifiable boot failure occurs, so the operator can later include the log in anaegis-boot bug-reportbundle (#342 Phase 2). - Host
Info - Host environment fingerprint at flash time.
- IsoRecord
- One
aegis-boot addoperation appended to the stick’s attestation record. - List
Attestation Summary - Compact attestation summary embedded in
ListReport. Derived from the storedAttestationrecord; smaller than the full attestation (no device fingerprint, no host kernel string) so the list envelope stays lightweight. - List
IsoSummary - Per-ISO detail in
ListReport. Thedisplay_name+descriptionfields come from an optional<iso>.aegis.tomloperator-label sidecar (#246); they are always present in the wire format (asnullwhen absent) so consumers see a stable shape. - List
Report - Envelope emitted by
aegis-boot list --json. Reports the ISOs discovered on a stick’s AEGIS_ISOS data partition, plus the attestation summary if one was recorded at flash time. - Manifest
- Top-level manifest body. Serialized field order matches the
declaration order below — relied on for canonical JSON stability
(the signature is computed over
serde_json::to_vec(&Manifest)). - PcrEntry
- Expected TPM PCR value at an aegis-boot stick’s first post-boot measurement. Empty in PR3; populated once E6 locks the PCR selection.
- Recommend
Catalog Report - Full-catalog variant of
RecommendReport. - Recommend
Entry - One curated catalog entry. Used in both
RecommendCatalogReport::entriesandRecommendSingleReport::entry. - Recommend
Miss Report - Miss variant of
RecommendReport— no catalog entry matched the given slug. The envelope is deliberately asymmetric from the success variants (notool_version) to match the existing wire format; tightening to always emittool_versionwould be an additive (non-breaking) future change. - Recommend
Single Report - Single-entry variant of
RecommendReport. - Target
Info - Target stick fingerprint at flash time.
- Update
Chain Entry - One signed-chain entry in an
UpdateEligibility::Eligibleresponse. Two mutually-exclusive wire shapes via untagged-enum dispatch on the presence ofsha256vserror. - Update
File Diff - Per-file diff row between what’s currently on the stick’s ESP
and what a fresh
mkusb/ direct-install flash would write. One row per canonical ESP destination (seedirect_install::ESP_DEST_*). - Update
Report - Envelope emitted by
aegis-boot update --json. Phase 1 of #181 is eligibility-check-only: answers “would a non-destructive signed-chain rotation apply cleanly to this stick?” — the actual rotation is Phase 2. The envelope’s outer fields (schema_version,tool_version,device) are common; the [eligibility] flattened enum carries the variant-specific body. - Verify
Entry - One ISO’s verdict inside a
VerifyReport. Theverdictfield is the discriminator; variant-specific fields follow via#[serde(flatten)]. Consumer contract: branch onverdict, expect the fields documented for that variant. - Verify
Report - Envelope emitted by
aegis-boot verify --json. Re-verifies every ISO on a stick against its sidecar checksum and reports a per-ISO verdict plus a summary tally. Used by CI / monitoring to audit that a stick’s ISOs haven’t bit-rotted, been replaced, or lost their sha256 sidecars. - Verify
Summary - Tally of per-ISO verdicts in a
VerifyReport.any_failureis the summary bit downstream tooling (CI, dashboards) branches on. - Version
- Envelope emitted by
aegis-boot --version --json. Lets scripted consumers (install-one-liner assertions, Homebrew formula tests, ansible-verified installs) parse the version without regex on the human-readable string.
Enums§
- Attest
List Entry - One entry in an
AttestListReport. Two mutually-exclusive wire shapes via serde’suntaggedtagging: - Compat
Report - Envelope emitted by
aegis-boot compat --json. Untagged wrapper around 4 mutually-exclusive shapes: full catalog, single match, miss (query matched no DB entry), or my-machine-miss (DMI lookup couldn’t resolve an identity). - Recommend
Report - Envelope emitted by
aegis-boot recommend --json. Untagged wrapper around three mutually-exclusive shapes: a full catalog listing, a single-entry response, or a miss. Consumers branch on the presence ofentries/entry/error. - Update
Chain Result - Per-chain-entry result. Untagged to match the current wire
format’s mutually-exclusive shape (no discriminator tag — the
consumer branches on the presence of
sha256vserror). - Update
Eligibility - Outcome of the eligibility check. Internally-tagged under
eligibilitywith the tag values"ELIGIBLE"and"INELIGIBLE"(upper-case to match the existing wire format).flatten-combined withUpdateReport’s outer fields so the emitted JSON preserves theschema_version, tool_version, device, eligibility, …ordering consumers parse against. - Verify
Verdict - Per-ISO verdict variants. Internally-tagged under
verdict; a consumer that doesn’t recognize a future variant can fall back on the tag string.
Constants§
- ATTESTATION_
SCHEMA_ VERSION - Locked schema version for the host-side
Attestationrecord. Independent ofSCHEMA_VERSION— either contract can advance without the other. - ATTEST_
LIST_ SCHEMA_ VERSION - Locked schema version for the
AttestListReportenvelope emitted byaegis-boot attest list --json. Independent of the other envelope contracts. - CLI_
ERROR_ SCHEMA_ VERSION - Locked schema version for the
CliErrorenvelope — the generic{schema_version, error}shape emitted by any subcommand that fails before it can produce its subcommand-specific--jsonenvelope. Shared by multiple subcommands because the pre-dispatch error path is identical across them. - COMPAT_
SCHEMA_ VERSION - Locked schema version for the
CompatReportenvelope emitted byaegis-boot compat --json. Shared by the 4 mutually-exclusive shapes (catalog / single / miss / my-machine-miss). Independent of the other envelope contracts. - COMPAT_
SUBMIT_ SCHEMA_ VERSION - Locked schema version for the
CompatSubmitReportenvelope emitted byaegis-boot compat --submit --json— the draft-a-hardware-report flow. Deliberately a separate schema fromCompatReportbecause the two surfaces have different consumer contracts (operators draft-submit vs. scripted lookup). - DOCTOR_
SCHEMA_ VERSION - Locked schema version for the
DoctorReportenvelope emitted byaegis-boot doctor --json. Independent of the other envelope contracts. - FAILURE_
MICROREPORT_ SCHEMA_ VERSION - Locked schema version for the
FailureMicroreportenvelope — the Tier-A anonymous on-stick failure log written byrescue-tui/ initramfs when a classifiable boot failure occurs. Per #342 Phase 2. Anonymous-by-construction: no hostname, no DMI serial, no free-form error text; just vendor_family + bios_year + classified error code + an opaque hash of the full error text. - LIST_
SCHEMA_ VERSION - Locked schema version for the
ListReportenvelope emitted byaegis-boot list --json. Independent of the other envelope contracts. - RECOMMEND_
SCHEMA_ VERSION - Locked schema version for the
RecommendReportenvelope emitted byaegis-boot recommend --json. Independent of the other envelope contracts. - SCHEMA_
VERSION - Locked schema version for the on-ESP signed
Manifest. Bump alongside a breaking shape change (removing a field, changing a field’s type). Adding a new optional field is backwards-compatible and does not require a version bump — the verifier ignores fields it doesn’t know about. - UPDATE_
SCHEMA_ VERSION - Locked schema version for the
UpdateReportenvelope emitted byaegis-boot update --json. Independent of the other envelope contracts. - VERIFY_
SCHEMA_ VERSION - Locked schema version for the
VerifyReportenvelope emitted byaegis-boot verify --json. Independent of the other envelope contracts. - VERSION_
SCHEMA_ VERSION - Locked schema version for the
Versionenvelope emitted byaegis-boot --version --json. Independent of the manifest and attestation contract versions.