Replies: 2 comments 11 replies
-
Success was achieved by:
The reason for this is because systemd is built with a shared library, and when I tried to compile only cryptsetup separately, the shared library did not contain the necessary code for cryptsetup. I tried briefly with static linking too, but did not manage to get that working either. Was this the right approach? |
Beta Was this translation helpful? Give feedback.
-
Summary:
The dependency tree looks like this:
I do not think you need to enable the CLI of cryptsetup, so you could perhaps patch out the libpopt dependency, however, the systemd-cryptsetup target (i.e if you enable cryptsetup) also directly depends on libpopt for some reason (I have not explored the source code). I also think there is some truncation happening of the output of RPM build errors, at least for CMake (it seems to eat stderr from the whole sections, |
Beta Was this translation helpful? Give feedback.
-
Now that I feel relatively confident that I can build our own packages, I realised one thing that we will need which I am not sure how to achieve.
We need to enable cryptsetup in systemd to be able to use systemd-cryptsetup to unlock the data volume of the server. This is for a metal setup (if you have not deduced already) and we want to protect the data volume from the simple threat vector of removing the disk from the server and reading it somewhere else for now.
The idea is to encrypt the volume as part of the install step of Bottlerocket (when we write out the partition layout), enroll the key into the TPM and have systemd-cryptsetup automatically unlock it on first Bottlerocket boot (it is fine to leave root and boot unencrypted as they are protected by dm-verity and contain only the general OS).
The long term goal is to use this in combination with remote attestation to only unlock it if the node can prove it is pristine, but this will require quite a bit more engineering and for now we will focus on minimally viable encryption. :)
I would prefer not having to fork the entire core-kit to achieve this, but I must say that I cannot figure out how to achieve this without doing so by just browsing the code.
One alternative would perhaps be to copy the entire systemd package and build only cryptsetup and name it specifically "systemd-cryptsetup"?
Beta Was this translation helpful? Give feedback.
All reactions