| 1 |
.. _setup_for_luks: |
| 2 |
|
| 3 |
Image Description for an Encrypted Disk |
| 4 |
======================================= |
| 5 |
|
| 6 |
.. sidebar:: Abstract |
| 7 |
|
| 8 |
This page provides further information for handling |
| 9 |
disk images with an encrypted root filesystem. |
| 10 |
The information here is based on the following |
| 11 |
article: |
| 12 |
|
| 13 |
* :ref:`simple_disk` |
| 14 |
|
| 15 |
A virtual disk image can be partially or fully encrypted |
| 16 |
using the LUKS extension supported by {kiwi}. A fully encrypted |
| 17 |
image also includes the data in `/boot` to be encrypted. |
| 18 |
Such an image requests the passphrase for the master key |
| 19 |
to be entered at the bootloader stage. A partially encrypted |
| 20 |
image keeps `/boot` unencrypted and on an extra boot partition. |
| 21 |
Such an image requests the passphrase for the master key later |
| 22 |
in the boot process when the root partition is accessed by |
| 23 |
the systemd mount service. In any case, the master passphrase |
| 24 |
is requested only once. |
| 25 |
|
| 26 |
Update the {kiwi} image description as follows: |
| 27 |
|
| 28 |
1. Software packages |
| 29 |
|
| 30 |
Make sure to add the following package to the package list: |
| 31 |
|
| 32 |
.. note:: |
| 33 |
|
| 34 |
Package names used in the following list match the |
| 35 |
package names of the SUSE distribution and might be different |
| 36 |
on other distributions. |
| 37 |
|
| 38 |
.. code:: xml |
| 39 |
|
| 40 |
<package name="cryptsetup"/> |
| 41 |
|
| 42 |
2. Image Type definition |
| 43 |
|
| 44 |
Update the oem image type setup as follows: |
| 45 |
|
| 46 |
Full disk encryption, including `/boot`: |
| 47 |
.. code:: xml |
| 48 |
|
| 49 |
<type image="oem" filesystem="ext4" luks="linux" bootpartition="false"> |
| 50 |
<oemconfig> |
| 51 |
<oem-resize>false</oem-resize> |
| 52 |
</oemconfig> |
| 53 |
</type> |
| 54 |
|
| 55 |
Encrypted root partition with an unencrypted extra `/boot` partition: |
| 56 |
.. code:: xml |
| 57 |
|
| 58 |
<type image="oem" filesystem="ext4" luks="linux" bootpartition="true"> |
| 59 |
<oemconfig> |
| 60 |
<oem-resize>false</oem-resize> |
| 61 |
</oemconfig> |
| 62 |
</type> |
| 63 |
|
| 64 |
.. note:: |
| 65 |
|
| 66 |
The value for the `luks` attribute sets the master passphrase |
| 67 |
for the LUKS keyring. Therefore, the XML description becomes |
| 68 |
security-critical and should only be readable by trustworthy |
| 69 |
people. Alternatively, the credentials information can be |
| 70 |
stored in a key file and referenced as: |
| 71 |
|
| 72 |
.. code:: xml |
| 73 |
|
| 74 |
<type luks="file:///path/to/keyfile"/> |