Amorçage UEFI Secure Boot

Mise à jour : Debian 10.8 - Buster

Secure Boot est un dispositif mis au point par Microsoft qui interdit le lancement de logiciels non signés sur les plateformes X86_64 avec amorçage EFI

Ce document décrit rapidement le principe de mise en œuvre et de test de ce mode d'amorçage

Sommaire

1 - Principe

2 - Amorçage

2.1 - Configuration de la plate-forme

2.2 - Test d'amorçage

$ sudo dmesg |grep secure
[ 0.000000] secureboot: Secure boot enabled
[ 0.000000] Kernel is locked down from EFI secure boot; see https://wiki.debian.org/SecureBoot
$ hexdump /sys/firmware/efi/efivars/SecureBoot-8be4df61-93ca-11d2-aa0d-00e098032b8c 
0000000 0006 0000 0001
0000005
$ sudo aptitude install mokutil

$ mokutil --sb-state
SecureBoot enabled
$ bootctl |grep "Secure Boot"
Secure Boot: enabled

2.3 - Certificats

Les messages du noyau permettent de repérer les certificats chargées pendant l'amorçage
$ sudo dmesg |grep X.509

Dans le cas présent, on trouve
integrity: Loading X.509 certificate: UEFI:db
integrity: Loaded X.509 cert 'Microsoft Corporation UEFI CA 2011: 13adbf4309bd82709c8cd54f316ed522988a1bd4
integrity: Loading X.509 certificate: UEFI:db
integrity: Loaded X.509 cert 'Microsoft Windows Production PCA 2011: a92902398e16c49778cd90f99e4f9ae17c55af53'
integrity: Loading X.509 certificate: UEFI:db
integrity: Loaded X.509 cert 'CISD FW Update - Certificate: 068268b4a41c93854262d49b4f788f13
Loading compiled-in X.509 certificates
Loaded X.509 cert 'Debian Secure Boot CA: 6ccece7e4c6c0d1f6149f3dd27dfcc5cbb419ea1'
Loaded X.509 cert 'Debian Secure Boot Signer 2021 - linux: 4b6ef5abca669825178e052c84667ccbc0531f8c'
[   11.900229] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[ 11.900446] cfg80211: Loaded X.509 cert 'benh@debian.org: 577e021cb980e0e820821ba7b54b4961b8b4fadf'
[ 11.900804] cfg80211: Loaded X.509 cert 'romain.perier@gmail.com: 3abbc6ec146e09d1b6016ab9d6cf71dd233f0328'
[ 11.900993] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'

2.4 - Base de données des clés

$ mokutil -l --db |grep Issuer
Issuer: C=US, ST=Washington, L=Redmond, O=Microsoft Corporation, CN=Microsoft Corporation Third Party Marketplace Root
CA Issuers - URI:http://www.microsoft.com/pki/certs/MicCorThiParMarRoo_2010-10-05.crt
Issuer: C=US, ST=Washington, L=Redmond, O=Microsoft Corporation, CN=Microsoft Root Certificate Authority 2010
CA Issuers - URI:http://www.microsoft.com/pki/certs/MicRooCerAut_2010-06-23.crt
Issuer: CN=CISD FW Update - Certificate

On retrouve les deux certificats Microsoft et le certificat du fabricant

$ mokutil -l --dbx
[key 1]
[SHA-256]
80b4d96931bf0d02fd91a61e19d14f1da452e66db2408ca8604d411f92659f0a
f52f83a3fa9cfbd6920f722824dbe4034534d25b8507246b3b957dac6e1bce7
.....
$ mokutil -l --pk |grep Issuer
Issuer: CN=Intel(R) Desktop Boards
$ mokutil -l --kek |grep Issuer
Issuer: C=US, ST=Washington, L=Redmond, O=Microsoft Corporation, CN=Microsoft Corporation Third Party Marketplace Root
CA Issuers - URI:http://www.microsoft.com/pki/certs/MicCorThiParMarRoo_2010-10-05.crt