I have been asked to implement disk encryption on a machine that needs to be able to run unattended. The machine has two disks. The first disk has a boot partition and an OS partition, while the second disk only has one partition and is used for storage for an application. The goal is to protect the data in the storage partition from being read, should someone decide to steal the disks.
My plan is to use Linux's dm-crypt module to encrypt the OS and storage partitions. I figure that it makes the most sense to use a key for each encrypted partition. However, I'm struggling to figure out the best way to store each key.
For the key for the storage partition, it seems safe to store it in the OS partition. However, it seems that the only option for storing the key for the OS partition is to keep it in the boot partition. It would be really nice if there were some kind of TPM or other storage local to the machine, but unfortunately there is no other storage available.
Therefore, since I'll need to use an initramfs to decrypt the OS disk anyway, I figured I would store the key for the OS partition in the initramfs, which would get embedded into the kernel, which would be stored in the boot partition. This would prevent the data from being read from some random person who happens to feel like stealing some disks. However, I realize that this isn't ideal, because a sufficiently knowledgeable attacker would be able to extract the initramfs from the kernel, and extract the key from the initramfs image.
The way I see it, no matter how complex a scheme I can come up with, I need to be able to tell the machine how to carry out the decryption routine; an attacker needs only to read the decryption routine to determine how to decrypt the system.
With the storage available, is there a better way that I can encrypt the partitions that will be more resilient against an attacker who has possession of the disks?