From bffeba76dd9778f327897491314a706f8d67fc83 Mon Sep 17 00:00:00 2001 From: Scot Wells Date: Wed, 25 Nov 2026 09:28:39 -0600 Subject: [PATCH 01/14] docs: Propose OS images and bootstrap data for installs A customer chooses an image from a provider-published, immutable, digest-pinned MachineImage catalog and supplies user data and SSH keys in a bootstrap Secret. Fleet resolves the image to its digest at admission and keeps it, checks it against the server's architecture and firmware mode, and copies the bootstrap data into a sealed SealedPayload that no staff role can read. Federation delivers the payload only to the operation's site worker, and the site deletes it when the operation ends. Co-Authored-By: Claude Opus 5.5 --- docs/README.md | 1 + docs/enhancements/machine-images/README.md | 447 ++++++++++++++++++ .../machine-images/diagrams/data-flow.svg | 54 +++ 3 files changed, 502 insertions(+) create mode 100644 docs/enhancements/machine-images/README.md create mode 100644 docs/enhancements/machine-images/diagrams/data-flow.svg diff --git a/docs/README.md b/docs/README.md index bf31f1c5..61100183 100644 --- a/docs/README.md +++ b/docs/README.md @@ -73,6 +73,7 @@ Each topic folder has a `README.md` entry point: | [Development](development/README.md) | Implementation status, local commands, and roadmap | | [Enhancements](enhancements/machine-lifecycle/README.md) | Focused machine lifecycle contracts and acceptance requirements | | [Device operations](enhancements/device-operations/README.md) | Proposed custody and operations for every physical action on a server | +| [OS images and bootstrap data](enhancements/machine-images/README.md) | Proposed image catalog and sealed bootstrap data for installs | | [Proposals](proposals/fleet-management/README.md) | Broader service proposals, examples, diagrams, and provenance | ## Read implementation and design separately diff --git a/docs/enhancements/machine-images/README.md b/docs/enhancements/machine-images/README.md new file mode 100644 index 00000000..905e18cd --- /dev/null +++ b/docs/enhancements/machine-images/README.md @@ -0,0 +1,447 @@ +--- +status: provisional +stage: alpha +--- + +# OS images and bootstrap data + +[Documentation overview](../../README.md) ยท [Functionality guide](../../functionality/README.md) + +- [Summary](#summary) +- [Motivation](#motivation) +- [Proposal](#proposal) +- [Design details](#design-details) + - [API design](#api-design) + - [Publication and entitlement](#publication-and-entitlement) + - [Admission](#admission) + - [Artifact distribution](#artifact-distribution) + - [Sealed bootstrap store](#sealed-bootstrap-store) + - [Site delivery](#site-delivery) + - [Implementation decisions](#implementation-decisions) + - [Acceptance tests](#acceptance-tests) +- [Production readiness review questionnaire](#production-readiness-review-questionnaire) +- [Implementation history](#implementation-history) +- [Drawbacks](#drawbacks) +- [Alternatives](#alternatives) +- [Infrastructure needed](#infrastructure-needed) + +## Summary + +A customer chooses an OS image from a catalog that the provider publishes, and +supplies bootstrap data such as user data and SSH keys. Both are inputs to an +`Installation`. + +The provider publishes each image as an immutable `MachineImage` that names its +artifacts by digest. Fleet resolves the customer's choice to that digest when +it admits the Installation, and keeps it. Fleet copies the bootstrap data into +a sealed store that staff cannot read, and delivers it only to the site worker +that runs the install. + +This enhancement is a proposal. Nothing in it is implemented. + +## Motivation + +The [machine lifecycle](../machine-lifecycle/README.md#installation) defines +the Installation, but not where images come from or how bootstrap data reaches +the server. [Device custody](../device-operations/README.md#customer-data) +requires a sealed store for bootstrap data and leaves the image catalog and +bootstrap APIs to Metal. Without them, a customer cannot choose an OS or +configure the installed system. + +### Goals + +- The provider publishes images that cannot change after publication. +- A customer can install only the images published to their project. +- An admitted install keeps the exact image it resolved, whatever later + happens to the catalog. +- Fleet refuses an image that does not match the server's architecture or + firmware mode. +- No staff role can read bootstrap data. +- Sites fetch image artifacts only by digest, from a source the site + configures, never from a URL in the API. +- No new database. + +### Non-goals + +- Building images, or which OS families to offer. +- Managed configuration policy for clusters, which the [OS configuration + proposal](../../proposals/fleet-management/os-configuration.md) covers. +- Delegated customer PXE, which the PXE installation proposal in + [#59][pxe-pr] covers. +- Secure Boot signing and measured boot. +- Guest health after the installed OS boots. + +## Proposal + +The provider publishes a `MachineImage` in its project and publishes it to the +consumer projects that may use it. A customer creates an Installation that +names a published image and, optionally, a bootstrap Secret in their own +project. + +The Fleet provider for Metal admits the Installation. It resolves the image to +its digest, checks it against the allocated server, copies the bootstrap data +into the sealed store, and creates a `DeviceInstallation` that carries the +digest and an opaque reference to the sealed copy. Custody admits and delivers +it as for any [Device operation](../device-operations/README.md#admission). + +![Image and bootstrap data flow from the provider and the customer to the site](diagrams/data-flow.svg) + +### User stories + +- A customer installs a published Linux image with their SSH key, then logs in. +- A customer reinstalls with new user data. The first install's data is not + reused. +- A provider publishes a fixed release of an image and withdraws an old one. + Machines installed from the old one keep running. +- A staff member investigates a failed install without seeing the customer's + user data. + +## Design details + +### API design + +Names are provisional. Examples use synthetic data. + +#### MachineImage in the provider project + +The provider defines each image release in its project: + +```yaml +apiVersion: metal.datumapis.com/v1alpha1 +kind: MachineImage +metadata: + name: example-linux-1-2 + namespace: default +spec: + definition: # immutable + family: example-linux + version: "1.2" + architecture: amd64 + firmwareModes: [UEFI] # UEFI | BIOS + bootstrapFormats: [NoCloud] # empty when the image takes no bootstrap data + digest: "sha256:4f2a9c..." # digest of the artifact manifest + availability: Available # Available | Withdrawn +``` + +The definition cannot change. A new release is a new MachineImage. The +provider can change only `availability`. A withdrawn image admits no new +Installations. + +The digest identifies the image's artifact manifest, which lists the digest of +every file the installer writes or boots. The API holds no URL. + +#### MachineImage in a consumer project + +Publication creates a MachineImage in the consumer project that names its +provider source, the same way a [MachineClass](../machine-lifecycle/README.md#machineclass) +does: + +```yaml +apiVersion: metal.datumapis.com/v1alpha1 +kind: MachineImage +metadata: + name: example-linux-1-2 + namespace: default +spec: + source: {project: example-provider, name: example-linux-1-2} # immutable +status: + resolved: + family: example-linux + version: "1.2" + architecture: amd64 + firmwareModes: [UEFI] + bootstrapFormats: [NoCloud] + digest: "sha256:4f2a9c..." + conditions: + - {type: Available, status: "True"} +``` + +A MachineImage has exactly one of `definition` or `source`. + +#### Bootstrap Secret + +The customer stores bootstrap data in a Secret of type +`metal.datumapis.com/bootstrap` in the Installation's namespace: + +```yaml +apiVersion: v1 +kind: Secret +metadata: + name: example-bootstrap + namespace: default +type: metal.datumapis.com/bootstrap +stringData: + userData: | + #cloud-config + hostname: example + sshAuthorizedKeys: | + ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleOnly example@example.com +``` + +Both keys are optional, but at least one is required, and together they hold +at most 64 KiB. Fleet passes user data to the image unchanged and installs the +keys for the image's default user. + +#### Installation + +The Installation keeps its shape. `imageRef` names a MachineImage in the same +project and namespace, and `bootstrapConfigRef` names a bootstrap Secret there: + +```yaml +apiVersion: metal.datumapis.com/v1alpha1 +kind: Installation +metadata: + name: example-os-1 + namespace: default +spec: + machineRef: {name: example} + expectedPredecessor: {type: None} + imageRef: {name: example-linux-1-2} + bootstrapConfigRef: {name: example-bootstrap} +status: + resolvedImage: {name: example-linux-1-2, digest: "sha256:4f2a9c..."} + conditions: + - {type: Accepted, status: "True"} +``` + +`status.resolvedImage` reports the digest Fleet admitted. Status never shows +bootstrap data or its digest. + +#### DeviceInstallation inputs + +The [DeviceInstallation](../device-operations/README.md#operations) carries +the provider image's name and digest, and the sealed copy's opaque reference +and digest. It carries no consumer project name and no bootstrap bytes. + +### Publication and entitlement + +The provider's publisher creates a consumer project's MachineImage, as it does +for MachineClass. Customers cannot create, change, or delete MachineImages. +Fleet records the publication in a protected record in the provider project, +as the machine lifecycle requires for [classes and +profiles](../machine-lifecycle/README.md#entitlement-and-publication). + +A project is entitled to an image only while all of these hold: + +- the consumer MachineImage exists and matches its retained publication; +- its source is in the provider project that holds the Machine's allocation; + and +- the provider MachineImage exists and is `Available`. + +The caller also needs `machineimages.use` on the consumer MachineImage, and +`get` on the bootstrap Secret. Fleet checks both for the principal that created +the Installation, as for [install +permission](../machine-lifecycle/README.md#request-authority). + +### Admission + +The Fleet provider admits an Installation in this order. Each step must pass +before the next one runs, and nothing is copied or created until all pass: + +1. The Machine has an active allocation, and the predecessor check passes. +2. The image is entitled and the caller may use it. +3. The image matches the allocation's hardware: + - its architecture equals the CPU architecture; + - it lists the server's firmware mode; and + - if the Installation has bootstrap data, it lists a bootstrap format. +4. The caller can read the bootstrap Secret, and its contents are valid. +5. The sealed copy is written. See [Write order](#write-order-and-crash-recovery). +6. The DeviceInstallation is created. + +The allocation records the server's hardware when Fleet allocates it, including +its firmware mode. Inventory records each Device's firmware mode, from BMC +discovery. A server with no recorded firmware mode installs no image. + +Each refusal sets `Accepted=False` on the Installation with one of these +reasons: + +| Reason | Refused by | +| --- | --- | +| `ImageNotFound` | No MachineImage of that name in the namespace | +| `ImageNotEntitled` | Publication, source project, or `machineimages.use` | +| `ImageWithdrawn` | The provider image is `Withdrawn` | +| `ImageIncompatible` | Architecture, firmware mode, or bootstrap format | +| `BootstrapNotFound` | No readable bootstrap Secret of that name | +| `BootstrapInvalid` | Wrong Secret type, no keys, unknown keys, or over 64 KiB | +| `AuthorizationUnavailable` | An authorization check could not complete | + +Fleet evaluates a refused Installation again while it exists, because a missing +publication or Secret can appear later. Admission is final once the +DeviceInstallation exists. Later changes to either MachineImage, the +publication, or the Secret never change an admitted install. + +The coordinator adds one [admission check](../device-operations/README.md#admission) +for DeviceInstallation: the sealed copy exists and matches its digest. If not, +it refuses with `BootstrapUnavailable`, and nothing is sent. + +### Artifact distribution + +The provider builds an image and pushes its artifacts and manifest to its +artifact registry, then creates the MachineImage with the manifest digest. The +registry is site configuration, not an API field. Customers cannot name a +registry, a URL, or an artifact. + +Each site keeps a content-addressed store. It mirrors every `Available` +provider MachineImage by digest from its configured registry, and checks every +artifact against the manifest before it keeps any. It keeps an image's +artifacts while a MachineImage or an operation that has not ended names the +digest. + +A site worker refuses an install whose image digest is not in the store, with +reason `ImageUnavailable`, before it sends anything. The site's boot service +serves an artifact only to a server booting under an open boot admission whose +operation names that image, and only if the artifact's digest matches the +manifest. + +### Sealed bootstrap store + +The sealed store is a dedicated kind, `SealedPayload`, in +`fleet.datumapis.com`, in the provider project. A Kubernetes Secret would not +work there: Milo grants permissions per kind or per object, not per namespace, +so every role that reads Secrets in the provider project would read every +payload. + +```yaml +apiVersion: fleet.datumapis.com/v1alpha1 +kind: SealedPayload +metadata: + name: sealed-9a3f0c5e21b7d84e6f10 + namespace: default +spec: # immutable + operationName: alloc-3b9d61c2-install-5d1e8a0b4c2f + digest: "sha256:0c2b77e1d9a4..." + data: # the bootstrap Secret's two values, exactly +``` + +The name derives from the operation name and the digest. A retried write after +a crash creates the same name, and the same name always holds the same bytes. + +| Identity | Can do on SealedPayload | +| --- | --- | +| Fleet provider for Metal | `create` only | +| Fleet coordinator, which includes the federation courier | `get`, `list`, `watch`, `delete` | +| Every staff role | Nothing | + +The provider never reads a payload back. Production must encrypt this kind at +rest in the provider project's storage. + +#### Write order and crash recovery + +| Change | Order | After a crash between the writes | +| --- | --- | --- | +| Admit an Installation | SealedPayload, then DeviceInstallation | The retry writes the same SealedPayload name and creates the operation. | +| End an install | Custody result, then operation status, then delete SealedPayload | The coordinator deletes the payload of every ended operation. | + +The coordinator also deletes a SealedPayload that no operation names after one +hour. If the provider creates the operation after that, admission refuses it +with `BootstrapUnavailable`, and the customer creates a new Installation. + +### Site delivery + +Federation delivers the payload to the site with the operation, as a separate +Secret, never inside the operation's handoff. The site's handoff names that +Secret, and the site grants that operation's worker `get` on exactly that +Secret. No site identity can list or watch these Secrets. + +The worker checks the payload against the operation's digest and refuses with +`InputMismatch` before it sends anything if they differ. It hands the payload to +the server only through that operation's one-time boot: the boot service +serves it once, under the boot admission's capability, in the image's +bootstrap format. The boot service drops its copy when the admission closes. + +The site deletes the payload Secret when the operation ends, when a higher +fence stops its worker, or when the coordinator answers its result, whichever +comes first. Federation removes its copy when the coordinator answers the +result. + +### Implementation decisions + +Record these before production: + +- **Production OS.** Proposed: Debian 13 generic cloud image, amd64, UEFI, + with cloud-init NoCloud. A person must choose and qualify it. +- **Encryption at rest.** Which key protects `SealedPayload` in Milo storage. +- **Firmware mode source.** BMC discovery reports it, or staff record it in + inventory. +- **Artifact registry.** Which registry holds provider artifacts, and how + sites authenticate to it. + +### Acceptance tests + +These tests are required and not implemented: + +- A customer installs a published image, and the guest receives exactly its + user data and SSH keys. +- A customer names an image that is not published to their project, and + admission refuses it. +- A withdrawn image admits no new install, and a running install of it + completes. +- The provider deletes and recreates a MachineImage with other artifacts under + the same name, and an admitted install keeps the first digest. +- An image's architecture or firmware mode does not match the server, and + admission refuses it. +- The customer edits the bootstrap Secret after admission, and the install uses + the admitted data. +- The provider crashes between the sealed write and the operation, retries, and + one payload and one operation exist. +- No staff role can get, list, or watch a SealedPayload, and no site identity + other than the operation's worker can read its payload Secret. +- The payload is gone from the provider project and the site after the + operation ends. + +## Production readiness review questionnaire + +These controls are proposed, not implemented. + +### How do operators enable or disable the feature? + +Register MachineImage, SealedPayload, and their IAM resources, then publish +images. To stop new installs of an image, withdraw it. + +### Does enabling the feature change any default behavior? + +Installations that name a bare digest stop resolving. A consumer project needs +a published MachineImage to install. + +### What must operators monitor? + +Refused Installations by reason, images a site has not mirrored, and +SealedPayloads older than their operation's deadline. + +### What does the feature depend on? + +Milo for project APIs and IAM, Device custody for execution, federation to +reach sites, and the provider's artifact registry. + +### Does the feature add API types or calls? + +It adds MachineImage to Metal and SealedPayload to Fleet. Each install adds +one SealedPayload write and one delete. + +## Implementation history + +- 2026-11-25: Proposed. + +## Drawbacks + +- Each site stores every available image. +- A customer can change bootstrap data only by creating a new Installation. +- The site's boot service holds the payload while the boot admission is open. + +## Alternatives + +- **Images listed on the MachineClass:** Every image release would edit the + offering, and IAM could not grant one image without the others. +- **A URL in the MachineImage:** Sites would fetch from wherever the API + points, which allows server-side request forgery. +- **A Secret in a protected namespace for the sealed store:** Milo IAM cannot + scope Secret access to a namespace. +- **Carrying the payload in the operation:** Staff can read operations. + +## Infrastructure needed + +Testing needs one provider project, two consumer projects, one site with a +boot service, and an artifact registry. The local VM and Redfish lab modes can +prove the install path without hardware. + +[pxe-pr]: https://github.com/datum-cloud/fleet/pull/59 diff --git a/docs/enhancements/machine-images/diagrams/data-flow.svg b/docs/enhancements/machine-images/diagrams/data-flow.svg new file mode 100644 index 00000000..9bcd1cb0 --- /dev/null +++ b/docs/enhancements/machine-images/diagrams/data-flow.svg @@ -0,0 +1,54 @@ + +Image and bootstrap data flow from the provider and the customer to the siteIn the provider project, the provider defines a MachineImage by digest and publishes it to a consumer project. In the consumer project, the customer creates an Installation that names the published MachineImage and a bootstrap Secret. The Fleet provider for Metal resolves the image to its digest, copies the bootstrap data into a SealedPayload, and creates a DeviceInstallation that carries the digest and the sealed reference. The coordinator admits it and delivers the operation and the payload to the site. The site worker fetches the image artifacts by digest from the site's content-addressed store, which mirrors the provider's artifact registry, and boots the server with the image and the payload. + + + + +Consumer project + +Provider project + +Site + +MachineImage +Published copy + +Installation +Image and Secret + +Bootstrap Secret +User data, SSH keys + +MachineImage +Immutable, by digest + +DeviceInstallation +Digest, sealed reference + +SealedPayload +Coordinator reads only + +Artifact store +By digest + +Worker +One operation + +Server +One-time boot + +Publish + +Admit + +Copy + +Resolve digest + +Reference + + +Deliver + + + From bdca0b1307a9c24e487bfe1749c82c98ce2cf620 Mon Sep 17 00:00:00 2001 From: Scot Wells Date: Wed, 25 Nov 2026 09:32:59 -0600 Subject: [PATCH 02/14] docs: Close review gaps in the OS image and bootstrap design Tie the sealed payload sweep to ended operations and released allocations, so it never removes a payload admission still needs, and name payloads from the operation and digest so a crash retry with an edited Secret leaves one referenced payload. Pin the provider image's UID and digest in the publication record, require use on both images, and enforce customer write refusal with the validating webhook. Define the boot admission that lets the site's boot service serve a payload, and record that as a change to the custody customer data rule. Salt the payload digest, keep payload bodies out of audit logs, have federation send sites the digests to mirror, check firmware mode again at the worker, and point the machine lifecycle at the catalog. Co-Authored-By: Claude Opus 5.5 --- docs/enhancements/machine-images/README.md | 237 +++++++++++------- docs/enhancements/machine-lifecycle/README.md | 14 +- 2 files changed, 154 insertions(+), 97 deletions(-) diff --git a/docs/enhancements/machine-images/README.md b/docs/enhancements/machine-images/README.md index 905e18cd..bcd8e885 100644 --- a/docs/enhancements/machine-images/README.md +++ b/docs/enhancements/machine-images/README.md @@ -33,9 +33,8 @@ supplies bootstrap data such as user data and SSH keys. Both are inputs to an The provider publishes each image as an immutable `MachineImage` that names its artifacts by digest. Fleet resolves the customer's choice to that digest when -it admits the Installation, and keeps it. Fleet copies the bootstrap data into -a sealed store that staff cannot read, and delivers it only to the site worker -that runs the install. +it admits the Installation. Fleet copies the bootstrap data into a sealed store +that staff cannot read, and delivers it only to the site that runs the install. This enhancement is a proposal. Nothing in it is implemented. @@ -52,8 +51,7 @@ configure the installed system. - The provider publishes images that cannot change after publication. - A customer can install only the images published to their project. -- An admitted install keeps the exact image it resolved, whatever later - happens to the catalog. +- Later catalog changes never change an admitted install. - Fleet refuses an image that does not match the server's architecture or firmware mode. - No staff role can read bootstrap data. @@ -96,6 +94,20 @@ it as for any [Device operation](../device-operations/README.md#admission). - A staff member investigates a failed install without seeing the customer's user data. +### Relationship to other proposals + +This enhancement changes two parts of [Device +custody](../device-operations/README.md): + +- **[Customer data](../device-operations/README.md#customer-data):** the + site's boot service can also read a payload, only while that operation's + boot is open. See [Site delivery](#site-delivery). +- **[Admission](../device-operations/README.md#admission):** DeviceInstallation + adds one check of its own inputs. + +It replaces the machine lifecycle's operator-installed image fixtures with the +published catalog. + ## Design details ### API design @@ -113,7 +125,7 @@ metadata: name: example-linux-1-2 namespace: default spec: - definition: # immutable + definition: family: example-linux version: "1.2" architecture: amd64 @@ -123,9 +135,8 @@ spec: availability: Available # Available | Withdrawn ``` -The definition cannot change. A new release is a new MachineImage. The -provider can change only `availability`. A withdrawn image admits no new -Installations. +The provider can change only `availability`, and a new release is a new +MachineImage. A withdrawn image admits no new Installations. The digest identifies the image's artifact manifest, which lists the digest of every file the installer writes or boots. The API holds no URL. @@ -156,7 +167,8 @@ status: - {type: Available, status: "True"} ``` -A MachineImage has exactly one of `definition` or `source`. +A MachineImage has exactly one of `definition` or `source`. Status is for +display; admission reads the [publication record](#publication-and-entitlement). #### Bootstrap Secret @@ -216,41 +228,55 @@ and digest. It carries no consumer project name and no bootstrap bytes. ### Publication and entitlement The provider's publisher creates a consumer project's MachineImage, as it does -for MachineClass. Customers cannot create, change, or delete MachineImages. -Fleet records the publication in a protected record in the provider project, -as the machine lifecycle requires for [classes and -profiles](../machine-lifecycle/README.md#entitlement-and-publication). +for MachineClass. Fleet records each publication in a protected record in the +provider project: the consumer MachineImage, and the provider MachineImage's +name, UID, and digest. + +Customers cannot write MachineImages. IAM gives customer roles no write +permission on the kind, and a Fleet validating webhook, called from Milo's root +API server, rejects: + +- a write by anyone but the provider's publisher in a consumer project; +- a `definition` outside a project that Fleet registers as a provider; and +- any change to `definition` or `source`. A project is entitled to an image only while all of these hold: -- the consumer MachineImage exists and matches its retained publication; -- its source is in the provider project that holds the Machine's allocation; - and -- the provider MachineImage exists and is `Available`. +- the consumer MachineImage exists and matches its publication record; +- the provider MachineImage is in the provider project that holds the + Machine's allocation, and its UID and digest match the record; and +- the provider MachineImage is `Available`. -The caller also needs `machineimages.use` on the consumer MachineImage, and -`get` on the bootstrap Secret. Fleet checks both for the principal that created -the Installation, as for [install -permission](../machine-lifecycle/README.md#request-authority). +The caller also needs `machineimages.use` on both the consumer and provider +MachineImages, as for [classes and +profiles](../machine-lifecycle/README.md#request-authority), and `get` on the +bootstrap Secret. Fleet checks these for the principal that created the +Installation. ### Admission The Fleet provider admits an Installation in this order. Each step must pass -before the next one runs, and nothing is copied or created until all pass: +before the next one runs: 1. The Machine has an active allocation, and the predecessor check passes. -2. The image is entitled and the caller may use it. +2. The image is entitled and the caller may use it. Fleet takes the digest from + the publication record. 3. The image matches the allocation's hardware: - its architecture equals the CPU architecture; - it lists the server's firmware mode; and - if the Installation has bootstrap data, it lists a bootstrap format. -4. The caller can read the bootstrap Secret, and its contents are valid. -5. The sealed copy is written. See [Write order](#write-order-and-crash-recovery). -6. The DeviceInstallation is created. - -The allocation records the server's hardware when Fleet allocates it, including -its firmware mode. Inventory records each Device's firmware mode, from BMC -discovery. A server with no recorded firmware mode installs no image. +4. If a DeviceInstallation already exists for this Installation, Fleet stops + here: the install is admitted. +5. The caller can read the bootstrap Secret, and its contents are valid. +6. The sealed copy is written. See [Retention and crash recovery](#retention-and-crash-recovery). +7. The DeviceInstallation is created. + +The allocation's hardware snapshot would gain the server's firmware mode. This +field is proposed, and its source is an [open +decision](#implementation-decisions). A server with no recorded firmware mode +installs no image. Because firmware settings can change after allocation, the +site worker also reads the server's firmware mode before it sends anything, +and refuses with `ImageIncompatible` if the image does not list it. Each refusal sets `Accepted=False` on the Installation with one of these reasons: @@ -258,7 +284,7 @@ reasons: | Reason | Refused by | | --- | --- | | `ImageNotFound` | No MachineImage of that name in the namespace | -| `ImageNotEntitled` | Publication, source project, or `machineimages.use` | +| `ImageNotEntitled` | Publication record, provider project, UID, digest, or `machineimages.use` | | `ImageWithdrawn` | The provider image is `Withdrawn` | | `ImageIncompatible` | Architecture, firmware mode, or bootstrap format | | `BootstrapNotFound` | No readable bootstrap Secret of that name | @@ -267,12 +293,17 @@ reasons: Fleet evaluates a refused Installation again while it exists, because a missing publication or Secret can appear later. Admission is final once the -DeviceInstallation exists. Later changes to either MachineImage, the -publication, or the Secret never change an admitted install. +DeviceInstallation exists. + +The coordinator adds one check of DeviceInstallation inputs. It passes when the +operation has no bootstrap data. Otherwise the referenced SealedPayload must +exist and match the operation's digest, or the coordinator refuses with +`BootstrapUnavailable`, and nothing is sent. Like every kind check, it holds at +the moment of the custody update. [Retention](#retention-and-crash-recovery) +keeps the payload after that. -The coordinator adds one [admission check](../device-operations/README.md#admission) -for DeviceInstallation: the sealed copy exists and matches its digest. If not, -it refuses with `BootstrapUnavailable`, and nothing is sent. +A refused or failed DeviceInstallation reports its reason on the Installation. +The Installation is immutable, so the customer creates a new one. ### Artifact distribution @@ -281,40 +312,42 @@ artifact registry, then creates the MachineImage with the manifest digest. The registry is site configuration, not an API field. Customers cannot name a registry, a URL, or an artifact. -Each site keeps a content-addressed store. It mirrors every `Available` -provider MachineImage by digest from its configured registry, and checks every -artifact against the manifest before it keeps any. It keeps an image's -artifacts while a MachineImage or an operation that has not ended names the -digest. +Each site keeps a content-addressed store. The coordinator sends each site, +through federation, the digests of every `Available` provider MachineImage. +Sites cannot read the catalog. A site mirrors each digest from its configured +registry, and checks every artifact against the manifest before it keeps any. +It keeps an image's artifacts while the digest list or an operation that has +not ended names the digest. -A site worker refuses an install whose image digest is not in the store, with -reason `ImageUnavailable`, before it sends anything. The site's boot service -serves an artifact only to a server booting under an open boot admission whose -operation names that image, and only if the artifact's digest matches the -manifest. +If an install's digest is not in the store, the worker fetches it by digest +from the configured registry before it sends anything. If that fails, it +refuses with `ImageUnavailable`. ### Sealed bootstrap store The sealed store is a dedicated kind, `SealedPayload`, in `fleet.datumapis.com`, in the provider project. A Kubernetes Secret would not -work there: Milo grants permissions per kind or per object, not per namespace, -so every role that reads Secrets in the provider project would read every -payload. +work there: [Milo PolicyBindings][milo-policybinding] grant a role on one kind +or one object, not on a namespace, so every role that reads Secrets in the +provider project would read every payload. ```yaml apiVersion: fleet.datumapis.com/v1alpha1 kind: SealedPayload metadata: - name: sealed-9a3f0c5e21b7d84e6f10 + name: sealed-5e0a7d namespace: default spec: # immutable - operationName: alloc-3b9d61c2-install-5d1e8a0b4c2f + operationName: alloc-3b9d61c2-install-1 + allocationName: alloc-3b9d61c2 digest: "sha256:0c2b77e1d9a4..." + salt: # 32 random bytes data: # the bootstrap Secret's two values, exactly ``` -The name derives from the operation name and the digest. A retried write after -a crash creates the same name, and the same name always holds the same bytes. +The digest covers the salt and the data. A reader of the DeviceInstallation +cannot confirm a guessed SSH key against it. The name derives from the +operation name and the digest. | Identity | Can do on SealedPayload | | --- | --- | @@ -323,36 +356,60 @@ a crash creates the same name, and the same name always holds the same bytes. | Every staff role | Nothing | The provider never reads a payload back. Production must encrypt this kind at -rest in the provider project's storage. +rest, and the audit policy must omit request and response bodies for it. -#### Write order and crash recovery +#### Retention and crash recovery | Change | Order | After a crash between the writes | | --- | --- | --- | -| Admit an Installation | SealedPayload, then DeviceInstallation | The retry writes the same SealedPayload name and creates the operation. | -| End an install | Custody result, then operation status, then delete SealedPayload | The coordinator deletes the payload of every ended operation. | +| Admit an Installation | SealedPayload, then DeviceInstallation | The retry re-reads the Secret. If it changed, the retry writes a second payload under another name, and the operation names that one. | +| End an install | Custody result, then operation status, then delete SealedPayload | The coordinator deletes it on its next pass. | -The coordinator also deletes a SealedPayload that no operation names after one -hour. If the provider creates the operation after that, admission refuses it -with `BootstrapUnavailable`, and the customer creates a new Installation. +The coordinator deletes a SealedPayload, with its UID as a precondition, only +when one of these holds: -### Site delivery +- its operation has ended as `Succeeded`, `Failed`, `Cancelled`, or + `OutcomeUnknown`; +- its operation exists and references another payload; or +- no operation has its name, and its allocation is no longer `Active`. -Federation delivers the payload to the site with the operation, as a separate -Secret, never inside the operation's handoff. The site's handoff names that -Secret, and the site grants that operation's worker `get` on exactly that -Secret. No site identity can list or watch these Secrets. +An allocation that is not `Active` cannot admit an install, so the last rule +never removes a payload that admission still needs. Fleet does not retry an +install: a [held installation](../device-operations/README.md#unknown-outcomes) +is settled by a later DeviceInstallation from a new Installation, which reads +the Secret again. That Installation names the held Installation as its +predecessor. -The worker checks the payload against the operation's digest and refuses with -`InputMismatch` before it sends anything if they differ. It hands the payload to -the server only through that operation's one-time boot: the boot service -serves it once, under the boot admission's capability, in the image's -bootstrap format. The boot service drops its copy when the admission closes. +### Site delivery -The site deletes the payload Secret when the operation ends, when a higher -fence stops its worker, or when the coordinator answers its result, whichever -comes first. Federation removes its copy when the coordinator answers the -result. +Federation delivers the payload to the site with the operation, as a separate +Secret, never inside the operation's handoff. The handoff names that Secret, +and the site grants that operation's worker `get` on exactly that Secret. No +site identity can list or watch these Secrets. + +The worker checks the payload against the operation's digest, and refuses with +`InputMismatch` before it sends anything if they differ. It renders the payload +in the image's bootstrap format and attaches it to the operation's boot +admission. A boot admission is the site record that lets one server network +boot once: + +- it names the operation, the fence, and the boot interface's MAC address; +- it carries a random 256-bit token, which appears only in the boot script the + site serves to that MAC address; +- it closes when the installer finishes, when its 10-minute window ends, or + when a higher fence stops the worker. + +While the admission is open, the boot service serves the rendered payload to +requests that carry the token, so a firmware retry within the window works. +Production serves it over HTTPS with a site-issued certificate that the +installer trusts. The installer writes it where the image's bootstrap format +reads it on first boot. The boot service drops its copy when the admission +closes. + +The site deletes the payload Secret and every copy when the operation ends, +when a higher fence stops its worker, or when the coordinator answers its +result, whichever comes first. Federation removes its copy when the coordinator +answers the result. ### Implementation decisions @@ -372,22 +429,24 @@ These tests are required and not implemented: - A customer installs a published image, and the guest receives exactly its user data and SSH keys. -- A customer names an image that is not published to their project, and - admission refuses it. +- A customer names an image that is not published to their project, or writes + their own MachineImage, and Fleet refuses it. - A withdrawn image admits no new install, and a running install of it completes. - The provider deletes and recreates a MachineImage with other artifacts under - the same name, and an admitted install keeps the first digest. + the same name. An admitted install keeps the first digest, and a new install + is refused until the image is published again. - An image's architecture or firmware mode does not match the server, and - admission refuses it. + admission or the worker refuses it before anything is sent. - The customer edits the bootstrap Secret after admission, and the install uses the admitted data. -- The provider crashes between the sealed write and the operation, retries, and - one payload and one operation exist. +- The provider crashes between the sealed write and the operation, and the + Secret changes before the retry. One operation exists, and the unused payload + is deleted. - No staff role can get, list, or watch a SealedPayload, and no site identity other than the operation's worker can read its payload Secret. -- The payload is gone from the provider project and the site after the - operation ends. +- After the operation ends, no copy of the payload remains in the provider + project, the federation layer, or the site. ## Production readiness review questionnaire @@ -395,13 +454,12 @@ These controls are proposed, not implemented. ### How do operators enable or disable the feature? -Register MachineImage, SealedPayload, and their IAM resources, then publish -images. To stop new installs of an image, withdraw it. +Register MachineImage, SealedPayload, their webhook, and their IAM resources, +then publish images. To stop new installs of an image, withdraw it. ### Does enabling the feature change any default behavior? -Installations that name a bare digest stop resolving. A consumer project needs -a published MachineImage to install. +A consumer project needs a published MachineImage to install. ### What must operators monitor? @@ -426,7 +484,7 @@ one SealedPayload write and one delete. - Each site stores every available image. - A customer can change bootstrap data only by creating a new Installation. -- The site's boot service holds the payload while the boot admission is open. +- The site's boot service can read a payload while its boot is open. ## Alternatives @@ -434,8 +492,6 @@ one SealedPayload write and one delete. offering, and IAM could not grant one image without the others. - **A URL in the MachineImage:** Sites would fetch from wherever the API points, which allows server-side request forgery. -- **A Secret in a protected namespace for the sealed store:** Milo IAM cannot - scope Secret access to a namespace. - **Carrying the payload in the operation:** Staff can read operations. ## Infrastructure needed @@ -445,3 +501,4 @@ boot service, and an artifact registry. The local VM and Redfish lab modes can prove the install path without hardware. [pxe-pr]: https://github.com/datum-cloud/fleet/pull/59 +[milo-policybinding]: https://github.com/milo-os/milo/blob/cd469ff4235c0847d9863a132bdb58f3ff8d3845/pkg/apis/iam/v1alpha1/policybinding_types.go diff --git a/docs/enhancements/machine-lifecycle/README.md b/docs/enhancements/machine-lifecycle/README.md index 4b6ef688..0c360482 100644 --- a/docs/enhancements/machine-lifecycle/README.md +++ b/docs/enhancements/machine-lifecycle/README.md @@ -78,8 +78,9 @@ consumer. ### Non-goals This enhancement excludes procurement, full physical inventory, real BMC and -console access, network implementation, image-catalog management, OS policy -composition, managed clusters, `NodeClaim`, rollouts, and node services. +console access, network implementation, OS policy composition, managed +clusters, `NodeClaim`, rollouts, and node services. The [OS images +enhancement](../machine-images/README.md) proposes the image catalog. The later bare-metal release must qualify real hardware, network handoff, cleaning, and a supported non-Talos OS. Simulated results do not satisfy that gate. @@ -1151,11 +1152,10 @@ contract first. ### Provider execution and recovery Typed resolvers supply image inputs, network evidence, and provider access; -missing required evidence blocks dispatch. Operator-installed, project-scoped -image fixtures provide immutable artifacts, permissions, compatibility, and -bootstrap behavior without accepting arbitrary URLs. A future catalog can -implement that resolver. Private fixtures also resolve provider and cleaning -records without adding public provider APIs. +missing required evidence blocks dispatch. The [published image +catalog](../machine-images/README.md) supplies image inputs and bootstrap +behavior without accepting arbitrary URLs. Private fixtures resolve provider +and cleaning records without adding public provider APIs. Persist dispatch intent before sending commands. Retries reuse the operation ID and exact plan; a changed plan with the same key conflicts. After a lost response, From 39d960c177cf62b9055a9b335ea499f827741c50 Mon Sep 17 00:00:00 2001 From: Scot Wells Date: Wed, 25 Nov 2026 09:34:18 -0600 Subject: [PATCH 03/14] docs: Name the settling predecessor and drop repeated facts Record that a settling Installation may name a held Installation as its predecessor, as a change to the machine lifecycle rule, say that every crash retry writes a new payload because the salt is new, and remove facts the design states twice. Co-Authored-By: Claude Opus 5.5 --- docs/enhancements/machine-images/README.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/docs/enhancements/machine-images/README.md b/docs/enhancements/machine-images/README.md index bcd8e885..99ccc7a7 100644 --- a/docs/enhancements/machine-images/README.md +++ b/docs/enhancements/machine-images/README.md @@ -105,7 +105,11 @@ custody](../device-operations/README.md): - **[Admission](../device-operations/README.md#admission):** DeviceInstallation adds one check of its own inputs. -It replaces the machine lifecycle's operator-installed image fixtures with the +It changes the machine lifecycle's [predecessor +rule](../machine-lifecycle/README.md#installation): an Installation that +settles a held installation names the held Installation as its predecessor, +although uncertain work otherwise offers no usable predecessor. It also +replaces the machine lifecycle's operator-installed image fixtures with the published catalog. ## Design details @@ -139,7 +143,7 @@ The provider can change only `availability`, and a new release is a new MachineImage. A withdrawn image admits no new Installations. The digest identifies the image's artifact manifest, which lists the digest of -every file the installer writes or boots. The API holds no URL. +every file the installer writes or boots. #### MachineImage in a consumer project @@ -362,7 +366,7 @@ rest, and the audit policy must omit request and response bodies for it. | Change | Order | After a crash between the writes | | --- | --- | --- | -| Admit an Installation | SealedPayload, then DeviceInstallation | The retry re-reads the Secret. If it changed, the retry writes a second payload under another name, and the operation names that one. | +| Admit an Installation | SealedPayload, then DeviceInstallation | The retry re-reads the Secret and writes a new payload, because the salt is new. The operation names that payload. | | End an install | Custody result, then operation status, then delete SealedPayload | The coordinator deletes it on its next pass. | The coordinator deletes a SealedPayload, with its UID as a precondition, only @@ -377,8 +381,7 @@ An allocation that is not `Active` cannot admit an install, so the last rule never removes a payload that admission still needs. Fleet does not retry an install: a [held installation](../device-operations/README.md#unknown-outcomes) is settled by a later DeviceInstallation from a new Installation, which reads -the Secret again. That Installation names the held Installation as its -predecessor. +the Secret again. ### Site delivery @@ -440,8 +443,8 @@ These tests are required and not implemented: admission or the worker refuses it before anything is sent. - The customer edits the bootstrap Secret after admission, and the install uses the admitted data. -- The provider crashes between the sealed write and the operation, and the - Secret changes before the retry. One operation exists, and the unused payload +- The provider crashes between the sealed write and the operation, then + retries. One operation exists, and the unused payload is deleted. - No staff role can get, list, or watch a SealedPayload, and no site identity other than the operation's worker can read its payload Secret. @@ -484,7 +487,6 @@ one SealedPayload write and one delete. - Each site stores every available image. - A customer can change bootstrap data only by creating a new Installation. -- The site's boot service can read a payload while its boot is open. ## Alternatives From 7ef97c2eac25e3140f9a0e8fd238ba112a59bdf7 Mon Sep 17 00:00:00 2001 From: Scot Wells Date: Wed, 25 Nov 2026 14:35:53 -0600 Subject: [PATCH 04/14] docs: Let the worker-creating site controller read payloads Record, beside the boot service amendment, that the site controller that creates every worker may read site payloads, and why that grants no new access. Describe the delivered payload as a dedicated kind, not a Secret, so permission on it reaches nothing else, and state that federation deletes the delivered copy once the result is answered. Co-Authored-By: Claude Opus 5.5 --- docs/enhancements/machine-images/README.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/docs/enhancements/machine-images/README.md b/docs/enhancements/machine-images/README.md index 99ccc7a7..0eb712e0 100644 --- a/docs/enhancements/machine-images/README.md +++ b/docs/enhancements/machine-images/README.md @@ -101,7 +101,9 @@ custody](../device-operations/README.md): - **[Customer data](../device-operations/README.md#customer-data):** the site's boot service can also read a payload, only while that operation's - boot is open. See [Site delivery](#site-delivery). + boot is open. The site controller that creates every worker can also read + site payloads; it grants no new access, because that controller can already + run a worker as any operation's identity. See [Site delivery](#site-delivery). - **[Admission](../device-operations/README.md#admission):** DeviceInstallation adds one check of its own inputs. @@ -386,9 +388,10 @@ the Secret again. ### Site delivery Federation delivers the payload to the site with the operation, as a separate -Secret, never inside the operation's handoff. The handoff names that Secret, -and the site grants that operation's worker `get` on exactly that Secret. No -site identity can list or watch these Secrets. +object, never inside the operation's handoff. It is a dedicated kind, not a +Secret, so permission on it reaches nothing else. The handoff names that +object, and the site grants that operation's worker `get` on exactly that +object. No worker can list or watch payloads. The worker checks the payload against the operation's digest, and refuses with `InputMismatch` before it sends anything if they differ. It renders the payload @@ -409,10 +412,9 @@ installer trusts. The installer writes it where the image's bootstrap format reads it on first boot. The boot service drops its copy when the admission closes. -The site deletes the payload Secret and every copy when the operation ends, -when a higher fence stops its worker, or when the coordinator answers its -result, whichever comes first. Federation removes its copy when the coordinator -answers the result. +The site deletes every copy it made when the operation ends or a higher fence +stops its worker. When the coordinator answers the result, federation deletes +the delivered object at the site. ### Implementation decisions From bde200690f4276f8c288eeb928efd15b4cb1fc25 Mon Sep 17 00:00:00 2001 From: Scot Wells Date: Wed, 25 Nov 2026 14:36:36 -0600 Subject: [PATCH 05/14] docs: Bound the site controller's payload read State that the site controller may only get a site payload by name, say that no site identity can list or watch payloads, and correct the acceptance test that still named a payload Secret and only the worker. Co-Authored-By: Claude Opus 5.5 --- docs/enhancements/machine-images/README.md | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/docs/enhancements/machine-images/README.md b/docs/enhancements/machine-images/README.md index 0eb712e0..cc8a933b 100644 --- a/docs/enhancements/machine-images/README.md +++ b/docs/enhancements/machine-images/README.md @@ -101,9 +101,10 @@ custody](../device-operations/README.md): - **[Customer data](../device-operations/README.md#customer-data):** the site's boot service can also read a payload, only while that operation's - boot is open. The site controller that creates every worker can also read - site payloads; it grants no new access, because that controller can already - run a worker as any operation's identity. See [Site delivery](#site-delivery). + boot is open. The site controller that creates every worker can also get a + site payload by name, with no list, watch, or write; it grants no new + access, because that controller can already run a worker as any operation's + identity. See [Site delivery](#site-delivery). - **[Admission](../device-operations/README.md#admission):** DeviceInstallation adds one check of its own inputs. @@ -388,10 +389,11 @@ the Secret again. ### Site delivery Federation delivers the payload to the site with the operation, as a separate -object, never inside the operation's handoff. It is a dedicated kind, not a -Secret, so permission on it reaches nothing else. The handoff names that -object, and the site grants that operation's worker `get` on exactly that -object. No worker can list or watch payloads. +object, never inside the operation's handoff. That object is a dedicated +kind, not a Secret, like the sealed store, so permission on it reaches nothing +else. The handoff names that object, and the site grants that operation's +worker `get` on exactly that object. No site identity can list or watch +payloads. The worker checks the payload against the operation's digest, and refuses with `InputMismatch` before it sends anything if they differ. It renders the payload @@ -449,7 +451,8 @@ These tests are required and not implemented: retries. One operation exists, and the unused payload is deleted. - No staff role can get, list, or watch a SealedPayload, and no site identity - other than the operation's worker can read its payload Secret. + other than the operation's worker and the site controller that creates + workers can read its delivered payload. - After the operation ends, no copy of the payload remains in the provider project, the federation layer, or the site. From 96c9907d277b390b17f584eadefcd7160d302725 Mon Sep 17 00:00:00 2001 From: Scot Wells Date: Wed, 25 Nov 2026 15:58:44 -0600 Subject: [PATCH 06/14] docs: Define install success as installer-verified bootstrap data Fleet does not own the guest OS, so success must not depend on the installed system printing anything. The installer reads the payload back from the target disk and reports its salted digest; the worker requires it before success. Co-Authored-By: Claude Opus 5.5 --- docs/enhancements/machine-images/README.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/enhancements/machine-images/README.md b/docs/enhancements/machine-images/README.md index cc8a933b..ff5ac1bd 100644 --- a/docs/enhancements/machine-images/README.md +++ b/docs/enhancements/machine-images/README.md @@ -411,8 +411,11 @@ While the admission is open, the boot service serves the rendered payload to requests that carry the token, so a firmware retry within the window works. Production serves it over HTTPS with a site-issued certificate that the installer trusts. The installer writes it where the image's bootstrap format -reads it on first boot. The boot service drops its copy when the admission -closes. +reads it on first boot, then reads it back from the target disk and reports +its salted digest. The worker reports success only when that digest matches +the operation's digest. Success never depends on what the installed OS does +or prints, because Fleet does not own the guest. The boot service drops its +copy when the admission closes. The site deletes every copy it made when the operation ends or a higher fence stops its worker. When the coordinator answers the result, federation deletes @@ -434,8 +437,10 @@ Record these before production: These tests are required and not implemented: -- A customer installs a published image, and the guest receives exactly its - user data and SSH keys. +- A customer installs a published image, and the installer verifies exactly + its user data and SSH keys on the target disk before the install succeeds. +- The installer reads back a wrong or truncated payload, and the install fails + without reporting `Succeeded`. - A customer names an image that is not published to their project, or writes their own MachineImage, and Fleet refuses it. - A withdrawn image admits no new install, and a running install of it From 3ad444655a5a408f3b99d152d592744b66211ab1 Mon Sep 17 00:00:00 2001 From: Scot Wells Date: Wed, 25 Nov 2026 15:59:40 -0600 Subject: [PATCH 07/14] docs: Say where the installer gets the salt it digests Co-Authored-By: Claude Opus 5.5 --- docs/enhancements/machine-images/README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/enhancements/machine-images/README.md b/docs/enhancements/machine-images/README.md index ff5ac1bd..a29bb6e5 100644 --- a/docs/enhancements/machine-images/README.md +++ b/docs/enhancements/machine-images/README.md @@ -411,11 +411,12 @@ While the admission is open, the boot service serves the rendered payload to requests that carry the token, so a firmware retry within the window works. Production serves it over HTTPS with a site-issued certificate that the installer trusts. The installer writes it where the image's bootstrap format -reads it on first boot, then reads it back from the target disk and reports -its salted digest. The worker reports success only when that digest matches -the operation's digest. Success never depends on what the installed OS does -or prints, because Fleet does not own the guest. The boot service drops its -copy when the admission closes. +reads it on first boot. The payload also carries the salt and the admitted +data, so the installer reads them back from the target disk, recomputes the +salted digest, and reports it. The worker reports success only when that +digest matches the operation's digest. Success never depends on what the +installed OS does or prints, because Fleet does not own the guest. The boot +service drops its copy when the admission closes. The site deletes every copy it made when the operation ends or a higher fence stops its worker. When the coordinator answers the result, federation deletes From 5c5da239f969d3fe88c95d999cc8d8a2cb9dbb77 Mon Sep 17 00:00:00 2001 From: Scot Wells Date: Wed, 25 Nov 2026 16:11:20 -0600 Subject: [PATCH 08/14] docs: Pin image publications by name, not spec UIDs Co-Authored-By: Claude Opus 5.5 --- docs/enhancements/machine-images/README.md | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/docs/enhancements/machine-images/README.md b/docs/enhancements/machine-images/README.md index a29bb6e5..f25f79bf 100644 --- a/docs/enhancements/machine-images/README.md +++ b/docs/enhancements/machine-images/README.md @@ -236,8 +236,11 @@ and digest. It carries no consumer project name and no bootstrap bytes. The provider's publisher creates a consumer project's MachineImage, as it does for MachineClass. Fleet records each publication in a protected record in the -provider project: the consumer MachineImage, and the provider MachineImage's -name, UID, and digest. +provider project. The record names the consumer MachineImage and the provider +MachineImage, and holds the provider image's digest. Its name derives from the +consumer project, the consumer MachineImage, and the provider MachineImage +incarnations, so its spec holds no object UID. Publishing a recreated image +again writes a new record; a record never changes. Customers cannot write MachineImages. IAM gives customer roles no write permission on the kind, and a Fleet validating webhook, called from Milo's root @@ -249,9 +252,11 @@ API server, rejects: A project is entitled to an image only while all of these hold: -- the consumer MachineImage exists and matches its publication record; +- the publication record for the current consumer project, consumer + MachineImage, and provider MachineImage incarnations exists, and its names + match them; - the provider MachineImage is in the provider project that holds the - Machine's allocation, and its UID and digest match the record; and + Machine's allocation, and its digest matches the record; and - the provider MachineImage is `Available`. The caller also needs `machineimages.use` on both the consumer and provider @@ -291,7 +296,7 @@ reasons: | Reason | Refused by | | --- | --- | | `ImageNotFound` | No MachineImage of that name in the namespace | -| `ImageNotEntitled` | Publication record, provider project, UID, digest, or `machineimages.use` | +| `ImageNotEntitled` | Publication record, provider project, a recreated image, digest, or `machineimages.use` | | `ImageWithdrawn` | The provider image is `Withdrawn` | | `ImageIncompatible` | Architecture, firmware mode, or bootstrap format | | `BootstrapNotFound` | No readable bootstrap Secret of that name | @@ -449,6 +454,8 @@ These tests are required and not implemented: - The provider deletes and recreates a MachineImage with other artifacts under the same name. An admitted install keeps the first digest, and a new install is refused until the image is published again. +- A consumer project or its MachineImage is deleted and recreated under the + same name, and the old publication record entitles neither. - An image's architecture or firmware mode does not match the server, and admission or the worker refuses it before anything is sent. - The customer edits the bootstrap Secret after admission, and the install uses From e94462c17e1aaba82aec18c15a979e4905a7f03c Mon Sep 17 00:00:00 2001 From: Scot Wells Date: Wed, 25 Nov 2026 16:12:32 -0600 Subject: [PATCH 09/14] docs: Define the identities a publication name pins Co-Authored-By: Claude Opus 5.5 --- docs/enhancements/machine-images/README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/enhancements/machine-images/README.md b/docs/enhancements/machine-images/README.md index f25f79bf..de2475e6 100644 --- a/docs/enhancements/machine-images/README.md +++ b/docs/enhancements/machine-images/README.md @@ -238,9 +238,10 @@ The provider's publisher creates a consumer project's MachineImage, as it does for MachineClass. Fleet records each publication in a protected record in the provider project. The record names the consumer MachineImage and the provider MachineImage, and holds the provider image's digest. Its name derives from the -consumer project, the consumer MachineImage, and the provider MachineImage -incarnations, so its spec holds no object UID. Publishing a recreated image -again writes a new record; a record never changes. +identities of the consumer project, the consumer MachineImage, and the +provider MachineImage. Each identity is new each time the object is created, so +a record matches only the objects it was written for. Publishing a recreated +image again writes a new record; a record never changes. Customers cannot write MachineImages. IAM gives customer roles no write permission on the kind, and a Fleet validating webhook, called from Milo's root @@ -252,9 +253,9 @@ API server, rejects: A project is entitled to an image only while all of these hold: -- the publication record for the current consumer project, consumer - MachineImage, and provider MachineImage incarnations exists, and its names - match them; +- Fleet finds the publication record under the name derived from the current + consumer project, consumer MachineImage, and provider MachineImage, and the + names it records match those images; - the provider MachineImage is in the provider project that holds the Machine's allocation, and its digest matches the record; and - the provider MachineImage is `Available`. From d913fb4cd0bfb0f40c5830a6052fd28d6ecb059a Mon Sep 17 00:00:00 2001 From: Scot Wells Date: Wed, 25 Nov 2026 16:16:12 -0600 Subject: [PATCH 10/14] docs: Keep a lab first-boot report beside installer verification Co-Authored-By: Claude Opus 5.5 --- docs/enhancements/machine-images/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/enhancements/machine-images/README.md b/docs/enhancements/machine-images/README.md index de2475e6..b330e92f 100644 --- a/docs/enhancements/machine-images/README.md +++ b/docs/enhancements/machine-images/README.md @@ -446,6 +446,10 @@ These tests are required and not implemented: - A customer installs a published image, and the installer verifies exactly its user data and SSH keys on the target disk before the install succeeds. + In the lab, the booted guest also reports on first boot that it found the + same data where its bootstrap format reads it. That report is lab evidence, + not a condition of success. It does not prove that a production image's + bootstrap agent consumed the data; qualifying the production OS must. - The installer reads back a wrong or truncated payload, and the install fails without reporting `Succeeded`. - A customer names an image that is not published to their project, or writes From d63a9fc5c2f91ff5736ca3d564681fe9942b7ca9 Mon Sep 17 00:00:00 2001 From: Scot Wells Date: Wed, 25 Nov 2026 16:46:51 -0600 Subject: [PATCH 11/14] docs: Name image tenants with typed references A published MachineImage names its publisher with publisherRef, and a publication record names its consumer with consumerRef. Both are typed Milo Project or standalone Namespace references, and Fleet refuses any other kind. Co-Authored-By: Claude Opus 5.5 --- docs/enhancements/machine-images/README.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/docs/enhancements/machine-images/README.md b/docs/enhancements/machine-images/README.md index b330e92f..394d21e8 100644 --- a/docs/enhancements/machine-images/README.md +++ b/docs/enhancements/machine-images/README.md @@ -151,8 +151,7 @@ every file the installer writes or boots. #### MachineImage in a consumer project Publication creates a MachineImage in the consumer project that names its -provider source, the same way a [MachineClass](../machine-lifecycle/README.md#machineclass) -does: +publisher and the image there: ```yaml apiVersion: metal.datumapis.com/v1alpha1 @@ -161,7 +160,9 @@ metadata: name: example-linux-1-2 namespace: default spec: - source: {project: example-provider, name: example-linux-1-2} # immutable + source: # immutable + publisherRef: {apiGroup: resourcemanager.miloapis.com, kind: Project, name: example-provider} + name: example-linux-1-2 status: resolved: family: example-linux @@ -177,6 +178,10 @@ status: A MachineImage has exactly one of `definition` or `source`. Status is for display; admission reads the [publication record](#publication-and-entitlement). +`publisherRef`, and the publication record's `consumerRef`, are typed tenant +references that hold names only. A tenant is a Milo Project, or a Namespace in +standalone mode. Fleet refuses any other kind. + #### Bootstrap Secret The customer stores bootstrap data in a Secret of type @@ -236,8 +241,9 @@ and digest. It carries no consumer project name and no bootstrap bytes. The provider's publisher creates a consumer project's MachineImage, as it does for MachineClass. Fleet records each publication in a protected record in the -provider project. The record names the consumer MachineImage and the provider -MachineImage, and holds the provider image's digest. Its name derives from the +provider project. The record references the consumer tenant with +`consumerRef`, names the consumer MachineImage and the provider MachineImage, +and holds the provider image's digest. Its name derives from the identities of the consumer project, the consumer MachineImage, and the provider MachineImage. Each identity is new each time the object is created, so a record matches only the objects it was written for. Publishing a recreated From 1274f7719b2b08e5e33307a983a3e717ec305e12 Mon Sep 17 00:00:00 2001 From: Scot Wells Date: Thu, 26 Nov 2026 15:59:59 -0600 Subject: [PATCH 12/14] docs: Allow a first-boot report for virtual media Success still never depends on the installed OS, except under virtual media delivery proposed in #227. There, success also depends on one first-boot report from the provider-built image's first-boot step, which runs before the customer's bootstrap data and is accepted once. Co-Authored-By: Claude Opus 5.5 --- docs/enhancements/machine-images/README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/enhancements/machine-images/README.md b/docs/enhancements/machine-images/README.md index 394d21e8..236cf469 100644 --- a/docs/enhancements/machine-images/README.md +++ b/docs/enhancements/machine-images/README.md @@ -427,7 +427,11 @@ reads it on first boot. The payload also carries the salt and the admitted data, so the installer reads them back from the target disk, recomputes the salted digest, and reports it. The worker reports success only when that digest matches the operation's digest. Success never depends on what the -installed OS does or prints, because Fleet does not own the guest. The boot +installed OS does or prints, because Fleet does not own the guest. The one +exception is virtual media delivery, proposed in [#227][boot-delivery-pr]. +There, success also depends on one first-boot report from the provider-built +image's first-boot step, which runs before the customer's bootstrap data. Fleet +accepts that report once and trusts nothing the guest does after it. The boot service drops its copy when the admission closes. The site deletes every copy it made when the operation ends or a higher fence @@ -532,4 +536,5 @@ boot service, and an artifact registry. The local VM and Redfish lab modes can prove the install path without hardware. [pxe-pr]: https://github.com/datum-cloud/fleet/pull/59 +[boot-delivery-pr]: https://github.com/datum-cloud/fleet/pull/227 [milo-policybinding]: https://github.com/milo-os/milo/blob/cd469ff4235c0847d9863a132bdb58f3ff8d3845/pkg/apis/iam/v1alpha1/policybinding_types.go From 7dddb59730ec5b5c1a1a9614ae8e500dab35ce9c Mon Sep 17 00:00:00 2001 From: Scot Wells Date: Fri, 27 Nov 2026 20:20:33 -0600 Subject: [PATCH 13/14] docs: Make image admission final and boot central Check for an existing DeviceInstallation first, so re-evaluation after a crash never refuses an install that is already running. Delete a sealed payload whose operation was never created 10 minutes after it was written, and never create the operation later than that. Run the boot service centrally with a certificate and authorization per site, and let the first-boot service read a payload only for one virtual media fallback fetch. Co-Authored-By: Claude Opus 5.5 --- docs/enhancements/machine-images/README.md | 64 +++++++++++++++------- 1 file changed, 45 insertions(+), 19 deletions(-) diff --git a/docs/enhancements/machine-images/README.md b/docs/enhancements/machine-images/README.md index 236cf469..d01e60db 100644 --- a/docs/enhancements/machine-images/README.md +++ b/docs/enhancements/machine-images/README.md @@ -99,9 +99,12 @@ it as for any [Device operation](../device-operations/README.md#admission). This enhancement changes two parts of [Device custody](../device-operations/README.md): -- **[Customer data](../device-operations/README.md#customer-data):** the - site's boot service can also read a payload, only while that operation's - boot is open. The site controller that creates every worker can also get a +- **[Customer data](../device-operations/README.md#customer-data):** two + more identities can read a payload. The boot service, which runs centrally + with a separate identity for each site, can read one only while that + operation's boot is open. The first-boot service can read one only in the + virtual media fallback mode of [#227][boot-delivery-pr]. See [Sealed + bootstrap store](#sealed-bootstrap-store) for how each is scoped. The site controller that creates every worker can also get a site payload by name, with no list, watch, or write; it grants no new access, because that controller can already run a worker as any operation's identity. See [Site delivery](#site-delivery). @@ -277,18 +280,19 @@ Installation. The Fleet provider admits an Installation in this order. Each step must pass before the next one runs: -1. The Machine has an active allocation, and the predecessor check passes. -2. The image is entitled and the caller may use it. Fleet takes the digest from +1. If a DeviceInstallation already exists for this Installation, Fleet stops + here: the install is admitted, and no later step judges it again. +2. The Machine has an active allocation, and the predecessor check passes. +3. The image is entitled and the caller may use it. Fleet takes the digest from the publication record. -3. The image matches the allocation's hardware: +4. The image matches the allocation's hardware: - its architecture equals the CPU architecture; - it lists the server's firmware mode; and - if the Installation has bootstrap data, it lists a bootstrap format. -4. If a DeviceInstallation already exists for this Installation, Fleet stops - here: the install is admitted. 5. The caller can read the bootstrap Secret, and its contents are valid. 6. The sealed copy is written. See [Retention and crash recovery](#retention-and-crash-recovery). -7. The DeviceInstallation is created. +7. The DeviceInstallation is created, within 10 minutes of the sealed write. + Past that, Fleet writes a new sealed copy first. The allocation's hardware snapshot would gain the server's firmware mode. This field is proposed, and its source is an [open @@ -372,8 +376,13 @@ operation name and the digest. | --- | --- | | Fleet provider for Metal | `create` only | | Fleet coordinator, which includes the federation courier | `get`, `list`, `watch`, `delete` | +| Boot service, under one site's identity | `get` by name, only for an operation of that site whose boot admission is open | +| First-boot service | `get` by name, only for a virtual media operation in fallback mode, only while its first-boot phase is open, and only after a fetch presents that operation's single-use token from the Machine's IPAM address | | Every staff role | Nothing | +Neither service can list, watch, or write payloads. The first-boot service +reads the payload once, to answer that one fetch, and keeps no copy. + The provider never reads a payload back. Production must encrypt this kind at rest, and the audit policy must omit request and response bodies for it. @@ -390,10 +399,14 @@ when one of these holds: - its operation has ended as `Succeeded`, `Failed`, `Cancelled`, or `OutcomeUnknown`; - its operation exists and references another payload; or -- no operation has its name, and its allocation is no longer `Active`. - -An allocation that is not `Active` cannot admit an install, so the last rule -never removes a payload that admission still needs. Fleet does not retry an +- no operation has its name, and its allocation is no longer `Active`; or +- no operation has its name 10 minutes after the payload was written. + +An allocation that is not `Active` cannot admit an install, and Fleet never +creates an operation more than 10 minutes after its sealed write, so neither +rule removes a payload that admission still needs. If a payload is gone +anyway, the coordinator refuses the operation with `BootstrapUnavailable`, and +nothing is sent. Fleet does not retry an install: a [held installation](../device-operations/README.md#unknown-outcomes) is settled by a later DeviceInstallation from a new Installation, which reads the Secret again. @@ -419,10 +432,13 @@ boot once: - it closes when the installer finishes, when its 10-minute window ends, or when a higher fence stops the worker. -While the admission is open, the boot service serves the rendered payload to -requests that carry the token, so a firmware retry within the window works. -Production serves it over HTTPS with a site-issued certificate that the -installer trusts. The installer writes it where the image's bootstrap format +The boot service runs centrally, beside the central DHCP service, and no boot +service runs at the site. It serves each site under a separate identity, with +a certificate issued for that site and authorization for that site's +operations only. While the admission is open, the boot service serves the +rendered payload to requests that carry the token, so a firmware retry within +the window works. Production serves it over HTTPS with the site's certificate, +which the installer trusts. The installer writes it where the image's bootstrap format reads it on first boot. The payload also carries the salt and the admitted data, so the installer reads them back from the target disk, recomputes the salted digest, and reports it. The worker reports success only when that @@ -478,6 +494,16 @@ These tests are required and not implemented: - The provider crashes between the sealed write and the operation, then retries. One operation exists, and the unused payload is deleted. +- The provider crashes after creating the DeviceInstallation, and the image is + withdrawn before it restarts. Re-evaluation stops at the first step, and the + running install is never refused. +- A payload is written, and its Installation is deleted before the operation + is created. The payload is deleted 10 minutes after it was written, while + the allocation is still `Active`. +- A boot service identity for one site cannot read a payload or serve a boot + admission for another site's operation. +- The first-boot service cannot read a payload without a matching fetch + token from the Machine's IPAM address, or after the first-boot phase ends. - No staff role can get, list, or watch a SealedPayload, and no site identity other than the operation's worker and the site controller that creates workers can read its delivered payload. @@ -531,8 +557,8 @@ one SealedPayload write and one delete. ## Infrastructure needed -Testing needs one provider project, two consumer projects, one site with a -boot service, and an artifact registry. The local VM and Redfish lab modes can +Testing needs one provider project, two consumer projects, one site, a +central boot service, and an artifact registry. The local VM and Redfish lab modes can prove the install path without hardware. [pxe-pr]: https://github.com/datum-cloud/fleet/pull/59 From 449e143024e1da5db2b044c44b3ef3c4bb9e9fa6 Mon Sep 17 00:00:00 2001 From: Scot Wells Date: Fri, 27 Nov 2026 20:23:09 -0600 Subject: [PATCH 14/14] docs: Hand rendered payloads to the central boot The site worker still receives and checks the sealed payload, then sends the boot admission and the rendered payload to the central boot service under its site's identity. The boot service holds them in memory for an open admission of its own site only and has no access to the sealed store. The no-copy and site-identity tests now cover it. Co-Authored-By: Claude Opus 5.5 --- docs/enhancements/machine-images/README.md | 59 ++++++++++++---------- 1 file changed, 33 insertions(+), 26 deletions(-) diff --git a/docs/enhancements/machine-images/README.md b/docs/enhancements/machine-images/README.md index d01e60db..52142432 100644 --- a/docs/enhancements/machine-images/README.md +++ b/docs/enhancements/machine-images/README.md @@ -99,15 +99,16 @@ it as for any [Device operation](../device-operations/README.md#admission). This enhancement changes two parts of [Device custody](../device-operations/README.md): -- **[Customer data](../device-operations/README.md#customer-data):** two - more identities can read a payload. The boot service, which runs centrally - with a separate identity for each site, can read one only while that - operation's boot is open. The first-boot service can read one only in the - virtual media fallback mode of [#227][boot-delivery-pr]. See [Sealed - bootstrap store](#sealed-bootstrap-store) for how each is scoped. The site controller that creates every worker can also get a - site payload by name, with no list, watch, or write; it grants no new - access, because that controller can already run a worker as any operation's - identity. See [Site delivery](#site-delivery). +- **[Customer data](../device-operations/README.md#customer-data):** the + boot service, which runs centrally with a separate identity for each site, + holds a rendered payload only while that operation's boot is open. It never + reads the sealed store. The first-boot service can read a sealed payload + only in the virtual media fallback mode of [#227][boot-delivery-pr], scoped + as [Sealed bootstrap store](#sealed-bootstrap-store) describes. The site + controller that creates every worker can also get a site payload by name, + with no list, watch, or write; it grants no new access, because that + controller can already run a worker as any operation's identity. See [Site + delivery](#site-delivery). - **[Admission](../device-operations/README.md#admission):** DeviceInstallation adds one check of its own inputs. @@ -376,12 +377,12 @@ operation name and the digest. | --- | --- | | Fleet provider for Metal | `create` only | | Fleet coordinator, which includes the federation courier | `get`, `list`, `watch`, `delete` | -| Boot service, under one site's identity | `get` by name, only for an operation of that site whose boot admission is open | | First-boot service | `get` by name, only for a virtual media operation in fallback mode, only while its first-boot phase is open, and only after a fetch presents that operation's single-use token from the Machine's IPAM address | | Every staff role | Nothing | -Neither service can list, watch, or write payloads. The first-boot service -reads the payload once, to answer that one fetch, and keeps no copy. +The first-boot service cannot list, watch, or write payloads. It reads the +payload once, to answer that one fetch, and keeps no copy. The boot service has +no access to SealedPayload. The provider never reads a payload back. Production must encrypt this kind at rest, and the audit policy must omit request and response bodies for it. @@ -398,7 +399,7 @@ when one of these holds: - its operation has ended as `Succeeded`, `Failed`, `Cancelled`, or `OutcomeUnknown`; -- its operation exists and references another payload; or +- its operation exists and references another payload; - no operation has its name, and its allocation is no longer `Active`; or - no operation has its name 10 minutes after the payload was written. @@ -423,22 +424,27 @@ payloads. The worker checks the payload against the operation's digest, and refuses with `InputMismatch` before it sends anything if they differ. It renders the payload in the image's bootstrap format and attaches it to the operation's boot -admission. A boot admission is the site record that lets one server network -boot once: +admission. A boot admission is the record that lets one server network boot +once: - it names the operation, the fence, and the boot interface's MAC address; - it carries a random 256-bit token, which appears only in the boot script the - site serves to that MAC address; + boot service serves to that MAC address; - it closes when the installer finishes, when its 10-minute window ends, or when a higher fence stops the worker. The boot service runs centrally, beside the central DHCP service, and no boot service runs at the site. It serves each site under a separate identity, with a certificate issued for that site and authorization for that site's -operations only. While the admission is open, the boot service serves the -rendered payload to requests that carry the token, so a firmware retry within -the window works. Production serves it over HTTPS with the site's certificate, -which the installer trusts. The installer writes it where the image's bootstrap format +operations only. The worker sends the boot admission, with the rendered +payload, to the boot service under its site's identity. The boot service +holds them in memory and accepts an admission only for an operation of that +site at the Device's stored fence. + +While the admission is open, the boot service serves the rendered payload to +requests that carry the token, so a firmware retry within the window works. +Production serves it over HTTPS with the site's certificate, which the +installer trusts. The installer writes it where the image's bootstrap format reads it on first boot. The payload also carries the salt and the admitted data, so the installer reads them back from the target disk, recomputes the salted digest, and reports it. The worker reports success only when that @@ -500,15 +506,16 @@ These tests are required and not implemented: - A payload is written, and its Installation is deleted before the operation is created. The payload is deleted 10 minutes after it was written, while the allocation is still `Active`. -- A boot service identity for one site cannot read a payload or serve a boot - admission for another site's operation. +- A boot service identity for one site cannot accept or serve a boot + admission for another site's operation, and cannot read SealedPayload. - The first-boot service cannot read a payload without a matching fetch token from the Machine's IPAM address, or after the first-boot phase ends. - No staff role can get, list, or watch a SealedPayload, and no site identity other than the operation's worker and the site controller that creates - workers can read its delivered payload. + workers can read its delivered payload. The boot service holds only the + rendered copy for an open admission of its own site. - After the operation ends, no copy of the payload remains in the provider - project, the federation layer, or the site. + project, the federation layer, the site, or the boot service. ## Production readiness review questionnaire @@ -557,8 +564,8 @@ one SealedPayload write and one delete. ## Infrastructure needed -Testing needs one provider project, two consumer projects, one site, a -central boot service, and an artifact registry. The local VM and Redfish lab modes can +Testing needs one provider project, two consumer projects, one site, a central +boot service, and an artifact registry. The local VM and Redfish lab modes can prove the install path without hardware. [pxe-pr]: https://github.com/datum-cloud/fleet/pull/59