Skip to content

Verify the Secure Boot chain on real hardware (shim to signed iPXE to signed FOS kernel) #960

Description

@mastacontrola

Is your feature request related to a problem? Please describe.

#957 decided what FOG does about Secure Boot: nothing out of the box, opt-in and documented. The guide is merged at fog-docs secure-boot-signing.

What has not happened is anyone booting that chain on real hardware. Every individual link is upstream-supported and the artefacts have been inspected, but the end-to-end path is unproven and the guide says so in its Known limits. This issue tracks closing that gap.

Describe the solution you'd like

Boot a UEFI machine with Secure Boot on, through:

firmware  →  ipxe-shimx64.efi        (Microsoft UEFI CA 2011 + 2023, from ipxe/shim)
          →  ipxe.efi                (iPXE Secure Boot Intermediate G1A, extracted
                                      from ipxe-x86_64-sb.usb at EFI/BOOT/IPXE.EFI)
          →  autoexec.ipxe           (FOG's boot logic, served over TFTP)
          →  bzImage                 (signed locally, key enrolled via MOK)

and confirm it reaches the FOG menu and completes a deploy.

Specific things to check, because they are the parts most likely to be wrong:

  1. Where autoexec.ipxe has to live. iPXE's efi_autoexec_network() calls imgacquire() with a bare filename, which resolves against cwuri — the directory the .efi was loaded from, not the TFTP root. So a stock ipxe.efi sitting at /tftpboot/ipxe.efi looks for /tftpboot/autoexec.ipxe, which FOG does not currently create; FOG only ships /tftpboot/autoexec/autoexec.ipxe. Confirm what cwuri actually resolves to when the binary is reached via shim rather than directly — the shim is loaded first, and whether cwuri follows the shim's path or iPXE's is worth observing rather than assuming.
  2. Whether the installer should place autoexec.ipxe at the TFTP root, or whether the shim and ipxe.efi should live in their own subdirectory with a copy beside them. Falls out of (1).
  3. That MOK enrolment via mmx64.efi works from a PXE-booted shim, not just from an installed distro.
  4. HTTPS is expected to fail and should be confirmed as failing cleanly rather than mysteriously — stock ipxe.efi has no FOG CA compiled in. See Feature Request: Support for External Intermediate CA (e.g., Smallstep step-ca) #794.
  5. CONFIG_EFI_STUB=y on the FOS kernel — under Secure Boot the kernel is loaded by the firmware's loader, not iPXE's.

Additional context

Verified while filing this, so it does not need re-deriving:

Binary PE certificate table Signer
ipxe-shimx64.efi (ipxe/shim ipxe-16.1) 19232 bytes Microsoft UEFI CA 2011 and 2023
EFI/BOOT/BOOTX64.EFI (inside -sb.usb) 9728 bytes Microsoft UEFI CA 2011 only
EFI/BOOT/IPXE.EFI (inside -sb.usb) 8552 bytes iPXE Secure Boot Intermediate G1A
FOG's /tftpboot/ipxe.efi none
FOG's /tftpboot/autoexec/snponly.efi none

FOG's binaries are unsigned by construction (EMBED=ipxescript plus CERT=/TRUST=), which is why the stock upstream binary has to be used here.

Refs #957, #794, #959

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions