STATE and EPHEMERAL partitions:
STATEcontains the most sensitive node data: secrets and certs.EPHEMERALmay contain sensitive workload data.
cryptsetup utility.
The operating system will run additional setup steps when encryption is enabled.
If the disk encryption is enabled for the STATE partition, the system will:
- Save
STATEencryption config as JSON in theMETApartition. - Before mounting the
STATEpartition, load encryption configs either from the machine config or from theMETApartition. Note that the machine config is always preferred over theMETAone. - Before mounting the
STATEpartition, format and encrypt it. This occurs only if theSTATEpartition is empty and has no filesystem.
EPHEMERAL partition, the system will:
- Get the encryption config from the machine config.
- Before mounting the
EPHEMERALpartition, encrypt and format it. This occurs only if theEPHEMERALpartition is empty and has no filesystem.
static- encrypt with the static passphrase (weakest protection, forSTATEpartition encryption it means that the passphrase will be stored in theMETApartition).nodeID- encrypt with the key derived from the node UUID (weak, it is designed to protect against data being leaked or recovered from a drive that has been removed from a Talos Linux node).kms- encrypt using key sealed with network KMS (strong, but requires network access to decrypt the data.)tpm- encrypt with the key derived from the TPM (strong, when used with SecureBoot).
Note:nodeIDencryption is not designed to protect against attacks where physical access to the machine, including the drive, is available. It uses the hardware characteristics of the machine in order to decrypt the data, so drives that have been removed, or recycled from a cloud environment or attached to a different virtual machine, will maintain their protection and encryption. Note: When using KMS encryption forSTATEpartition the network configuration can’t be provided via the machine configuration, as KMS requires network connectivity beforeSTATEpartition is unlocked. Also custom CA certificates cannot be used for the KMS server, as these are stored in theSTATEpartition as well.
Configuration
Disk encryption is disabled by default. For system volumes, disk encryption is configured with theVolumeConfig machine configuration document,
while for user volumes it is configured with the UserVolumeConfig document.
To enable disk encryption you should patch the machine configuration, for example for the STATE and EPHEMERAL partitions using nodeID encryption:
UserVolumeConfig kind:
Encryption Keys
Note: What the LUKS2 docs call “keys” are, in reality, a passphrase. When this passphrase is added, LUKS2 runs argon2 to create an actual key from that passphrase.LUKS2 supports up to 32 encryption keys and it is possible to specify all of them in the machine configuration. Talos always tries to sync the keys list defined in the machine config with the actual keys defined for the LUKS2 partition. So if you update the keys list, keep at least one key that is not changed to be used for key management. When you define a key you should specify the key kind and the
slot:
Encryption Key Kinds
Talos supports two kinds of keys:nodeIDwhich is generated using the node UUID and the partition label (note that if the node UUID is not really random it will fail the entropy check).staticwhich you define right in the configuration.kmswhich is sealed with the network KMS.tpmwhich is sealed using the TPM and protected with SecureBoot.
Note: TheEvery key kind also supportsSTATEvolume encryption configuration will be stored cleartext inMETAvolume, so it is not secure to usestatickeys forSTATEvolume. Other volumes can usestatickeys as long asSTATEpartition itself is encrypted.
lockToState option, which means that the key will be locked to the contents of the STATE partition:
- if the
STATEpartition is wiped/replaced with new contents, locked toSTATEvolumes will not be unlockable anymore. - Talos Linux generates a random salt, and stores in the
STATEpartition, which will be mixed into the key derivation function.
lockToState for the EPHEMERAL partition and user volumes, so that the data on these partitions is not accessible if the STATE partition is wiped or replaced.
If you would like non-STATE volumes to survive STATE partition wipe, do not enable lockToState option.
Key Rotation
In order to completely rotate keys, it is necessary to dotalosctl apply-config a couple of times, since there is a need to always maintain a single working key while changing the other keys around it.
Key rotation can only be handled after a reboot, so the system can re-encrypt the partitions with the new keys, and some encryption types (TPM) can only be used after the initial boot.
So, for example, first add a new key:
Going from Unencrypted to Encrypted and Vice Versa
Ephemeral Partition
There is no in-place encryption support for the partitions right now, so to avoid losing data only empty partitions can be encrypted. As such, migration from unencrypted to encrypted needs some additional handling, especially around explicitly wiping partitions.apply-configshould be called with--mode=staged.- Partition should be wiped after
apply-config, but before the reboot.
--mode=staged:
State Partition
Calling wipe against the STATE partition will make the node lose the config, so the previous flow is not going to work. The flow should be to first wipe the STATE partition:apply-config with --insecure flag: