From nobody Mon Feb 9 12:43:25 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1656000938; cv=none; d=zohomail.com; s=zohoarc; b=WDd9PyjR1/25n+qQGkvZzJdJfK86OTYS3He02/yi1XRzvZvivr1rTqCrrEgTCCUdMPjnTc0W6SkqDCEEgw++Z81GAPComQThScCNMYCg918I5RJQzySX3oeiJBMNEVRHSQ1n7CYpCxXD8ObC0zy83LT4528CbDPptGJ3PvlXBBE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1656000938; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=6cCBWgmzFOs8XpraR5gvF7kDoBZJOQabiuwUNX38MTI=; b=f599TODfCjTnrOZ54FnAtXOf5h6UhnrH2re4z5tpKY6PE7EDoRKvvLXInUpmi+WJrXpVzDw3olLEtfo1hkTM+Ta31T/sfeLCQSvXOzFayVPz1DFSs/93tEQoXjGdwuCVkKAgOrwKZwQ1vru/IbAT7tKhjqror6GtwmZ8paoE5t0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1656000938554228.54543683534928; Thu, 23 Jun 2022 09:15:38 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-634-cqXdIzRwPR-Nmp38Bkz9pw-1; Thu, 23 Jun 2022 12:15:29 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0FE58919F99; Thu, 23 Jun 2022 16:15:07 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id EF56240CFD0B; Thu, 23 Jun 2022 16:15:06 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B38C4194B965; Thu, 23 Jun 2022 16:15:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 0C08C194B964 for ; Thu, 23 Jun 2022 16:15:04 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id EED09112132C; Thu, 23 Jun 2022 16:15:03 +0000 (UTC) Received: from harajuku.homenet.telecomitalia.it (unknown [10.40.194.79]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 540BC1121319 for ; Thu, 23 Jun 2022 16:15:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656000937; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=6cCBWgmzFOs8XpraR5gvF7kDoBZJOQabiuwUNX38MTI=; b=U6wd5FF72N7e0iVyJ7OwwrDe0ObmHh2u6+N4iS4N77df71bIRdMlJBP6GjcNPOF2GFE6Bt gmlCWLG9wnUB5DkLXJ2SvlRRHhDkO8cD+uWCM3lr2MLp3YQZLoSzg810ztpPdkr1X7O/Mv SOl+hNfNB8QGt7HAPQoYvYCVWOI22q4= X-MC-Unique: cqXdIzRwPR-Nmp38Bkz9pw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 27/28] docs: Add kbase page for Secure Boot Date: Thu, 23 Jun 2022 18:14:39 +0200 Message-Id: <20220623161440.61653-28-abologna@redhat.com> In-Reply-To: <20220623161440.61653-1-abologna@redhat.com> References: <20220623161440.61653-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1656000939787100005 Content-Type: text/plain; charset="utf-8" Provide simple recipes for the most common high-level tasks. Signed-off-by: Andrea Bolognani --- docs/kbase/index.rst | 3 ++ docs/kbase/meson.build | 1 + docs/kbase/secureboot.rst | 102 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 106 insertions(+) create mode 100644 docs/kbase/secureboot.rst diff --git a/docs/kbase/index.rst b/docs/kbase/index.rst index 8b710db85a..896ececdf2 100644 --- a/docs/kbase/index.rst +++ b/docs/kbase/index.rst @@ -61,6 +61,9 @@ Usage `Snapshots `__ Details about snapshotting a VM =20 +`Secure Boot `__ + Enable and disable the Secure Boot feature + =20 Debugging --------- diff --git a/docs/kbase/meson.build b/docs/kbase/meson.build index eb9c9544d6..c7eae3738f 100644 --- a/docs/kbase/meson.build +++ b/docs/kbase/meson.build @@ -15,6 +15,7 @@ docs_kbase_files =3D [ 'qemu-passthrough-security', 'rpm-deployment', 's390_protected_virt', + 'secureboot', 'secureusage', 'snapshots', 'systemtap', diff --git a/docs/kbase/secureboot.rst b/docs/kbase/secureboot.rst new file mode 100644 index 0000000000..90c37d707c --- /dev/null +++ b/docs/kbase/secureboot.rst @@ -0,0 +1,102 @@ +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +Secure Boot +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +.. contents:: + +Quick configuration +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +If you have libvirt 8.5.0 or newer, when creating a new VM you can +ask for Secure Boot to be enabled with + +:: + + + + + + + +and for it to be disabled with + +:: + + + + + + + +These configuration will cause unsigned guest operating systems to +be rejected and allowed respectively. + + +Older libvirt versions +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +If your libvirt version is older than 8.5.0 but newer than 7.2.0, +then enabling Secure Boot requires a slightly more verbose XML +snippet: + +:: + + + + + + + + +Versions older than 7.2.0 require manually providing all information +about the firmware and are not covered here. Plese refer to `the +relevant documentation +<../formatdomain.html#operating-system-booting>`__ for details. + + +Changing an existing VM +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Once the VM has been created, updating the XML configuration as +described above is **not** enough to change the Secure Boot status: +the NVRAM file associated with the VM has to be regenerated from its +template as well. + +In order to do that, update the XML and then start the VM with + +:: + + $ virsh start $vm --reset-nvram + +This option is only available starting with libvirt 8.1.0, so if your +version of libvirt is older than that you will have to delete the +NVRAM file manually before starting the VM. + +Most guest operating systems will be able to cope with the NVRAM file +being reinitialized, but in some cases the VM will be unable to boot +after the change. + + +Additional information +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +There are two parts to enabling Secure Boot: the firmware supporting +the feature, and it being active. + +Most host operating systems ship a build of EDKII (the open source +EFI implementation used for QEMU VMs) that supports the Secure Boot +feature, but simply using such a build will not result in unsigned +guest operating systems being rejected: for that to happen, keys that +can be used to validate the operating system signature need to be +provided as well. + +Asking for the ``enrolled-keys`` firmware feature to be enabled will +cause libvirt to initialize the NVRAM file associated with the VM +from a template that contains a suitable set of keys. These keys +being present will cause the firmware to enforce the Secure Boot +signing requirements. + +The opposite configuration, where the feature is explicitly disabled, +will result in no keys being present in the NVRAM file. Unable to +verify signatures, the firmware will allow even unsigned operating +systems to run. --=20 2.35.3