Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added LUKS reencryption support #2703

Merged
merged 1 commit into from
Jan 13, 2025
Merged

Added LUKS reencryption support #2703

merged 1 commit into from
Jan 13, 2025

Conversation

schaefi
Copy link
Collaborator

@schaefi schaefi commented Jan 9, 2025

Added rd.kiwi.oem.luks.reencrypt boot option consumed by the kiwi-repart dracut module. For OEM LUKS2 encrypted disk images. If set, reencrypts the disk prior an eventual resize and therefore creates a new key pool and master key. The reencryption is advisable if the image binary is not protected. With access to the image binary it's possible to extract the luks header which then allows to decrypt the data unless it was reencrypted. The reencryption process only runs if the checksum of the luks header still matches the one from the original disk image. Be aware that the reencryption will ask for the passphrase if the image has been built with an initial luks passphrase.

@schaefi schaefi self-assigned this Jan 9, 2025
@schaefi
Copy link
Collaborator Author

schaefi commented Jan 9, 2025

Integration test build for testing the reencryption is available here:

@schaefi schaefi force-pushed the re_encrypt_support branch from b6c740f to 868408a Compare January 9, 2025 16:37
@schaefi schaefi requested a review from davidcassany January 10, 2025 11:17
Copy link
Collaborator

@davidcassany davidcassany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Nit: Just wondering if sed shouldn't be required as part of the kiwi-lib. I know is is only used as part of the kiwi-repart through the luks library code, but from a dependency management I find the current approach obscure... I wonder if some of this logic should be organized differently in terms of dracut modules.

If I'd have to maintain this dracut module I'd grep around kiwi-repart module to check the tools in requires and remove anything that is not called within the module, assuming each module requires the tools it uses.

I know there is no easy solution and dracut modules proliferation is also a maintenance burden.

Probably I'd add a comment in code the explain this odd dependency if reorganizing the logic in a devoted module is too complex.

@schaefi
Copy link
Collaborator Author

schaefi commented Jan 10, 2025

Nit: Just wondering if sed shouldn't be required as part of the kiwi-lib

yeah you are absolutely right. I put them to the wrong place. Thanks and fixed

Added rd.kiwi.oem.luks.reencrypt boot option consumed by the
kiwi-repart dracut module. For OEM LUKS2 encrypted disk images.
If set, reencrypts the disk prior an eventual resize and therefore
creates a new key pool and master key. The reencryption is advisable
if the image binary is not protected. With access to the image
binary it's possible to extract the luks header which then allows to
decrypt the data unless it was reencrypted. The reencryption process
only runs if the checksum of the luks header still matches the one
from the original disk image. Be aware that the reencryption will
ask for the passphrase if the image has been built with an initial
luks passphrase.
@schaefi schaefi force-pushed the re_encrypt_support branch from 13f8517 to 2252087 Compare January 10, 2025 14:12
@schaefi schaefi merged commit 8c82847 into main Jan 13, 2025
14 checks passed
@schaefi schaefi deleted the re_encrypt_support branch January 13, 2025 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants