-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable secure boot for ghaf on Lenovo X1
This patch enables secure boot only on debug builds using demo keys, which is still unsecure way of booting OS. Task: SP-3201 Signed-off-by: Vunny Sodhi <[email protected]>
- Loading branch information
1 parent
873c07d
commit 11f22b4
Showing
15 changed files
with
586 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<!-- | ||
Copyright 2022-2023 TII (SSRC) and the Ghaf contributors | ||
SPDX-License-Identifier: CC-BY-SA-4.0 | ||
--> | ||
|
||
# Secure Boot | ||
|
||
This section describes Secure Boot and how to create secure keys. | ||
|
||
The reader is expected to know the fundamentals of UEFI and have a basic understanding of Secure Boot [UEFI specification](https://uefi.org/specifications). | ||
|
||
## Enabling Secure Boot | ||
|
||
Secure Boot can be enabled on NixOS using [Lanzaboote](https://github.com/nix-community/lanzaboote). Secure Boot is a UEFI feature that only allows trusted operating systems to boot. | ||
Lanzaboote has two components: lzbt and stub. lzbt signs and installs the boot files on the ESP. stub is a UEFI application that loads the kernel and initrd from the ESP. | ||
|
||
## Creating Secure Boot Keys | ||
|
||
Secure Boot keys can be created with [sbctl](https://github.com/Foxboron/sbctl), a Secure Boot Manager. sbctl is available in Nixpkgs as pkgs.sbctl. | ||
|
||
After you installed sbctl or entered a Nix shell, use the following command to create your Secure Boot keys: | ||
``` | ||
$ sudo sbctl create-keys | ||
``` | ||
|
||
Using "sudo sbctl create-keys" command user can create secure keys on the trusted system. | ||
|
||
## Current Implementation | ||
|
||
For demonstration purposes, we use pre-generated secure keys which are **unsecure** as whoever has keys can break into the system. | ||
Currently, the Secure Boot feature is enabled in debug builds only, since secure key creation requires sudo rights. | ||
|
||
### Secure Boot Verification | ||
* For enabling secure boot instructions, see the [Part 2: Enabling Secure Boot](https://github.com/nix-community/lanzaboote/blob/master/docs/QUICK_START.md#part-2-enabling-secure-boot) section of the NixOS Secure Boot Quick Start Guide. | ||
|
||
* Make sure your Secure Boot is enabled from the BIOS menu. | ||
* Once you boot your system with Secure Boot enabled, enroll keys with the following command: | ||
``` | ||
$ sudo sbctl enroll-keys --microsoft | ||
``` | ||
|
||
Reboot the system to activate Secure Boot in the user mode: | ||
|
||
``` | ||
$ bootctl status | ||
System: | ||
Firmware: UEFI 2.70 (Lenovo 0.4720) | ||
Firmware Arch: x64 | ||
Secure Boot: enabled (user) | ||
TPM2 Support: yes | ||
Boot into FW: supported | ||
``` |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
f8948cc1-daca-4d6e-896d-56577dc09f81 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"/boot/EFI/BOOT/BOOTX64.EFI": { | ||
"file": "/boot/EFI/BOOT/BOOTX64.EFI", | ||
"output_file": "/boot/EFI/BOOT/BOOTX64.EFI", | ||
"checksum": "3d035c0745161803d3d34334a214906b9e4f2e91a6a57df2750b0148e2be6059" | ||
}, | ||
"/boot/EFI/systemd/systemd-bootx64.efi": { | ||
"file": "/boot/EFI/systemd/systemd-bootx64.efi", | ||
"output_file": "/boot/EFI/systemd/systemd-bootx64.efi", | ||
"checksum": "33609dd2e743d803ffe98c3689b262d28d5e03e6ae17766a34527676c7f811eb" | ||
} | ||
} |
Oops, something went wrong.