Skip to main content

Disk Encryption

When setting up Anatase, you were given the option to enter a hard drive unlock password. If you entered that password, your hard drive now requires a password to unlock during boot. You may wish to automate this process, especially if you are on a handheld.

info

It is not possible to encrypt your hard disk after installing Anatase. If you want hard drive encryption, you will need to reinstall Anatase again.

Configuring Autounlock​

Typing your password out every time becomes annoying. The underlying encryption scheme used in Linux is called LUKS and Anatase comes with a few LUKS aliases that allow you to setup auto unlock, backed by TPM security modules or FIDO keys.

Remembering your Password​

First, after you set up autounlock and a few months pass, you may feel like you are forgetting your password. You can force a dummy unlock command that will ask you for your password:

$ remindme
No usable token is available.
Enter passphrase for /dev/nvme0n1p3:
Key slot 0 unlocked.
Command successful.
info

The first time you type the commands that follow you will enter your hard drive password. Afterwards, a custom slot will be created with a secure keyphrase stored in your root partition (/var) and owned by root. This allows you to run these commands without entering your hard drive password afterwards. Since an attacker with root access can already steal your data, also getting your hard drive key is not that much bigger of a compromise.

Using FIDO Keys​

A FIDO key is a security module that is typically provided as a small USB stick. It can answer security challenges and in such a way where it can be securely bound to unlocking your hard disk. Use the following to setup FIDO unlock.

# Enroll a FIDO key
# FIDOUpdate
fidou
# A LED on your FIDO key will illuminate. Touch it twice to confirm.

# Unenroll all FIDO keys
# FIDOClear
fidoc

The enrollment options are configured such that if your key supports fingerprint authentication, it will be required to log in. If it is PIN only, then the PIN is not required. Regardless, you will always need to touch your FIDO key for your device to boot. This is a requirement of the underlying protocol that prevents attackers from forging requests if they get access to your device. FIDO keys are not bypassable. If you lose your key and you forget your password your data is gone. An attacker without your FIDO key will never be able to bypass the authentication without knowing your password.

Using TPM for unlocking​

A TPM is a security module on your device that is specialized at holding encryption keys. This allows you to autologin while certain conditions are met, and without storing your encryption key on your hard drive, after which point it is exposed and encryption is meaningless. Use the following to setup TPM unlock.

# Enroll a TPM slot (also run this if you are asked for your password again)
# TPMUpdate
tpmu
# Unenroll a TPM slot
# TPMClear
tpmc

The default PCR policy is PCRS="0+2+3+5+7+14". A PCR is an append only register in the TPM that system processes can modify by extending. A PCR policy combines the values of multiple PCRs at a certain point to derive a secret. Even if one of them does not match, the secret becomes different and your drive no longer unlocks.

This means that once something like your partition setup (PCR 5) or your MOK keys (PCR 14) change and are enrolled in PCRs by your BIOS and your shim during boot respectively, it is not possible to change them to previous values until your computer restarts.

The default policy will invalidate when you update your BIOS, change its settings, enroll new secure boot keys, or change partitioning setup. Then, you will be asked for your password. If you want to mess with your partitioning setup, test custom kernels, or otherwise, without triggering a password prompt, you can do:

export PCRS=""
tpmu

Or, you can reference this link to derive your own policy. For example:

export PCRS="7,14"
tpmu

To only bind to secure boot. Do note, that for example, if you only bind to 7, 14, someone can just download the Anatase ISO, start it, and then unlock your drive. Which brings us to:

warning

Currently, TPM unlock is bypassable by a skilled attacker. This is true in Anatase and in every Secure Boot Linux distribution that supports TPM unlock. Anatase makes this as annoying as possible for attackers to do such as by binding to your partitioning table but it is possible. Consider disabling TPM unlock when crossing borders or unsafe areas.