Skip to main content
RunBook Academy

CephXXXIII · EncryptionEncryption

Encryption at rest with dm-crypt and self-encrypting drives

Advanced⏱ ~18 mincephcryptsetup

What you'll learn

  • Deploy OSDs with dm-crypt encryption
  • Compare dm-crypt with self-encrypting drives
  • Explain precisely what at-rest encryption protects against
  • Manage the keys, which is the hard part

Prerequisites

None — start here.

Verified against Ceph Tentacle 20.2.x · Ceph Squid 19.2.x (supported previous) · cephadm matches the verified Ceph release · podman 4.x · csi-rbd and csi-cephfs current · RBD / CephFS / RGW current (matches Ceph release) · Linux kernel 5.15+ (5.10 minimum) · Ubuntu 24.04 LTS (Ceph host baseline) · Debian 12 (Bookworm) (Ceph host baseline) · Rocky Linux / RHEL / AlmaLinux 9.x (Ceph host baseline) · Proxmox VE 9.x (cross-course integration) · Kubernetes 1.31+ (cross-course integration) · 2026-08-18

Not yet marked complete on this device.

Why this matters in production

At-rest encryption is frequently a regulatory requirement and frequently misunderstood. It protects against one specific threat — physical possession of the device — and against nothing else. Deploying it without understanding that boundary produces a checkbox rather than a control.

What it protects against

ThreatProtected
Drive removed from the datacentreyes
Drive returned to vendor under RMAyes
Decommissioned hardware resoldyes
Datacentre theft of a whole chassispartly — depends on key location
Compromised OSD host while runningno — the volume is unlocked
Compromised Ceph client credentialno
Malicious administratorno
Network interceptionno

The running system has the volume unlocked, so anything with access to that host reads plaintext. At-rest encryption is about the device leaving your control, and that is the whole of it.

Deploying encrypted OSDs

ceph orch apply osd --all-available-devices --encrypted

Or in a service specification:

service_type: osd
service_id: encrypted-hdd
placement:
  host_pattern: 'ceph-osd-*'
spec:
  data_devices:
    rotational: 1
  encrypted: true

cephadm creates a LUKS container per device and stores the dm-crypt key in the monitor’s config-key store, retrieving it at OSD startup.

MAPPER_DEVICE=/dev/sdb
ceph config-key ls | grep dm-crypt
lsblk
cryptsetup status ${MAPPER_DEVICE}

Encryption must be chosen at OSD creation. Converting an existing OSD means destroying and re-creating it, so a fleet-wide conversion is a rolling rebuild.

Self-encrypting drives

SEDs encrypt in the drive controller with no host CPU cost, managed through TCG Opal or the SAS security commands.

dm-cryptSED
CPU costsmall, AES-NI acceleratednone
Key managementCeph config-key storedrive firmware plus a key manager
Auditabilityopen, inspectablevendor firmware
Vendor dependencenonesignificant
Instant crypto-erasenoyes

SEDs are attractive for their crypto-erase capability — a decommission becomes a key destruction rather than a wipe — but they place your trust in drive firmware, and firmware implementation flaws in SED products have been found repeatedly. dm-crypt is the more conservative choice.

Key management is the real problem

By default cephadm stores dm-crypt keys in the monitor config-key store — which means the keys live in the cluster whose data they protect.

That is fine for the drive-removal threat: a drive taken out of the chassis is useless without the monitors. It is not sufficient if the threat model includes taking the whole cluster, and it creates a hard dependency: lose the monitor store and every OSD is unrecoverable.

# back up the config-key store along with the monitor store
ceph config-key dump > /secure-backup/config-key-dump.json

Quiz

Knowledge check · 4 questions

  1. Q1. An attacker gains root on a running OSD host with dm-crypt-encrypted OSDs. What does the encryption protect?

  2. Q2. An existing unencrypted OSD can be converted to dm-crypt encryption in place.

  3. Q3. Assess the risk introduced by encrypted OSDs.

    A cluster has been deployed with `--encrypted` OSDs to satisfy a regulatory requirement. Monitor store backups are taken weekly to a share on the same cluster's CephFS. A restore has never been tested.

  4. Q4. What is the main trade-off between dm-crypt and self-encrypting drives?

Passing score: 75%. Answers are checked in this browser.

Production discipline

State explicitly, in the security documentation, that at-rest encryption addresses device loss and nothing else — the checkbox invites a broader assumption that will otherwise go unchallenged. Where encrypted OSDs are used, treat monitor store and config-key backups as protecting the data itself, store them outside the cluster, and test the restore.

Cross-course references

  • Kubernetes: encrypted etcd with keys stored in the same cluster has the identical circular dependency
  • Linux: LUKS key management and the running-system caveat are the same in any deployment