cfbs add inventory-fde
Full disk encryption (FDE) protects data at rest by encrypting entire block devices. This module detects mounted volumes backed by dm-crypt (LUKS1, LUKS2, or plain dm-crypt) on Linux systems and reports whether all, some, or none of the non-virtual block device filesystems are encrypted.
Basic detection (encryption status, method, volume lists) is performed entirely through virtual filesystem reads (/sys/block/ and /proc/mounts).
When dmsetup and cryptsetup are available, the module additionally reports the active cipher and LUKS keyslot details (per-keyslot cipher and PBKDF algorithm).
/sys/block/dm-*/sys/block/dm-N/dm/uuidCRYPT- prefix in the UUID/proc/mounts to find all non-virtual block device mounts (excluding loop devices)dmsetup is available, reads the active cipher from dmsetup table for each crypt devicecryptsetup is available, reads LUKS keyslot metadata (cipher and PBKDF per slot) via cryptsetup luksDumpyes if all non-virtual block device filesystems are encrypted, partial if some are encrypted and some are not, no if none are encrypted.LUKS2, LUKS1, PLAIN. Empty list when no encryption is found./ : aes-xts-plain64. Requires dmsetup./ : 0:aes-xts-plain64/argon2id. Requires cryptsetup. Not available for plain dm-crypt (no keyslots).A system with LUKS2-encrypted root but unencrypted /boot and /boot/efi:
$ sudo cf-agent -Kf ./inventory-fde.cf --show-evaluated-vars=inventory_fde
Variable name Variable value Meta tags Comment
inventory_fde:main.fde_enabled partial source=promise,inventory,attribute_name=Full disk encryption enabled
inventory_fde:main.fde_method {"LUKS2"} source=promise,inventory,attribute_name=Full disk encryption methods
inventory_fde:main.fde_volumes {"/"} source=promise,inventory,attribute_name=Full disk encryption volumes
inventory_fde:main.unencrypted_volumes {"/boot","/boot/efi"} source=promise,inventory,attribute_name=Unencrypted volumes
inventory_fde:main.fde_volume_cipher {"/ : aes-xts-plain64"} source=promise,inventory,attribute_name=Full disk encryption volume ciphers
inventory_fde:main.fde_keyslot_info {"/ : 0:aes-xts-plain64/argon2id"} source=promise,inventory,attribute_name=Full disk encryption keyslot info
A helper script is included to create and tear down a LUKS2 test volume on a loopback device:
sudo ./test-encrypted-volume.sh setup # Create and mount test volume
sudo cf-agent -KIf ./inventory-fde.cf --show-evaluated-vars=inventory_fde
sudo ./test-encrypted-volume.sh teardown # Clean up
/sys/block/ and /proc/mounts)dmsetup and/or cryptsetup (typically available on systems with dm-crypt)This module has no dependencies