Score:0

How do you enforce a custom password policy on LUKS FDE (Ubuntu 22)?

ar flag

I need to enforce a strong custom password policy for LUKS FDE on Ubuntu 22.

I have successfully enforced it on the user account level by modifying /etc/pam.d/common-password. But the restrictions in this file do not get applied when changing a LUKS password via cryptsetup. cryptsetup seems to completely ignore this file, and I cannot find any information about applying custom password requirements to LUKS specifically.

Is there a way I can achieve this? This is probably a niche question but it is a hard requirement for my organization.

EDIT: Modifying /etc/security/pwquality.conf does not seem to work either, at least not on its own -- it does check for pw quality when changing the root password, but not for the cryptsetup commands specifically, when changing a LUKS keyslot pw.

In some of the docs I see this:

   --force-password
          Do not use password quality checking for new LUKS passwords.

          This   option   applies   only  to  luksFormat,  luksAddKey  and
          luksChangeKey and is ignored  if  cryptsetup  is  built  without
          password quality checking support.

          For  more info about password quality check, see the manual page
          for pwquality.conf(5) and passwdqc.conf(5).

This is interesting. The implication here is that Ubuntu's cryptsetup has been built without "password quality checking support."

So I guess maybe the question is, is there a way to enable password quality check in cryptsetup, by altering some kind of config or running a command? Or is this parameter hard-coded into Ubuntu's cryptsetup implementation, and unable to be modified?

Score:0
cn flag

It looks like cryptosetup makes use of libpwquality which is different to the PAM files you were looking at. It's config file is usually found at /etc/security/pwquality.conf.

And the man page is here

fastraul avatar
ar flag
Thanks, I noticed this as well over the weekend. Unfortunately modifications to this file to not get applied to the cryptsetup command, at least on Ubuntu with out-of-the-box FDE.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.