public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Uladzimir Bely <ubely@ilbers.de>
To: isar-users@googlegroups.com
Subject: Re: [PATCH 00/10] Add support for secureboot using Debian boot chain
Date: Wed, 25 Jan 2023 10:17:00 +0300	[thread overview]
Message-ID: <4762907.OV4Wx5bFTl@hp> (raw)
In-Reply-To: <20221223084058.1899957-1-felix.moessbauer@siemens.com>

In mail from пятница, 23 декабря 2022 г. 11:40:48 +03 user Felix Moessbauer 
wrote:
> This series adds basic infrastructure to create ISAR images that
> can be bootet on a stock amd64 machine with secureboot and MS keys.
> Even if this comes with A LOT of limitations, we believe that this
> is a very needed feature: More and more systems have Secureboot (SB)
> enabled as default (MS keys enrolled) and often SB itself cannot be
> turned off. Having support for that in ISAR makes it possible to
> create two-staged images, where one image is used to configure the
> SB (enroll keys, configure MOK) and then boot the actual target image.
> 
> Currently, in this situation a debian live image has to be used to
> do the configuration (if the firmware graphical interface does not
> support it).
> 
> When reviewing, please not the following:
> 
> - this series is in a very early state, but fully works in a QEMU
>   as well as on some stock laptops
> - it is AMD64 only and that will not change (Debian limitations)
> - we need to make changes in the bootimg-efi-isar.py WIC plugin.
>   These are additions only and are very debian specific, hence these
>   should also remain ISAR only and not be proposed for OE
> - the key handling topic (p6-8) is not mature from a conceptual
>   perspective. Anyways, we do not want to spend too much time on it
>   as this is just an example how key management could be done
> - testing infrastructure is completely missing and that will not change
>   soon, as we need to maintain a state across reboots of the qemu.
> - These patches provide an easy way to create an image with any (signed)
>   stock debian kernel that boots on most (all) SB enabled AMD64 machines.
>   For that, no EFI config is required.
> 
> The series is structured as following:
> 
> p1-p3:  bare minimal support to boot with secureboot
> p4,5:   module signing
> p6-end: examples and helpers
> 
> Try it out:
> 
> Build it:
> bitbake mc:qemuamd64-sb-bullseye:isar-image-base
> 
> Start it (consider adding -enable-kvm to get some decent performance):
> start_vm -a amd64-sb -d bullseye -s
> 
> Check if SB is actually enabled (detected):
> dmesg | grep secure
> prints something like UEFI Secureboot is enabled
> 
> Try to load the example-module (it should fail):
> modprobe example-module
> 
> Enroll our MOK and reboot:
> mokutil --import /etc/sb-mok-keys/MOK/MOK.der
> 
> Now, use the previously definded password to enroll the key, then reboot.
> 
> Now our image should be up again and modprobe example-module should work.
> 
> Best regards,
> Felix
> Siemens AG
> 
> Felix Moessbauer (10):
>   wic: add option to use debian EFI shim
>   add debian sb chain bootloader dependencies
>   add example wic file for sb debian boot chain
>   style: split overlong line in module.inc
>   add support to sign kernel modules
>   add example to generated and distribute MOK data
>   add signed variant of example-module
>   add new machine qemuamd64-sb and corresponding mc
>   fix: only append kargs and extra_kargs if set
>   start_vm: add support for secureboot
> 
>  meta-isar/conf/local.conf.sample              |  1 +
>  meta-isar/conf/machine/qemuamd64-sb.conf      | 20 ++++++++++++++
>  .../multiconfig/qemuamd64-sb-bullseye.conf    | 12 +++++++++
>  .../example-module/example-module-signed.bb   | 14 ++++++++++
>  .../sb-mok-keys/files/Makefile.tmpl           | 27 +++++++++++++++++++
>  .../sb-mok-keys/sb-mok-keys.bb                | 23 ++++++++++++++++
>  .../sb-mok-public/files/rules                 | 12 +++++++++
>  .../sb-mok-public/sb-mok-public.bb            | 17 ++++++++++++
>  .../wic/canned-wks/sdimage-efi-sb-debian.wks  | 10 +++++++
>  meta/conf/distro/debian-common.conf           |  3 +++
>  .../linux-module/files/debian/rules.tmpl      |  3 +++
>  meta/recipes-kernel/linux-module/module.inc   | 15 ++++++++++-
>  .../wic/plugins/source/bootimg-efi-isar.py    | 16 +++++++++++
>  scripts/start_vm                              | 10 ++++++-
>  14 files changed, 181 insertions(+), 2 deletions(-)
>  create mode 100644 meta-isar/conf/machine/qemuamd64-sb.conf
>  create mode 100644 meta-isar/conf/multiconfig/qemuamd64-sb-bullseye.conf
>  create mode 100644
> meta-isar/recipes-kernel/example-module/example-module-signed.bb create
> mode 100644 meta-isar/recipes-secureboot/sb-mok-keys/files/Makefile.tmpl
> create mode 100644 meta-isar/recipes-secureboot/sb-mok-keys/sb-mok-keys.bb
> create mode 100644 meta-isar/recipes-secureboot/sb-mok-public/files/rules
> create mode 100644
> meta-isar/recipes-secureboot/sb-mok-public/sb-mok-public.bb create mode
> 100644 meta-isar/scripts/lib/wic/canned-wks/sdimage-efi-sb-debian.wks

Applied to next, thanks.





      parent reply	other threads:[~2023-01-25  7:17 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-23  8:40 Felix Moessbauer
2022-12-23  8:40 ` [PATCH 01/10] wic: add option to use debian EFI shim Felix Moessbauer
2022-12-23  8:40 ` [PATCH 02/10] add debian sb chain bootloader dependencies Felix Moessbauer
2022-12-23  8:40 ` [PATCH 03/10] add example wic file for sb debian boot chain Felix Moessbauer
2022-12-23  8:40 ` [PATCH 04/10] style: split overlong line in module.inc Felix Moessbauer
2022-12-23  8:40 ` [PATCH 05/10] add support to sign kernel modules Felix Moessbauer
2022-12-23  8:40 ` [PATCH 06/10] add example to generated and distribute MOK data Felix Moessbauer
2023-02-03  6:05   ` Jan Kiszka
2022-12-23  8:40 ` [PATCH 07/10] add signed variant of example-module Felix Moessbauer
2022-12-23  8:40 ` [PATCH 08/10] add new machine qemuamd64-sb and corresponding mc Felix Moessbauer
2022-12-23  8:40 ` [PATCH 09/10] fix: only append kargs and extra_kargs if set Felix Moessbauer
2022-12-23  8:40 ` [PATCH 10/10] start_vm: add support for secureboot Felix Moessbauer
2023-01-27  5:07   ` Uladzimir Bely
2023-01-27  8:11     ` Moessbauer, Felix
2023-01-27  8:41       ` Florian Bezdeka
2023-01-27  9:10         ` Uladzimir Bely
2023-01-25  7:17 ` Uladzimir Bely [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4762907.OV4Wx5bFTl@hp \
    --to=ubely@ilbers.de \
    --cc=isar-users@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox