sonic-buildimage/files/build_templates
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
..
per_namespace [swss/syncd] remove dependency on interfaces-config.service (#13084) 2022-12-26 09:20:45 +02:00
share_image [hostcfgd] Configure service auto-restart in hostcfgd. (#5744) 2021-06-29 09:06:21 -07:00
arp_update_vars.j2 Enable ARP Update Script for Packet based chassis. (#11465) 2022-07-26 16:50:16 -07:00
backend_acl.j2 Add backend acl template (#11220) 2022-07-06 10:24:16 -07:00
buffers_config.j2 set cable length to 1m for backplane ports (#13572) 2023-02-10 19:01:49 -08:00
build_docker_cache.j2 02.Version cache - docker cache build framework (#12001) 2022-12-02 08:28:45 +08:00
cbf_config.j2 [CBF] Added configuration templates to generate configs for CBF (#8689) 2021-10-29 17:18:57 -07:00
config-chassisdb.service.j2 [ChassisDB]: bring up ChassisDB service (#5283) 2020-10-14 15:15:24 -07:00
config-setup.service.j2 Add support for platform topology configuration service (#12066) 2023-02-01 12:53:45 -08:00
database.service.j2 Multi-ASIC implementation (#3888) 2020-03-31 10:06:19 -07:00
dhcp_relay.service.j2 [hostcfgd] Configure service auto-restart in hostcfgd. (#5744) 2021-06-29 09:06:21 -07:00
docker_image_ctl.j2 [Chassis][multiasic] Fix the sonic-db-cli core files issue on multiasic platform after the c++ implementation of sonic-db-cli (#13207) 2023-02-21 11:23:22 -08:00
dockerd_regex.json Add Structured Events w/ YANG Models (#12270) 2022-10-09 20:23:31 -07:00
eventd.service.j2 Streaming structured events implementation (#11848) 2022-09-03 07:33:25 -07:00
events_info.json Add rsyslog plugin regex for select operation failure (#12659) 2022-11-13 21:41:33 -08:00
iccpd.service.j2 [services] introduce sonic.target (#5705) 2021-02-25 14:26:24 +02:00
init_cfg.json.j2 [Dual-ToR] add default value for ACL rule for mellanox platform (#13547) 2023-02-22 20:25:54 +02:00
kernel_regex.json Add Structured Events w/ YANG Models (#12270) 2022-10-09 20:23:31 -07:00
kube_cni.10-flannel.conflist First cut image update for kubernetes support. (#5421) 2020-12-22 08:01:33 -08:00
lldp.service.j2 Changes for LLDP docker to support multi-npu platforms (#4530) 2020-05-11 11:05:44 -07:00
lldp.timer.j2 [Fastboot] Delay LLDP service for better fastboot performance (#10568) 2022-04-28 10:35:14 +03:00
manifest.json.j2 [infra] Support syslog rate limit configuration (#12490) 2022-12-20 10:53:58 +02:00
mgmt-framework.service.j2 [services] kill container on stop in warm/fast mode (#10510) 2022-09-19 19:34:33 +03:00
mgmt-framework.timer Grouping delayed services under a target for config reload checks (#7846) 2021-06-21 11:55:02 -07:00
monit_regex.json Add events to host and create rsyslog_plugin deb pkg (#12059) 2022-09-21 09:20:53 -07:00
mux.service.j2 [mux] Exit to write standby state to active-active ports (#11821) 2022-08-31 13:10:22 -07:00
nat.service.j2 [hostcfgd] Configure service auto-restart in hostcfgd. (#5744) 2021-06-29 09:06:21 -07:00
organization_extensions.sh Framework to plugin Organization specific scripts during ONIE Image build (#951) 2017-09-19 16:23:31 -07:00
p4rt.service.j2 [PINS] Build P4RT container for PINS (#9083) 2021-12-07 11:11:25 -08:00
packages.json.j2 [sonic_debian_extension] fix packages.json generation and make the build fail when packages.json is not generated (#8044) 2021-07-09 12:29:33 -07:00
pde.service.j2 [PDE]: introduce the SONiC Platform Development Env (#7510) 2021-07-24 16:24:43 -07:00
pmon.service.j2 [Fastboot] Delay PMON service for better fastboot performance (#10567) 2022-05-02 10:44:17 +03:00
pmon.timer [Fastboot] Delay PMON service for better fastboot performance (#10567) 2022-05-02 10:44:17 +03:00
qos_config.j2 Apply separated DSCP_TO_TC_MAP and TC_TO_QUEUE_MAP to uplink ports on dualtor (#12730) 2022-11-21 11:42:28 -08:00
radv.service.j2 [hostcfgd] Configure service auto-restart in hostcfgd. (#5744) 2021-06-29 09:06:21 -07:00
restapi.service.j2 [hostcfgd] Configure service auto-restart in hostcfgd. (#5744) 2021-06-29 09:06:21 -07:00
rsyslog_plugin.conf.j2 Add events to host and create rsyslog_plugin deb pkg (#12059) 2022-09-21 09:20:53 -07:00
seu_regex.json Add Structured Events w/ YANG Models (#12270) 2022-10-09 20:23:31 -07:00
sflow.service.j2 [hostcfgd] Configure service auto-restart in hostcfgd. (#5744) 2021-06-29 09:06:21 -07:00
snmp.service.j2 [services] kill container on stop in warm/fast mode (#10510) 2022-09-19 19:34:33 +03:00
snmp.timer Grouping delayed services under a target for config reload checks (#7846) 2021-06-21 11:55:02 -07:00
sonic_debian_extension.j2 Add Secure Boot Support (#12692) 2023-03-14 14:55:22 +02:00
sonic_version.yml.j2 [Mellanox][asan] add address sanitizer support for syncd (#10266) 2022-04-14 15:00:32 -07:00
sonic-delayed.target Grouping delayed services under a target for config reload checks (#7846) 2021-06-21 11:55:02 -07:00
sonic.target [services] introduce sonic.target (#5705) 2021-02-25 14:26:24 +02:00
sshd_regex.json Add events to host and create rsyslog_plugin deb pkg (#12059) 2022-09-21 09:20:53 -07:00
swss_vars.j2 [Mellanox] Support DSCP remapping in dual ToR topo on T0 switch (#12605) 2023-02-07 16:21:59 +02:00
syncd_regex.json Add rsyslog plugin regex for select operation failure (#12659) 2022-11-13 21:41:33 -08:00
systemd_regex.json Add Structured Events w/ YANG Models (#12270) 2022-10-09 20:23:31 -07:00
tacacs-config.service Add service to restore TACACS from old config (#7560) 2021-06-03 20:07:17 -07:00
tacacs-config.timer [services] Update "WantedBy=" section for tacacs-config.timer. (#11893) 2022-09-08 15:16:11 -07:00
telemetry.service.j2 [services] kill container on stop in warm/fast mode (#10510) 2022-09-19 19:34:33 +03:00
telemetry.timer Grouping delayed services under a target for config reload checks (#7846) 2021-06-21 11:55:02 -07:00
updategraph.service.j2 [config-setup]: create a SONiC configuration management service (#3227) 2019-12-04 07:15:58 -08:00