sonic-buildimage/scripts
davidpil2002 8098bc4bf5
Add Secure Boot Support (#12692)
- 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
2023-03-14 14:55:22 +02:00
..
j2cli [dockers] label SONiC Docker with manifest (#5939) 2021-04-26 13:51:50 -07:00
build_debian_base_system.sh 05.Version cache - docker dpkg caching support (#12005) 2022-12-12 09:20:56 +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-14 14:59:38 +08:00
collect_build_version_files.sh 05.Version cache - docker dpkg caching support (#12005) 2022-12-12 09:20:56 +08:00
collect_docker_version_files.sh 05.Version cache - docker dpkg caching support (#12005) 2022-12-12 09:20:56 +08:00
collect_host_image_version_files.sh 05.Version cache - docker dpkg caching support (#12005) 2022-12-12 09:20:56 +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 Add Secure Boot Support (#12692) 2023-03-14 14:55:22 +02:00
generate_buildinfo_config.sh [Build] Support Debian snapshot mirror to improve build stability (#13097) 2023-01-13 16:16:35 +08:00
populate_file_web_server.py Add script to upload packages to web server (#13545) 2023-02-23 08:18:42 +02:00
prepare_debian_image_buildinfo.sh 05.Version cache - docker dpkg caching support (#12005) 2022-12-12 09:20:56 +08:00
prepare_docker_buildinfo.sh [Build] Support j2 template for debian sources for docker ptf (#13198) 2022-12-29 23:33:21 -08:00
prepare_slave_container_buildinfo.sh 05.Version cache - docker dpkg caching support (#12005) 2022-12-12 09:20:56 +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 Fix sonic-slave-* build errors about sudo command not found (#13412) 2023-01-31 12:35:17 +02:00
secure_boot_signature_verification.sh Add Secure Boot Support (#12692) 2023-03-14 14:55:22 +02:00
sign_image.sh [Secure Boot] Support to sign swi image (#4627) 2020-06-09 15:25:17 +08:00
signing_kernel_modules.sh Add Secure Boot Support (#12692) 2023-03-14 14:55:22 +02:00
signing_secure_boot_dev.sh Add Secure Boot Support (#12692) 2023-03-14 14:55:22 +02:00
versions_manager.py [Build] Support Debian snapshot mirror to improve build stability (#13097) 2023-01-13 16:16:35 +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