sonic-buildimage/scripts
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
..
j2cli [dockers] label SONiC Docker with manifest (#5939) 2021-04-26 13:51:50 -07:00
build_debian_base_system.sh [Build] Support to use the snapshot mirror for debian base image (#14474) (#14562) 2023-04-07 15:38:03 +08:00
build_kvm_image.sh [Build] Fix the build unstalbe issue caused by the kvm not ready (#12180) 2022-09-27 06:55:19 +08:00
build_mirror_config.sh [Build] Change the default mirror version config file (#13786) 2023-02-15 00:44:47 +08:00
collect_build_version_files.sh 02.Version cache - docker cache build framework (#12001) 2023-02-11 06:33:57 +08:00
collect_docker_version_files.sh 02.Version cache - docker cache build framework (#12001) 2023-02-11 06:33:57 +08:00
collect_host_image_version_files.sh 02.Version cache - docker cache build framework (#12001) 2023-02-11 06:33:57 +08:00
convert-pfx-cert-format.sh Simplify the function to covert pfx certificate (#5086) 2020-08-01 20:07:20 +08:00
dbg_files.sh Create the src archive in target/ when INSTALL_DEBUG_TOOLS=y (#3323) 2019-08-28 09:29:48 -07:00
docker_version_control.sh [build] Fix issues found in reproducible build. (#10407) 2022-03-31 13:07:46 +08:00
efi-sign.sh [Secure Boot] Add Secure Boot Support (#12692) (#14963) 2023-05-15 10:13:26 +08:00
generate_buildinfo_config.sh [Build][202211] Support Debian snapshot mirror to improve build stability (#13371) 2023-01-16 20:35:17 +08:00
prepare_debian_image_buildinfo.sh Recover "Support SONiC Reproduceable Build-debian/pip/web packages (#6255) 2020-12-21 15:31:10 +08:00
prepare_docker_buildinfo.sh [Build] Optimize the version control for Debian packages (#14557) (#14610) 2023-04-12 15:00:48 +08:00
prepare_slave_container_buildinfo.sh [build][Bug]: Fix the command set_reproducible_mirrors not found issue (#10398) 2022-03-31 12:37:53 +08:00
process_log.sh [build]: add SONIC_CONFIG_BUILD_LOG_TIMESTAMP to add timestamp in build log (#4269) 2020-03-21 14:21:26 -07:00
run_with_retry [build] Add retry when make SONiC image to improve success rate. (#12325) 2022-12-21 16:36:18 +08:00
secure_boot_signature_verification.sh [Secure Boot] Add Secure Boot Support (#12692) (#14963) 2023-05-15 10:13:26 +08:00
sign_image.sh [Secure Boot] Support to sign swi image (#4627) 2020-06-09 15:25:17 +08:00
signing_kernel_modules.sh [Secure Boot] Add Secure Boot Support (#12692) (#14963) 2023-05-15 10:13:26 +08:00
signing_secure_boot_dev.sh [Secure Boot] Add Secure Boot Support (#12692) (#14963) 2023-05-15 10:13:26 +08:00
versions_manager.py [Build][202211] Support Debian snapshot mirror to improve build stability (#13371) 2023-01-16 20:35:17 +08:00
wait_for_docker.sh [build]: wait up to 60 seconds for docker engine to start (#3067) 2019-06-22 14:40:05 -07:00