From nobody Mon Feb 9 11:05:57 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1648469597; cv=none; d=zohomail.com; s=zohoarc; b=lF9e07R2AzBr5JHtgscnumeq7iamg8fMaSbNnOrwJs+GKkYzV1keO/QhxPM2DgNRSWOIGa1urnGog4othfJMr47PmKvzcPKMToNl+mttwYQ9beufRENKSrFbqjYTnuDho2942Vry+IWeFT5gifrWLPeIP9PTFO/s1opDo8BgfTc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1648469597; 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=9TEX42QUQxs9ZbSiB8ZW9t5LKXMQ54qk/7+gI4Dgb9c=; b=SGnT+eyDqUPQ8ZO2FMskGfJMI7fILBtCDvlR0PIOKf0KB7gSHo/n+x15jd/sMkh/c9NWHp2xKeCA68vdLJDzcz9VezXvPhScIVgh7F21lHSuw5NunxulbI5hPnmMtZ7A0uwOk3v3IgF6kuchGZCug55gddzxbvHGHgqIDayqIFY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1648469597879671.6787045254115; Mon, 28 Mar 2022 05:13:17 -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-507-HWo36DhZMe20876pJ6KI5A-1; Mon, 28 Mar 2022 08:11:13 -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 017BC804183; Mon, 28 Mar 2022 12:11:11 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id D2DC540CF8FD; Mon, 28 Mar 2022 12:11:10 +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 28B4E1940343; Mon, 28 Mar 2022 12:11:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D8430193F6DC for ; Mon, 28 Mar 2022 12:11:08 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id B36541417201; Mon, 28 Mar 2022 12:11:08 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1A3E8140240A for ; Mon, 28 Mar 2022 12:11:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648469596; 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=9TEX42QUQxs9ZbSiB8ZW9t5LKXMQ54qk/7+gI4Dgb9c=; b=AFS4KGc2xlFmzY7ryhY5xBuoiz+tkF/IyLtM0pHPziJeEZgJj7C6ODIV2VrBLLW4QbrcpM Ngln66M8a+1wljjZvBRFJQWlDrK8mIOvr9PSubluJc8XXV6BTtarRch6qq9FIiHV5MqT16 tllen/OX5cGAn7UTi3GfGzDHQxrriXs= X-MC-Unique: HWo36DhZMe20876pJ6KI5A-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 22/29] docs: Convert 'formatstorageencryption' page to rST Date: Mon, 28 Mar 2022 14:10:37 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 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: 1648469599442100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Peter Krempa Reviewed-by: Erik Skultety --- docs/formatstorageencryption.html.in | 181 --------------------------- docs/formatstorageencryption.rst | 142 +++++++++++++++++++++ docs/meson.build | 2 +- 3 files changed, 143 insertions(+), 182 deletions(-) delete mode 100644 docs/formatstorageencryption.html.in create mode 100644 docs/formatstorageencryption.rst diff --git a/docs/formatstorageencryption.html.in b/docs/formatstorageencry= ption.html.in deleted file mode 100644 index 395a7269b1..0000000000 --- a/docs/formatstorageencryption.html.in +++ /dev/null @@ -1,181 +0,0 @@ - - - - -

Storage volume encryption XML format

- -
    - -

    Storage volume encryption XML

    - -

    - Storage volumes may be encrypted, the XML snippet described below is= used - to represent the details of the encryption. It can be used as a part - of a domain or storage configuration. -

    -

    - The top-level tag of volume encryption specification - is encryption, with a mandatory - attribute format. Currently defined values - of format are default, qcow, - luks, and luks2. - Each value of format implies some expectations about the - content of the encryption tag. Other format values may= be - defined in the future. -

    -

    - The encryption tag supports an optional engine - tag, which allows selecting which component actually handles - the encryption. Currently defined values of engine are - qemu and librbd. - Both qemu and librbd require using the qemu - driver. - The librbd engine requires qemu version >=3D 6.1.0, both - ceph cluster and librbd1 >=3D 16.1.0, and is only applicable for RBD - network disks. - If the engine tag is not specified, the qemu engine wil= l be - used by default (assuming the qemu driver is used). - Note that librbd engine is currently only supported by = the - qemu VM driver, and is not supported by the storage driver. Furtherm= ore, - the storage driver currently ignores the engine tag. -

    -

    - The encryption tag can currently contain a sequence of - secret tags, each with mandatory attributes type<= /code> - and either uuid or usage - (since 2.1.0). The only currently defin= ed - value of type is volume. The - uuid is "uuid" of the secret while - usage is the "usage" subelement field. - A secret value can be set in libvirt by the - - virSecretSetValue API. Alternatively, if supported - by the particular volume format and driver, automatically generate a - secret value at the time of volume creation, and store it using the - specified uuid. -

    -

    "default" format

    -

    "qcow" format

    -

    - Since 4.5.0, encryption formats - default and qcow may no longer be used - to create an encrypted volume. Usage of qcow encrypted volumes - in QEMU began phasing out in QEMU 2.3 and by QEMU 2.9 creation - of a qcow encrypted volume via qemu-img required usage of secret - objects, but that support was not added to libvirt. -

    -

    "luks" format

    -

    - The luks format is specific to a luks encrypted volume - and the secret is used in order to either encrypt during volume crea= tion - or decrypt the volume for usage by the domain. A single - <secret type=3D'passphrase'...> element is expect= ed. - Since 2.1.0. -

    -

    - For volume creation, it is possible to specify the encryption - algorithm used to encrypt the luks volume. The following two - optional elements may be provided for that purpose. It is hypervisor - dependent as to which algorithms are supported. The default algorithm - used by the storage driver backend when using qemu-img to create - the volume is 'aes-256-cbc' using 'essiv' for initialization vector - generation and 'sha256' hash algorithm for both the cipher and the - initialization vector generation. -

    - -
    -
    cipher
    -
    This element describes the cipher algorithm to be used to either - encrypt or decrypt the luks volume. This element has the followi= ng - attributes: -
    -
    name
    -
    The name of the cipher algorithm used for data encryption, - such as 'aes', 'des', 'cast5', 'serpent', 'twofish', etc. - Support of the specific algorithm is storage driver - implementation dependent.
    -
    size
    -
    The size of the cipher in bits, such as '256', '192', '128= ', - etc. Support of the specific size for a specific cipher is - hypervisor dependent.
    -
    mode
    -
    An optional cipher algorithm mode such as 'cbc', 'xts', - 'ecb', etc. Support of the specific cipher mode is - hypervisor dependent.
    -
    hash
    -
    An optional master key hash algorithm such as 'md5', 'sha1= ', - 'sha256', etc. Support of the specific hash algorithm is - hypervisor dependent.
    -
    -
    -
    ivgen
    -
    This optional element describes the initialization vector - generation algorithm used in conjunction with the - cipher. If the cipher is not provided, - then an error will be generated by the parser. -
    -
    name
    -
    The name of the algorithm, such as 'plain', 'plain64', - 'essiv', etc. Support of the specific algorithm is hypervisor - dependent.
    -
    hash
    -
    An optional hash algorithm such as 'md5', 'sha1', 'sha256', - etc. Support of the specific ivgen hash algorithm is hypervisor - dependent.
    -
    -
    -
    - -

    "luks2" format

    -

    - The luks2 format is currently supported only by the - librbd engine, and can only be applied to RBD network d= isks - (RBD images). - Since the librbd engine is currently not supported by t= he - libvirt storage driver, you cannot use it to control such disks. How= ever, - pre-formatted RBD luks2 disks can be loaded to a qemu VM using the q= emu - VM driver. - A single - <secret type=3D'passphrase'...> element is expect= ed. -

    - - -

    Examples

    - -

    - Assuming a - luks volume type secret is already defined, - a simple example specifying use of the luks format - for either volume creation without a specific cipher being defined or - as part of a domain volume definition: -

    -
    -<encryption format=3D'luks'>
    -  <secret type=3D'passphrase' uuid=3D'f52a81b2-424e-490c-823d-6bd4235bc=
    572'/>
    -</encryption>
    -    
    - -

    - Here is an example specifying use of the luks format for - a specific cipher algorithm for volume creation. - Since 6.10.0, the target f= ormat - can also support qcow2 type with luks encr= yption. -

    -
    -<volume>
    -  <name>twofish.luks</name>
    -  <capacity unit=3D'G'>5</capacity>
    -  <target>
    -    <path>/var/lib/libvirt/images/demo.luks</path>
    -    <format type=3D'raw'/>
    -    <encryption format=3D'luks'>
    -       <secret type=3D'passphrase' uuid=3D'f52a81b2-424e-490c-823d-6bd4=
    235bc572'/>
    -       <cipher name=3D'twofish' size=3D'256' mode=3D'cbc' hash=3D'sha25=
    6'/>
    -       <ivgen name=3D'plain64' hash=3D'sha256'/>
    -    </encryption>
    -  </target>
    -</volume>
    -    
    - - - diff --git a/docs/formatstorageencryption.rst b/docs/formatstorageencryptio= n.rst new file mode 100644 index 0000000000..7b5cccaf5e --- /dev/null +++ b/docs/formatstorageencryption.rst @@ -0,0 +1,142 @@ +.. role:: since + +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +Storage volume encryption XML format +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +.. contents:: + +Storage volume encryption XML +----------------------------- + +Storage volumes may be encrypted, the XML snippet described below is used = to +represent the details of the encryption. It can be used as a part of a dom= ain or +storage configuration. + +The top-level tag of volume encryption specification is ``encryption``, wi= th a +mandatory attribute ``format``. Currently defined values of ``format`` are +``default``, ``qcow``, ``luks``, and ``luks2``. Each value of ``format`` i= mplies +some expectations about the content of the ``encryption`` tag. Other format +values may be defined in the future. + +The ``encryption`` tag supports an optional ``engine`` tag, which allows +selecting which component actually handles the encryption. Currently defin= ed +values of ``engine`` are ``qemu`` and ``librbd``. Both ``qemu`` and ``libr= bd`` +require using the qemu driver. The ``librbd`` engine requires qemu version= >=3D +6.1.0, both ceph cluster and librbd1 >=3D 16.1.0, and is only applicable f= or RBD +network disks. If the engine tag is not specified, the ``qemu`` engine wil= l be +used by default (assuming the qemu driver is used). Note that ``librbd`` e= ngine +is currently only supported by the qemu VM driver, and is not supported by= the +storage driver. Furthermore, the storage driver currently ignores the ``en= gine`` +tag. + +The ``encryption`` tag can currently contain a sequence of ``secret`` tags= , each +with mandatory attributes ``type`` and either ``uuid`` or ``usage`` ( +:since:`since 2.1.0` ). The only currently defined value of ``type`` is +``volume``. The ``uuid`` is "uuid" of the ``secret`` while ``usage`` is the +"usage" subelement field. A secret value can be set in libvirt by the +`virSecretSetValue `__= API. +Alternatively, if supported by the particular volume format and driver, +automatically generate a secret value at the time of volume creation, and = store +it using the specified ``uuid``. + +"default" format +~~~~~~~~~~~~~~~~ + +"qcow" format +~~~~~~~~~~~~~ + +:since:`Since 4.5.0,` encryption formats ``default`` and ``qcow`` may no l= onger +be used to create an encrypted volume. Usage of qcow encrypted volumes in = QEMU +began phasing out in QEMU 2.3 and by QEMU 2.9 creation of a qcow encrypted +volume via qemu-img required usage of secret objects, but that support was= not +added to libvirt. + +"luks" format +~~~~~~~~~~~~~ + +The ``luks`` format is specific to a luks encrypted volume and the secret = is +used in order to either encrypt during volume creation or decrypt the volu= me for +usage by the domain. A single ```` element = is +expected. :since:`Since 2.1.0` . + +For volume creation, it is possible to specify the encryption algorithm us= ed to +encrypt the luks volume. The following two optional elements may be provid= ed for +that purpose. It is hypervisor dependent as to which algorithms are suppor= ted. +The default algorithm used by the storage driver backend when using qemu-i= mg to +create the volume is 'aes-256-cbc' using 'essiv' for initialization vector +generation and 'sha256' hash algorithm for both the cipher and the +initialization vector generation. + +``cipher`` + This element describes the cipher algorithm to be used to either encryp= t or + decrypt the luks volume. This element has the following attributes: + + ``name`` + The name of the cipher algorithm used for data encryption, such as '= aes', + 'des', 'cast5', 'serpent', 'twofish', etc. Support of the specific + algorithm is storage driver implementation dependent. + ``size`` + The size of the cipher in bits, such as '256', '192', '128', etc. Su= pport + of the specific size for a specific cipher is hypervisor dependent. + ``mode`` + An optional cipher algorithm mode such as 'cbc', 'xts', 'ecb', etc. + Support of the specific cipher mode is hypervisor dependent. + ``hash`` + An optional master key hash algorithm such as 'md5', 'sha1', 'sha256= ', + etc. Support of the specific hash algorithm is hypervisor dependent. +``ivgen`` + This optional element describes the initialization vector generation + algorithm used in conjunction with the ``cipher``. If the ``cipher`` is= not + provided, then an error will be generated by the parser. + + ``name`` + The name of the algorithm, such as 'plain', 'plain64', 'essiv', etc. + Support of the specific algorithm is hypervisor dependent. + ``hash`` + An optional hash algorithm such as 'md5', 'sha1', 'sha256', etc. Sup= port + of the specific ivgen hash algorithm is hypervisor dependent. + +"luks2" format +~~~~~~~~~~~~~~ + +The ``luks2`` format is currently supported only by the ``librbd`` engine,= and +can only be applied to RBD network disks (RBD images). Since the ``librbd`` +engine is currently not supported by the libvirt storage driver, you canno= t use +it to control such disks. However, pre-formatted RBD luks2 disks can be lo= aded +to a qemu VM using the qemu VM driver. A single +```` element is expected. + +Examples +-------- + +Assuming a `luks volume type secret `__= is +already defined, a simple example specifying use of the ``luks`` format for +either volume creation without a specific cipher being defined or as part = of a +domain volume definition: + +:: + + + + + +Here is an example specifying use of the ``luks`` format for a specific ci= pher +algorithm for volume creation. :since:`Since 6.10.0,` the ``target`` forma= t can +also support ``qcow2`` type with ``luks`` encryption. + +:: + + + twofish.luks + 5 + + /var/lib/libvirt/images/demo.luks + + + + + + + + diff --git a/docs/meson.build b/docs/meson.build index b911292480..22eca7d8bd 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -25,7 +25,6 @@ docs_html_in_files =3D [ 'formatnetwork', 'formatnode', 'formatnwfilter', - 'formatstorageencryption', 'hooks', 'index', 'internals', @@ -88,6 +87,7 @@ docs_rst_files =3D [ 'formatsnapshot', 'formatstorage', 'formatstoragecaps', + 'formatstorageencryption', 'glib-adoption', 'goals', 'governance', --=20 2.35.1