Repository navigation
feat(attest): PCRs 1 and 5 are judged by replaying the firmware event log; the partition table must hold the image's installed disk and nothing else, and the boot variables and loader.conf must be those of the VM's first verified boot - #352
Merged
Merged
Conversation
… log; the partition table must hold the image's installed disk and nothing else, and the boot variables and loader.conf must be those of the VM's first verified boot PCR 1 and 5 differ per VM and have no golden values, so the verifier replays their events from the firmware event log (and the initrd's os-separator from the userspace log) to the quoted values; every event is one a boot vm-manager starts has, bound to its data where the log carries it. The GPT must hold the partitions repart.sysinstall.d lays out (types, labels, attributes, counts). BootOrder, the Boot#### options and systemd-boot's loader.conf must be what the VM's first verified boot measured, which the record keeps (bootConfig). The ACPI and SMBIOS tables QEMU builds are replayed, not compared.
…ot vm-manager starts
…es and retypes the slot without re-reading the disk in use
…on from the boot's events, so it skips cleanly without the simulator
…ion, /boot being an automount
3 tasks done
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #316. PCRs 1 and 5 were quoted but not compared, so a change to the firmware's boot configuration or to the disk's partition table went unnoticed. The certified attestation key came in #351.
What changes
PCR 1 and 5 differ per VM, so no golden value can vouch for them. The verifier replays their events instead (
internal/attest/bootconfig.go): the firmware event log, then the initrd's os-separator from the userspace log, must reproduce the quoted PCR 1 and PCR 5. Every event must be one a boot vm-manager starts has, bound to its data where the log carries it. What the guest can change is judged:_empty), attributes and counts are checked. A test keeps these rules equal torepart.sysinstall.d. A partition that is added, retyped, relabelled or given another attribute (no-auto, say) fails the boot.loader.conf(PCR 5).BootOrder, theBoot####options and systemd-boot'sloader.confmust be what the VM's first verified boot measured. The VM's record keeps that measurement (get_vmbootConfig), and each quote shows what it measured (get_vm_attestation). Before that first boot, only vm-manager's installer wrote them. A VM recorded before this release takes the configuration of its next verified boot.ExitBootServices may be logged as failed before it succeeds: the kernel's EFI stub calls it again when the memory map changed in between.
Nothing is removed; no flag, value or consumer setting changes.
What ran
go test ./...andgolangci-lint(also with-tags e2e). The replay tests use the firmware and userspace logs of a first installed boot and its reboot.TestBootConfigAttestation: a reboot verifies against the recorded configuration. Three changes root makes are each refused at the next boot: a boot option's description changed through efivarfs, an empty B slot retyped withsfdisk, and an option added toloader.conf.hack/guest-image-golden.shwith this branch's container image records the golden values; its reference boot and its verify boot both judge PCR 1 and 5.agentlab vm-manager-testpasses.loader.conf, its next boot was refused:pcr 1 and 5: the boot configuration changed since the vm's first verified boot: loader.conf changed.