This lecture provides a comprehensive overview of implementing full disk encryption using Lux (Linux Unified Key Setup) in conjunction with the Trusted Platform Module 2.0 (TPM 2.0) on Linux systems. The speaker, Susanne (aka "Bookworms"), delves into the intricacies of TPM, explaining its role in secure cryptographic key management and its integration into the Linux boot process. Key challenges are highlighted, including managing Platform Configuration Registers (PCRs) to maintain system integrity against changes, navigating dictionary attack lockouts, and wrestling with the often-undocumented complexities of SystemD tools like SystemD Crypt Enroll and SystemD Creds. The presentation also addresses practical configuration steps across different Linux distributions and bootloaders, points out the difficulties in debugging uninformative error messages, and emphasizes the critical security consideration that relying solely on TPM for decryption without a PIN can leave a system vulnerable to physical theft. The talk concludes that while TPM offers automatic, integrity-checked decryption, its robust implementation on Linux currently demands significant technical understanding and careful, often manual, maintenance.
Integrating TPM 2.0 for Linux Disk Encryption: Challenges and Practicalities
0:00 Introduction to TPM & Lux: The speaker, "Bookworms" (Susanne), introduces the topic of hard disk encryption (Lux) with TPM 2.0 on Linux, acknowledging its inherent complexity compared to Windows.
3:30 What is a TPM?: The Trusted Platform Module (TPM) 2.0 is a security chip (ISO IEC 1189) found in most modern devices, designed for secure cryptographic key management, random number generation, and data sealing. It features various internal hierarchies for different security contexts.
6:57 TPM in the Linux Boot Process: The TPM integrates into the UEFI, GRUB, and Linux boot sequence, allowing for secure initialization and storage of values. This enables automatic hard drive decryption and integrity verification of the entire boot chain.
8:57 Dictionary Attack Lockout: The TPM can enter a lockout state if too many incorrect decryption attempts are made, preventing further access. The speaker provides commands to check this status and methods to reset the lockout (once, increase attempts, or a full TPM reset, though the latter is risky).
10:47 Binding Encrypted Drives: The System Crypt Enroll command is used to bind an encrypted Lux volume to the TPM, with the TPM typically assigned to key slot 1.
12:12 Platform Configuration Registers (PCRs): PCRs store cryptographic checksums (SHA1 or SHA256) of boot components like the Secure Boot Policy, kernel, and initrd, used to ensure system integrity. However, these PCR values can change with system updates (e.g., Secure Boot certificates), necessitating manual updates or alternative strategies.
16:03 PCR Management & Alternatives: Users can manually update PCRs, choose not to use them, or create custom PCRs for specific integrity checks. As an alternative to PCRs, a TPM PIN or a recovery key (randomly generated and displayed with a QR code) can be used, though adding more passphrases can reduce overall encryption security.
21:16 Challenges with SystemD Tools: The speaker details frustrating experiences with SystemD Crypt Enroll and SystemD Creds, citing a lack of documentation, unclear error messages (e.g., "Protocol Error"), and difficulties in programmatically passing credentials, despite extensive investigation into source code and tests.
30:21 System Configuration Steps: Implementing TPM encryption requires specific configurations in SystemD (commenting out/expanding Crypttab entries depending on version), modifying initramfs (using Dracut or Indramfs Tools and rebuilding), and adapting GRUB parameters with TPM-specific options.
33:43 Debugging Difficulties: Debugging TPM configuration issues is challenging due to often uninformative Journal CTL error messages. An example of a cryptic "Auth HMAC fail" error (indicating an incorrect PIN) demonstrates the need for manual decoding.
37:12 Usability Issues: A specific usability flaw is highlighted where an incorrect TPM PIN entry can silently switch the prompt to request a password instead, causing user confusion.
39:01 Security Implications: A key takeaway is that relying solely on TPM for hard drive decryption without a PIN makes the system vulnerable to physical theft. An attacker can access all data if the computer is stolen and no other system components are changed, as the TPM would automatically unlock the drive.
39:53 Q&A Insights: Discussions covered topics like Unified Kernel Images (UKIs) (the speaker hasn't extensively explored them), the detailed differences and trade-offs between PCR7 and PCR11 for cold boot attack prevention, the ongoing struggles with SystemD Creds usability (issue reported but closed), and the speaker's lack of experience with advanced TPM authorization policies in distributions like OpenSUSE due to work focus on Ubuntu.