Skip to main content

Reference values

Every layer of your deployment, measured.

How each attestation value is computed, and the values Phala Cloud publishes for checking it. To check a running CVM against them, open Verify Attestation from the CVM’s page in the console.

How is an attestation value computed?

Each time a CVM boots, the CPU signs a quote. It carries five measurements, MRTD and RTMR0 to RTMR3, and one field the launcher sets, MR_CONFIG_ID. Each covers a different part of the machine.

RTMR0 to RTMR3 are running hashes. Each starts as zeros, and every step replaces it:

new value = SHA-384(old value ‖ measurement)

So the order matters, and nothing can be undone. MRTD is computed once, over the firmware as it is loaded. The example machine follows dstack 0.6 and replays every value. Below, click any label to see what it is and the values Phala Cloud publishes for it.

What is a CVM made of?

Four layers. Each feeds different values, and keeps its color across this page.

  • OS imageReleased by the dstack open-source project, maintained by Phala. You pick the version.
  • HardwareThe machine under the CVM, and its size.
  • Instance typeYours: vCPUs, memory, GPUs.
  • DeviceThe physical machine. Phala Cloud’s; named in the quote.
  • App composeOne file, three parts. Its SHA-256 is the compose hash.
  • Docker composeYours. Only you write it.
  • Pre-launch scriptPhala Cloud’s default, latest version. You can replace it.
  • Init scriptsPhala Cloud’s scripts. You pick which to use. Their order is fixed, and you cannot change them.
  • KMSReleases the keys after checking the quote.

Measured by the CPU, before the machine starts

MRTD: the boot firmware

A hash of the boot firmware and nothing else. It cannot change after the machine starts.

Measuring the example…

MRTD

Changes when: New firmware in an OS image, or a host QEMU upgrade. Most image upgrades keep the same firmware.

Extended by the firmware, early in boot

RTMR0: the hardware

The machine’s shape. Two machines of the same instance type get the same RTMR0 when the firmware, the QEMU version and the host’s settings are the same.

Measuring the example…

RTMR0

Changes when: A different instance type, a host QEMU upgrade or different host settings, new firmware in an OS image, or a change to the app compose’s verity volumes.

Extended by the firmware, as it starts the kernel

RTMR1: the kernel

Starts with a hash of the kernel file. The rest are fixed markers, so only a kernel change moves it.

Measuring the example…

RTMR1

Changes when: An OS image upgrade that rebuilds the kernel.

Extended by the firmware, as it starts the kernel

RTMR2: the command line and initrd

The kernel command line and the initrd. The command line carries the root filesystem’s hash, so a root filesystem change lands here too.

Measuring the example…

RTMR2

Changes when: Every OS image upgrade.

Extended by the guest OS, once per boot event

RTMR3: your app and how it booted

The only value the guest OS writes: one event at a time, in this order. The event log ships with the attestation report, so anyone can replay it.

Measuring the example…

RTMR3

Changes when: Any change to the app compose, the OS image, the KMS or the instance. On a GPU machine it also changes on every boot.

Written by the launcher, before the machine starts

MR_CONFIG_ID: the app, fixed before boot

Binds the app before it boots. The launcher writes a short document that names the app, and MR_CONFIG_ID is its hash. RTMR3 then records what the guest actually loaded, and the guest stops booting if the two disagree.

Measuring the example…

MR_CONFIG_ID

Changes when: Any change to the app compose, the pinned KMS or the instance, and moving to or from a GPU. Not an OS image upgrade within dstack 0.6. An app compose that does not pin a key provider ID gets the older form: a version byte and the compose hash itself. A host that does not set MR_CONFIG_ID leaves it all zeros.

Read from the quote, not measured

Device ID and TCB status

The six values describe the CVM. The quote also says which physical machine it runs on, and whether that machine’s firmware is current. A KMS checks both before it releases keys.

Checked by the KMS

Changes when: The CVM moves to another machine, or the vendor publishes new firmware and the machine’s status drops until it is updated.

What changes when you change something?

Run it on the example. The values that moved are marked.

Pick an operation to see which values it changes.

OS image
Hardware
App compose
Docker compose · yours
Pre-launch script · Phala Cloud’sDefault
Key provider ID · pins the KMS
Init scripts · pick any; run order is fixed
KMS

Change an input to see which values move.

A new OS image version is out. What do I update?

  1. Copy the new hash from OS images. A version is listed as soon as it is built.
  2. Recompute RTMR1 and RTMR2 from the new image with dstack-mr.
  3. Replay your event log with the new os-image-hash event to get RTMR3.

How do I check the values of my own machine?

MRTD and RTMR0 to RTMR2: compute them from the image with the open-source dstack-mr tool, for your vCPU count and memory size, and compare. The host’s QEMU version and settings feed these values too. A GPU machine needs more flags, such as --num-gpus, --hugepages and --pci-hole64-size; see dstack-mr measure --help.

dstack-mr measure <image>/metadata.json --cpu <N> --memory <M>

RTMR3: replay the event log from the attestation report with the formula above, as the example does. The example uses the default event log format; an app compose can opt into version 2, which hashes a JSON form of each event. Also check the quote’s signature, the platform’s TCB status, and that debug mode is off.

dstack repository