Jammy clevis forces argon2id for keyslots

Bug #2073429 reported by Kyler Hornor
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
clevis (Ubuntu)
New
Undecided
Unassigned
Jammy
In Progress
High
Ghadi Rahme

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.

Tags: patch
Revision history for this message
Kyler Hornor (kylerhornor) wrote :

I think I made the patch file correctly..

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "luks.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Ghadi Rahme (ghadi-rahme) wrote :

Attached is the patch for Jammy. The fix is already available is newer releases

description: updated
Changed in clevis (Ubuntu Jammy):
assignee: nobody → Ghadi Rahme (ghadi-rahme)
importance: Undecided → High
status: New → In Progress
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.