You sit down to write the encryption section of your SOC 2 description of services or your Law 25 privacy impact assessment, and you discover that “data at rest is encrypted” is the easy sentence to type and the hard sentence to defend. The auditor’s follow-up is always the same shape: encrypted with what, against what threat, with the key managed by whom, rotated on what cadence, and how do you know the encryption is actually on right now. On a Linux-VM stack you have three patterns to choose from — full-disk LUKS, filesystem-level (typically LUKS-on-LVM or ZFS native encryption), and cloud-managed KMS at the volume layer — and the right answer is almost never “pick one.” It is “pick which one solves which threat, and document the gap so the auditor sees you thought about it.”
What’s happening
Encryption at rest defends against a narrow threat: an adversary who obtains the storage medium and reads it offline. It does not defend against an adversary who obtains a running process on the host, because by then the kernel has the keys mounted. It does not defend against an adversary who obtains a cloud-console credential, because the cloud KMS will decrypt cheerfully for any caller with the right IAM grant. Picking an encryption pattern is picking which version of the offline-storage threat you are defending against, and which key-custody model survives your audit.
LUKS on the block device is the Linux kernel’s standard full-disk encryption layer, built on dm-crypt. The key is a passphrase or keyfile that unlocks a master key stored in the LUKS header on disk. The keyfile typically lives on a separate boot partition or is delivered at boot from a network source (Clevis + Tang, for example). LUKS encrypts everything written to the block device — the filesystem itself is unaware. What it defends against well: a stolen physical disk or a cloud-snapshot leaked to an untrusted party. What it does not defend against: a running attacker with root, or a cloud provider that has access to the live VM memory.
Filesystem-level encryption — practically, this is either ZFS native encryption (per-dataset keys), eCryptfs on top of an existing filesystem (deprecated but still around), or fscrypt for ext4/F2FS. The key custody is per-dataset, which means a single filesystem can hold both encrypted and unencrypted regions with different keys. ZFS native encryption is the production-grade option in this category and is what we deploy when key custody needs to be granular — for example, a multi-tenant box where each tenant gets a dataset and a key the operator can independently revoke without re-encrypting everybody else’s data. The defensive posture is broadly similar to LUKS, with the operational difference that revoking one tenant’s key does not require a full re-encrypt of the volume.
Cloud-managed KMS at the volume layer — EBS encryption, GCE persistent-disk encryption, Azure Disk Encryption with customer-managed keys. The cloud provider owns the encryption layer; you own the key in their KMS. The key never leaves the KMS — operations are mediated by IAM policies the cloud provider enforces. What this defends against very well: a malicious operator inside the cloud provider stealing a physical disk (the encryption is done before the data hits the disk, with a key the operator does not have direct access to). What it does not defend against: a compromise of your own cloud account, because a compromised principal with KMS permissions can decrypt at will.
The honest summary is that LUKS and ZFS native encryption are stronger against the cloud-provider-insider threat (because the cloud provider does not hold the key) but weaker operationally (you carry the key-custody burden, and the boot-time key-unlock dance is a source of outages). Cloud KMS is stronger operationally (the cloud provider holds the lifecycle and you cannot easily lose the key) but the cloud provider can decrypt your volumes if compelled by warrant or a malicious internal actor. For most managed-cloud workloads, the practical answer is cloud KMS at the volume layer for the baseline, plus LUKS or ZFS native encryption for specific datasets where the threat model demands a key the cloud provider does not hold.
How to verify
Three quick checks to confirm the posture matches the description of services.
LUKS:
# Confirm the device is LUKS-encrypted
sudo cryptsetup isLuks /dev/nvme1n1 && echo "yes" || echo "no"
# Inspect the LUKS header — cipher, key-slot count, hash, MK iterations
sudo cryptsetup luksDump /dev/nvme1n1
# Confirm the data device is mapped through dm-crypt
sudo dmsetup info /dev/mapper/data | grep -E '(crypt|Open count)'
# Confirm the keyfile path is restricted (not world-readable, not in a backup that
# travels to a different security zone)
ls -l /etc/luks-keys/data.key
ZFS native encryption:
# Confirm the dataset is encrypted
sudo zfs get encryption,keystatus,keylocation tank/customer-a
# Output you want to see:
# tank/customer-a encryption aes-256-gcm
# tank/customer-a keystatus available
# tank/customer-a keylocation prompt | file:///etc/zfs/keys/customer-a.key
# Confirm the key can be unloaded without affecting other datasets
sudo zfs unload-key tank/customer-a
sudo zfs load-key tank/customer-a
Cloud KMS at volume layer (AWS example):
# Confirm every attached EBS volume is encrypted and identify the KMS key
aws ec2 describe-volumes \
--filters Name=attachment.instance-id,Values=$(curl -s http://169.254.169.254/latest/meta-data/instance-id) \
--query 'Volumes[].{Id:VolumeId,Enc:Encrypted,Key:KmsKeyId}' \
--output table
# Confirm KMS key rotation is enabled (annual auto-rotate)
aws kms get-key-rotation-status --key-id alias/prod-ebs
# Confirm the IAM grant on the key — who can decrypt
aws kms get-key-policy --key-id alias/prod-ebs --policy-name default \
| jq '.Policy | fromjson | .Statement[] | select(.Action[]? | test("Decrypt"))'
If any of these returns a result that does not match what your description of services says, the description is wrong. Auditors find these mismatches by running exactly these commands.
The fix
There is no single “fix” — there is a decision matrix and three configuration recipes that come out of it. Run the matrix once, write down the result, and ship the runbook that implements it.
Step 1 — pick the baseline. If your environment is in a major cloud, the baseline is cloud KMS at the volume layer. Free, on by default in most regions, no operational burden. Document the KMS key, the rotation policy, and the IAM grants.
Step 2 — identify the datasets that need a key the cloud provider does not hold. Typical candidates: secrets and keys themselves (vault data files), customer documents under a contractual obligation that names key custody, jurisdiction-sensitive data where the customer contract requires the encryption key to remain under your control. For these, layer LUKS or ZFS native encryption on top of the cloud-managed volume.
Step 3 — decide on key-custody mechanics. A LUKS passphrase that has to be typed at every boot is a recipe for failed reboots at 3 AM. The production-grade choices are Clevis + Tang (network-bound disk encryption, where the LUKS volume unlocks if it can reach a Tang server on your network), or a key delivered from a secrets manager via cloud-init with an IAM constraint that times out after first boot. For ZFS, the keylocation=https://... option lets you point at a key-server endpoint that requires the host’s IAM identity.
The installer below sets up LUKS-on-EBS with Clevis-Tang network unlocking for a data volume, on top of an EBS volume that is itself encrypted with a customer-managed KMS key. That is the two-layer pattern: cloud KMS protects against the cloud-provider-insider threat for the bulk of data, LUKS-on-Tang protects the data volume against a cloud-account compromise that lifts a snapshot (because Tang lives in your network, not the snapshot).
#!/usr/bin/env bash
set -euo pipefail
### Two-layer encryption-at-rest installer for a data volume
### Outer layer: cloud KMS (AWS EBS / GCE PD / Azure CMK) — done at volume creation
### Inner layer: LUKS with Clevis+Tang network unlock
### Run as root on AlmaLinux 9 / RHEL 9
if [[ "$(id -u)" -ne 0 ]]; then
echo "Run as root."
exit 1
fi
# === EDIT PER NODE ===
DATA_DEV="/dev/nvme1n1" # the cloud-attached, KMS-encrypted volume
DATA_NAME="data" # logical name (becomes /dev/mapper/data)
MOUNTPOINT="/var/lib/app"
TANG_SERVERS=("https://tang-a.acme.internal" "https://tang-b.acme.internal")
KEYFILE="/etc/luks-keys/${DATA_NAME}.key"
# =====================
echo "==> Confirming the cloud volume is KMS-encrypted"
INSTANCE=$(curl -s http://169.254.169.254/latest/meta-data/instance-id)
aws ec2 describe-volumes \
--filters Name=attachment.instance-id,Values=${INSTANCE} \
--query "Volumes[?Attachments[?Device=='/dev/sdf']].{Enc:Encrypted,Key:KmsKeyId}" \
--output table
read -p "KMS encryption confirmed? (yes/no) " ANSWER
[[ "$ANSWER" == "yes" ]] || { echo "Aborting — fix the outer layer first."; exit 1; }
echo "==> Installing cryptsetup + Clevis"
dnf -y install cryptsetup clevis clevis-luks clevis-systemd jq
echo "==> Generating a 64-byte random LUKS keyfile"
mkdir -p /etc/luks-keys
chmod 700 /etc/luks-keys
dd if=/dev/urandom of="$KEYFILE" bs=64 count=1
chmod 400 "$KEYFILE"
echo "==> Formatting ${DATA_DEV} as LUKS2"
cryptsetup luksFormat --type luks2 \
--cipher aes-xts-plain64 --key-size 512 \
--hash sha512 --pbkdf argon2id \
--key-file "$KEYFILE" \
--batch-mode "$DATA_DEV"
echo "==> Opening the LUKS device"
cryptsetup luksOpen --key-file "$KEYFILE" "$DATA_DEV" "$DATA_NAME"
echo "==> Creating XFS on the LUKS device"
mkfs.xfs -L "${DATA_NAME}" "/dev/mapper/${DATA_NAME}"
echo "==> Binding LUKS keyslot to Tang (network-bound disk encryption)"
for srv in "${TANG_SERVERS[@]}"; do
echo " binding to $srv"
clevis luks bind -d "$DATA_DEV" \
-k "$KEYFILE" \
tang "{\"url\":\"${srv}\"}"
done
echo "==> Enabling clevis-luks-askpass.path for boot-time unlock"
systemctl enable clevis-luks-askpass.path
echo "==> Writing /etc/crypttab"
UUID=$(blkid -s UUID -o value "$DATA_DEV")
cat >> /etc/crypttab <<EOF
${DATA_NAME} UUID=${UUID} none _netdev,nofail
EOF
echo "==> Writing /etc/fstab"
mkdir -p "$MOUNTPOINT"
cat >> /etc/fstab <<EOF
/dev/mapper/${DATA_NAME} ${MOUNTPOINT} xfs defaults,_netdev,nofail 0 2
EOF
echo "==> Mounting"
mount "$MOUNTPOINT"
echo
echo "========================================"
echo "DONE — two-layer encryption active on ${DATA_DEV}"
echo "========================================"
echo "Outer: cloud KMS (managed by cloud IAM)"
echo "Inner: LUKS2 aes-xts-plain64 + Tang network-bound"
echo "Reboot test:"
echo " reboot ; after boot, ${MOUNTPOINT} must be mounted only if Tang is reachable"
echo "Audit evidence:"
echo " cryptsetup luksDump ${DATA_DEV}"
echo " clevis luks list -d ${DATA_DEV}"
For the auditor, the description of services lands cleanly: “Data at rest is encrypted in two layers. The cloud provider’s volume encryption uses a customer-managed KMS key with annual rotation and IAM-controlled access. Sensitive datasets carry a second layer of LUKS2 encryption with the key delivered at boot via Clevis-Tang from servers under our exclusive control. Key rotation cadence and recovery procedures are documented in the runbook.” The auditor’s follow-up is to ask for evidence that the configuration matched the description on a specific date in the window, and the SOC 2 evidence-collection cron picks it up daily.
The trap to avoid is documenting a two-layer posture and operating only the outer layer because the inner layer broke a reboot six months ago and somebody silently removed it. Run the verification commands in the daily evidence collection. If cryptsetup status does not show the device mapped on the date the auditor samples, the description of services is materially wrong.
For an environment where the encryption posture is part of the contractual obligation — Quebec Law 25 PIA exhibits, fintech sub-processor agreements, healthcare side letters — operate the stack under Managed Cloud Ops with the encryption verification wired into the daily evidence cron, or open a scoping conversation about a two-layer build for your regulated workload.