Skip to content

SONiC bootloader signing for UEFI secureboot#12901

Closed
sacnaik wants to merge 1 commit intosonic-net:masterfrom
sacnaik:secure_bootloader
Closed

SONiC bootloader signing for UEFI secureboot#12901
sacnaik wants to merge 1 commit intosonic-net:masterfrom
sacnaik:secure_bootloader

Conversation

@sacnaik
Copy link
Copy Markdown
Contributor

@sacnaik sacnaik commented Nov 30, 2022

SONiC bootloader signing for UEFI secureboot

Signed-off-by: Sachin Naik [email protected]

Why I did it

This enables build framework to sign EFI bootloader images such as Grubx64.efi and Shimx64.efi.
These signed bootloader gets verified on secure boot enabled system. The systems secure boot chain
of trust ensures that it runs only verifiable boot loaders.

The secure boot chain of trust verifies images as below
UEFI FW -> SHIM -> GRUB -> Linux Kernel

Currently the UEFI signing is supported at Linux kernel.
This fix fills gap of signing and verification path between UEFI FW and Linux kernel.

How I did it

1. Added Debian GRUB2 & SHIM source package to the SONiC build system.
2. Added signing hook in build_debian.sh for signing GRUB2 and SHIM efi image.
3. Defined build configurable hook in rules/config, for secure boot configuration.
4. By default signing hook uses sbsign-tool for signing these EFI images.
5. Added framework to configure build system to integrate SONiC vendor's specific signing tools.
6. Added installer.sh to install signed SHIM and GRUB in EFI system partition.

How to verify it

Build SONiC image with UEFI secure boot enable which produces signed SHIM, GRUB and Linux Kernel images
Load them on UEFI secure boot enabled system. The necessary verification keys should be enrolled in the system for secure boot image verification.

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205

Description for the changelog

Mechanism in SONiC build systems to produce signed EFI images.

Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU.

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

    Why I did it

    This enables build framework to sign EFI bootloader images such as Grubx64.efi and Shimx64.efi.
    These signed bootloader gets verified on secure boot enabled system. The systems secure boot chain
    of trust ensures that it runs only verifiable boot loaders.

    The secure boot chain of trust verifies images as below
    UEFI FW -> SHIM -> GRUB -> Linux Kernel

    Currently the UEFI signing is supported at Linux kernel.
    This fix fills gap of signing and verification path between UEFI FW and Linux kernel.

    How I did it

    1. Added debian GRUB2 & SHIM source package to the SONiC build system.
    2. Added signing hook in build_debian.sh for signing GRUB2 and SHIM efi image.
    3. Defined build configurable hook in rules/config, for secure boot configuration.
    4. By default signing hook uses sbsign-tool for signing these EFI images.
    5. Added framework to configure build system to integrate SONiC vendor's specific signing tools.
    6. Added installer.sh to install signed SHIM and GRUB in EFI system partition.

    How to verify it
    Boot the signed images on UEFI secureboot enabled system.

Signed-off-by: Sachin Naik <[email protected]>
@linux-foundation-easycla
Copy link
Copy Markdown

CLA Missing ID CLA Not Signed

@abdosi
Copy link
Copy Markdown
Contributor

abdosi commented Dec 1, 2022

@davidpil2002 for viz.

@sacnaik sacnaik mentioned this pull request Dec 16, 2022
9 tasks
@abdosi
Copy link
Copy Markdown
Contributor

abdosi commented Mar 6, 2023

@sacnaik please add comment and close this

@sacnaik
Copy link
Copy Markdown
Contributor Author

sacnaik commented Mar 6, 2023

A similar feature is added by #12692.
This PR is no more valid

@sacnaik sacnaik closed this Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants