]> git.proxmox.com Git - ceph.git/blame - ceph/doc/ceph-volume/lvm/encryption.rst
bump version to 12.2.5-pve1
[ceph.git] / ceph / doc / ceph-volume / lvm / encryption.rst
CommitLineData
b32b8144
FG
1.. _ceph-volume-lvm-encryption:
2
3Encryption
4==========
5
6Logical volumes can be encrypted using ``dmcrypt``. Encryption can be done in
7different ways, specially with LVM. ``ceph-volume`` is somewhat opinionated
8with the way it sets up encryption with logical volumes so that the process is
9consistent and robust.
10
11In this case, ``ceph-volume lvm`` follows these constraints:
12
13* only LUKS (version 1) is used
14* Logical Volumes are encrypted, while their underlying PVs (physical volumes)
15 aren't
16* Non-LVM devices like partitions are also encrypted with the same OSD key
17
18
19LUKS
20----
21There are currently two versions of LUKS, 1 and 2. Version 2 is a bit easier
22to implement but not widely available in all distros Ceph supports. LUKS 1 is
23not going to be deprecated in favor of LUKS 2, so in order to have as wide
24support as possible, ``ceph-volume`` uses LUKS version 1.
25
26.. note:: Version 1 of LUKS is just referenced as "LUKS" whereas version 2 is
27 referred to as LUKS2
28
29
30LUKS on LVM
31-----------
32Encryption is done on top of existing logical volumes (unlike encrypting the
33physical device). Any single logical volume can be encrypted while other
34volumes can remain unencrypted. This method also allows for flexible logical
35volume setups, since encryption will happen once the LV is created.
36
37
38Workflow
39--------
40When setting up the OSD, a secret key will be created, that will be passed
41along to the monitor in JSON format as stdin to prevent the key from being
42captured in the logs.
43
44The JSON payload looks something like::
45
46 {
47 "cephx_secret": CEPHX_SECRET,
48 "dmcrypt_key": DMCRYPT_KEY,
49 "cephx_lockbox_secret": LOCKBOX_SECRET,
50 }
51
52The naming convention for the keys is **strict**, and they are named like that
53for the hardcoded (legacy) names ceph-disk used.
54
55* ``cephx_secret`` : The cephx key used to authenticate
56* ``dmcrypt_key`` : The secret (or private) key to unlock encrypted devices
57* ``cephx_lockbox_secret`` : The authentication key used to retrieve the
58 ``dmcrypt_key``. It is named *lockbox* because ceph-disk used to have an
59 unencrypted partition named after it, used to store public keys and other
60 OSD metadata.
61
62The naming convention is strict because Monitors supported the naming
63convention by ceph-disk, which used these key names. In order to keep
64compatibility and prevent ceph-disk from breaking, ceph-volume will use the same
65naming convention *although they don't make sense for the new encryption
66workflow*.
67
68After the common steps of setting up the OSD during the prepare stage, either
69with :term:`filestore` or :term:`bluestore`, the logical volume is left ready
70to be activated, regardless of the state of the device (encrypted or decrypted).
71
72At activation time, the logical volume will get decrypted and the OSD started
73once the process completes correctly.
74
75Summary of the encryption workflow for creating a new OSD:
76
77#. OSD is created, both lockbox and dmcrypt keys are created, and sent along
78 with JSON to the monitors, indicating an encrypted OSD.
79
80#. All complementary devices (like journal, db, or wal) get created and
81 encrypted with the same OSD key. Key is stored in the LVM metadata of the
82 OSD
83
84#. Activation continues by ensuring devices are mounted, retrieving the dmcrypt
85 secret key from the monitors and decrypting before the OSD gets started.