sonic-buildimage/files
DavidZagury 4fd2a6297f
[Secure Boot] Add Secure Boot Support (#12692) (#14963)
- Why I did it
Add Secure Boot support to SONiC OS.
Secure Boot (SB) is a verification mechanism for ensuring that code launched by a computer's UEFI firmware is trusted. It is designed to protect a system against malicious code being loaded and executed early in the boot process before the operating system has been loaded.

- How I did it
Added a signing process to sign the following components:
shim, grub, Linux kernel, and kernel modules when doing the build, and when feature is enabled in build time according to the HLD explanations (the feature is disabled by default).

- How to verify it
There are self-verifications of each boot component when building the image, in addition, there is an existing end-to-end test in sonic-mgmt repo that checks that the boot succeeds when loading a secure system (details below).

How to build a sonic image with secure boot feature: (more description in HLD)

Required to use the following build flags from rules/config:
SECURE_UPGRADE_MODE="dev"
SECURE_UPGRADE_DEV_SIGNING_KEY="/path/to/private/key.pem"
SECURE_UPGRADE_DEV_SIGNING_CERT="/path/to/cert/key.pem"
After setting those flags should build the sonic-buildimage.
Before installing the image, should prepared the setup (switch device) with the follow:
check that the device support UEFI
stored pub keys in UEFI DB

enabled Secure Boot flag in UEFI
How to run a test that verify the Secure Boot flow:
The existing test "test_upgrade_path" under "sonic-mgmt/tests/upgrade_path/test_upgrade_path", is enough to validate proper boot
You need to specify the following arguments:
Base_image_list your_secure_image
Taget_image_list your_second_secure_image
Upgrade_type cold
And run the test, basically the test will install the base image given in the parameter and then upgrade to target image by doing cold reboot and validates all the services are up and working correctly

Co-authored-by: davidpil2002 <91657985+davidpil2002@users.noreply.github.com>
2023-05-15 10:13:26 +08:00
..
Aboot [Arista] Disable SSD NCQ on Lodoga (#13964) 2023-03-08 13:50:25 +08:00
apt [Build] set apt Acquire::Retries to 3 for bullseye (#12758) 2022-12-10 10:33:21 +08:00
build/versions [ci/build]: Upgrade SONiC package versions (#14894) 2023-04-30 18:37:57 +08:00
build_scripts During build time mask only those feature/services that are disabled excplicitly (#13283) (#13651) 2023-02-13 01:15:26 +08:00
build_templates [Secure Boot] Add Secure Boot Support (#12692) (#14963) 2023-05-15 10:13:26 +08:00
dhcp ZTP infrastructure changes to support DHCP discovery provisioning data (#3298) 2019-12-10 08:16:56 -08:00
docker [dockerd] Force usage of cgo DNS resolver (#13649) 2023-02-22 20:55:46 +08:00
image_config Revert "Clear DNS configuration received from DHCP during networking reconfiguration in Linux. (#13516)" (#14901) 2023-05-01 16:49:08 -07:00
initramfs-tools [Arista] Add initial support for 720DT-48S (#10656) 2022-06-29 09:56:24 -07:00
scripts [write standby] force DB connections to use unix socket to connect (#14524) (#14773) 2023-04-24 01:49:42 +08:00
sshd Remove SSH host keys after installing the custom version of sshd (#10633) 2022-04-25 10:38:52 -07:00