[Bug 2073429] Re: Jammy clevis forces argon2id for keyslots
Ghadi Rahme
2073429 at bugs.launchpad.net
Mon Sep 2 06:43:50 UTC 2024
Hello Mauricio,
Thank you for the review!
I have applied the changes requested:
- undone the refresh of the other patch (apologies for not noticing that earlier)
- renamed the patch to contain the lp<bug number> prefix
- removed the "Author:" field and incorporated it in the "From:" field
I will work on a write up to test if argon2id is still functional after
this change. I will first need to come up with a test methodology.
** Patch added: "jammy-clevis.debdiff"
https://bugs.launchpad.net/ubuntu/+source/clevis/+bug/2073429/+attachment/5812119/+files/jammy-clevis.debdiff
--
You received this bug notification because you are a member of Ubuntu
Sponsors, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/2073429
Title:
Jammy clevis forces argon2id for keyslots
Status in clevis package in Ubuntu:
Fix Released
Status in clevis source package in Jammy:
In Progress
Status in clevis source package in Noble:
Fix Released
Status in clevis source package in Oracular:
Fix Released
Bug description:
Thank you @kylerhornor for the original bug report
[impact]
current version of clevis on jammy uses argon2id instead of pbkdf2 for the encryption algorithm which is not approved by the NIST. An upstream commit (https://github.com/latchset/clevis/commit/71596307516ce2367e6303bd7f7ae7b180b29a35) did make clevis use pbkdf2 instead of argon2id to avoid OOM scenarios on systems with constrained memory. So this fix also resolves this issue on jammy. Noble currently has that fix.
Although argon2id is considered more secure, the maintainer has confirmed that currently the entropy used by clevis is high enough to the point where pbkdf2 is considered secure enough to replace argon2id. Please refer to comment #5 on this links for the maintainers' response:
https://bugzilla.redhat.com/show_bug.cgi?id=1979256
Also the bugzilla thread above is a good read for anyone interested in
knowing more about why this change was made.
[Test Plan]
This test plan was done on a libvirt/kvm virtual machine.
1. setup a jammy VM. Attach to it a tpm2 module (software or pass-
through) and an extra drive.
2. install clevis, clevis-tpm2 and clevis-luks:
$ sudo apt install clevis clevis-tpm2 clevis-luks
3. using lsblk note the name of the extra drive that was attached to
the VM. In this case vdb will be used as an example
4. run the following commands to setup partitions on the drive:
$ sudo parted /dev/vdb -- mklabel gpt
$ sudo parted /dev/vdb -- mkpart primary 0% 100%
5. setup luks and open the drive:
$ sudo cryptsetup luksFormat /dev/vdb1
$ sudo cryptsetup luksOpen /dev/vdb1 <name>
replace <name> with a name of your choosing also note how vdb1 is
used in this step instead of vdb since we are formatting the partition
created in step 4. Verify these values on your system before running
the commands.
6. finally bind the drive with clevis using tpm2:
$ sudo clevis luks bind -d /dev/vdb1 tpm2
'{"hash":"sha256","key":"rsa","pcr_bank":"sha256","pcr_ids":"6"}'
7. Verify the encryption algorithm being used:
sudo cryptsetup luksDump /dev/vdb1 | grep PBKDF:
Currently this will show as argon2id but after applying the patch I
backported from upstream and repeating step 6 it should show pbkdf2 in
the new keyslot
[where problems could occur]
* The machine could fail to create the new keyslot
* Although the maintainer says that the entropy is high enough for pbkdf2 to be secure it might not be as secure still as argon2id even tho it is NIST compliant.
[Original Description]
Hello,
clevis released with version 18 on jammy (22.04). For reasons that are
a bit beyond me, the cryptsetup call inside of clevis creates keyslots
using argon2id as the pbkdf. While most folks would say this is
preferable, NIST still has not approved it and it is thus incompatible
with fips 140-3 at this time.
Oddly enough, there was an upstream commit that was implemented to
help with an OOM condition that accidentally forced pbkdf2 rather than
argon2id.
Commit found here:
https://github.com/latchset/clevis/commit/71596307516ce2367e6303bd7f7ae7b180b29a35
Ideally, we need to either just bring that commit back to the jammy
version, or get to the root cause of why cryptsetup in that exact
scenario prefers argon2id.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/clevis/+bug/2073429/+subscriptions
More information about the Ubuntu-sponsors
mailing list