SYSTEMD-CRYPTENROLL(1) systemd-cryptenroll SYSTEMD-CRYPTENROLL(1) (NAME) systemd-cryptenroll - LUKS2 (SYNOPSIS) systemd-cryptenroll [OPTIONS...] [DEVICE] (DESCRIPTION) systemd-cryptenroll LUKS2 . : 1. PKCS#11 RSA EC ( YubiKey) 2. FIDO2 "hmac-secret" ( FIDO2 YubiKey) 3. TPM2 4. (passphrase) 5. (Recovery keys). . . QR . LUKS2 . . (wipe) . . LUKS2 JSON LUKS2 . systemd-cryptsetup /var/ . ( /var/ .) PCR TPM2 PCR ( "unseal" ) / . --tpm2-pcrs= . : PCR . . kernel+initrd kernel+initrd . --tpm2-public-key= --tpm2-public-key-pcrs= --tpm2-signature= . PCR UAPI.7 Linux TPM PCR Registry[1] . PCR systemd . Table 1. Well-known PCR Definitions +----+---------------------+-----------------------------------------------+ |PCR | | | +----+---------------------+-----------------------------------------------+ |0 | platform-code | | | | | | | | | | | | | | | | | | | | | | +----+---------------------+-----------------------------------------------+ |1 | platform-config | | | | | | | | | / | | | | | | | | | | | | | | | | | | | | | | | | // | | | | | +----+---------------------+-----------------------------------------------+ |2 | external-code | | | | | | | | | | | | | Option ROM | | | | | | | | | +----+---------------------+-----------------------------------------------+ |3 | external-config | | | | | | | | | | | | | | | | | | | | | | | | | | +----+---------------------+-----------------------------------------------+ |4 | boot-loader-code | | | | | | | | | | | | | PE | | | | | | | | | | | | | | | | | | | | | | | | . | | | | sd-stub(7) | | | | | | | | ESP | | | | | | | | | | | | ( systemd-sysext(8) | | | | ). | +----+---------------------+-----------------------------------------------+ |5 | boot-loader-config | /GPT | | | | | | | | | | | | | | | | | | | | | +----+---------------------+-----------------------------------------------+ |7 | secure-boot-policy | (Secure | | | | Boot) | | | | UEFI SecureBoot | | | | / | | | | | | | | (PK KEK | | | | db dbx ...) | | | | | | | | . | +----+---------------------+-----------------------------------------------+ |9 | kernel-initrd | | | | | initrd | | | | | | | | PCR | | | | | | | | . | +----+---------------------+-----------------------------------------------+ |10 | ima | IMA | | | | | | | | PCR | | | | | | | | . | +----+---------------------+-----------------------------------------------+ |11 | kernel-boot | systemd-stub(7) | | | | ELF initrd | | | | | | | | PE | | | | | | | | PCR | | | | | | | | . | | | | systemd-pcrphase.service(8) | | | | | | | | | | | | | | | | | | | | PCR . | +----+---------------------+-----------------------------------------------+ |12 | kernel-config | systemd-boot(7) | | | | PCR | | | | | | | | . systemd-stub(7) | | | | | | | | | | | | ( | | | | | | | | | | | | | | | | PE | | | | ) | | | | | | | | | | | | PCR | | | | . | +----+---------------------+-----------------------------------------------+ |13 | sysexts | systemd-stub(7) | | | | systemd-sysext(8) | | | | | | | | | | | | PCR | | | | . | +----+---------------------+-----------------------------------------------+ |14 | shim-policy | shim | | | | "MOK" | | | | | | | | PCR | | | | | | | | . | +----+---------------------+-----------------------------------------------+ |15 | system-identity | systemd-cryptsetup(8) | | | | | | | | LUKS | | | | | | | | PCR | | | | . | | | | systemd-pcrmachine.service(8) | | | | machine-id(5) PCR | | | | | | | | . systemd-pcrfs@.service(8) | | | | UUID | | | | | | | | UUID | | | | | | | | | | | | /var/ | | | | PCR | | | | | | | | . | +----+---------------------+-----------------------------------------------+ |16 | debug | (Debug) | +----+---------------------+-----------------------------------------------+ |23 | application-support | | | | | (Application | | | | Support) | +----+---------------------+-----------------------------------------------+ PCR 7 11 14 ( shim/MOK) . PCR 0 2 PCR 7 . / : . UAPI.7 Linux TPM PCR Registry[1] . (LIMITATIONS) FIDO2 TPM2 . PKCS#11 PKCS#11 . (key roll-over) FIDO2 TPM2 . FIDO2 . FIDO2 systemd-cryptsetup (pre- flight) . FIDO2 (UV /) . PIN . PKCS#11 . (COMPATIBILITY) systemd . TPM2 FIDO2 PKCS#11 systemd . : o systemd-cryptsetup@.service(8) . o : systemd-cryptenroll systemd-cryptsetup . systemd-cryptenroll systemd-cryptsetup . systemd . (OPTIONS) (UNLOCKING) : --unlock-key-file=PATH / (stdin) . PATH . --key-file-offset= --key-file-size= . 252. --unlock-fido2-device=PATH FIDO2 / . hidraw FIDO2 ( /dev/hidraw1). "auto" ( ) . --fido2-device= . FIDO2 LUKS2 ( --fido2-parameters-in-header=no) . 253. --unlock-tpm2-device=PATH TPM2 / . TPM2 ( /dev/tpmrm0). "auto" TPM2 ( ) . 256. (SIMPLE ENROLLMENT) : --password / . cryptsetup luksAddKey --wipe-slot= . 248. --recovery-key . . QR . 248. PKCS#11 (PKCS#11 ENROLLMENT) PKCS#11 : --pkcs11-token-uri=URI PKCS#11 ( YubiKey). URI PKCS#11 X.509 . . "auto" URI . "list" PKCS#11 . PKCS#11 RSA EC LUKS2 . RSA JSON LUKS2 . . ECC ECDH : EC EC (shared secret) . . JSON LUKS2 . . . LUKS2 PKCS#11 pkcs11-uri= /etc/crypttab : myvolume /dev/sda1 none pkcs11-uri=auto systemd-cryptenroll /etc/crypttab crypttab(5) . 248. FIDO2 (FIDO2 ENROLLMENT) FIDO2 : --fido2-device=PATH FIDO2 "hmac-secret" ( YubiKey). hidraw FIDO2 ( /dev/hidraw1). "auto" ( ) . --unlock-fido2-device= . "list" FIDO2 . FIDO2 PKCS#11 . FIDO2 . LUKS2 FIDO2 fido2-device= /etc/crypttab : myvolume /dev/sda1 none fido2-device=auto systemd-cryptenroll /etc/crypttab crypttab(5) . 248. --fido2-credential-algorithm=STRING COSE . "es256" . "es256" "rs256" "eddsa". "es256" ECDSA NIST P-256 SHA-256 . "rs256" RSA PKCS#1.5 SHA-256 . "eddsa" EDDSA Curve25519 SHA-512 . (authenticator) . 251. --fido2-salt-file=PATH FIDO2 AF_UNIX (salt) HMAC FIDO2 . . 257. --fido2-parameters-in-header=BOOL FIDO2 FIDO2 (superblock) LUKS2 . "yes" . "no" fido2-cid= /etc/crypttab . crypttab(5) . 257. --fido2-with-client-pin=BOOL FIDO2 PIN ( "clientPin" FIDO2) . "yes" . (: "clientPin" / .) 249. --fido2-with-user-presence=BOOL FIDO2 ( "up" FIDO2) . "yes" . (: "up" / .) 249. --fido2-with-user-verification=BOOL FIDO2 ( "uv" FIDO2) . "no" . (: "uv" .) 249. TPM2 (TPM2 ENROLLMENT) TPM2 : --tpm2-device=PATH TPM2. TPM2 ( /dev/tpmrm0). "auto" TPM2 ( ) . "list" TPM2 . LUKS2 TPM2 tpm2-device= /etc/crypttab : myvolume /dev/sda1 none tpm2-device=auto systemd-cryptenroll /etc/crypttab crypttab(5) . --tpm2-pcrs= ( ) PCR TPM2 . 248. --tpm2-device-key=PATH TPM2 . TPM2 TPM2B_PUBLIC . --tpm2-device= TPM2 TPM2 . TPM2 . (Storage Root Key SRK) TPM2 . ( SRK) --tpm2-seal-key-handle= . systemd-tpm2-setup.service(8) SRK /run/systemd/tpm2-srk-public-key.tpm2b_public . systemd-analyze srk SRK TPM2 . systemd-analyze(1) . : systemd-analyze srk > srk.tpm2b_public 255. --tpm2-seal-key-handle=HANDLE (sealing) TPM () . "seal" () "unseal" () . "0x" . ("0x81000000"-"0x81ffffff") ("0x80000000"-"0x80ffffff") . TPM (context switching) TPM . (SRK) "0x81000001" . 0 . SRK TPM TPM . . 255. --tpm2-pcrs=PCR[+PCR...] PCR TPM2 ( ) --tpm2-device= . PCR 0...23 ":" ( PCR) "=" . PCR "+" . PCR ( ). PCR . : --tpm2-pcrs=boot-loader-code+platform-config+boot-loader-config PCR 4 1 5 . : --tpm2-pcrs=7:sha256 PCR 7 SHA256 . : --tpm2-pcrs=4:sha1=3a3f780f11a4b49969fcaa80cd6e3957c33b2275 PCR 4 SHA1 3a3f780f11a4b49969fcaa80cd6e3957c33b2275 PCR . 248. --tpm2-with-pin=BOOL TPM2 PCR TPM2 PIN . "no" . PIN . PIN (dictionary attack lockout) TPM . TPM systemd-cryptenroll . tpm2_getcap(1) tpm2_dictionarylockout(1) tpm2-tss . 251. --tpm2-public-key=PATH --tpm2-public-key-pcrs=PCR[+PCR...] --tpm2-signature=PATH PCR TPM2 . --tpm2-public-key= RSA PEM . tpm2-pcr-public-key.pem /etc/systemd/ /run/systemd/ /usr/lib/systemd/ ( ) . --tpm2-public-key-pcrs= PCR TPM2 ( --tpm2-pcrs= ). 11 ( PCR ). --tpm2-pcrs= --tpm2-public-key-pcrs= : PCR PCR . LUKS2 . --tpm2-pcrs= --tpm2-public-key-pcrs=boot-loader-code+system-identity. --tpm2-signature= PCR TPM2 systemd-measure(1) . tpm2-pcr-signature.json /etc/systemd/ /run/systemd/ /usr/lib/systemd/ . PCR . PCR . PCR . . 252. --tpm2-pcrlock=PATH pcrlock TPM2 . pcrlock systemd-pcrlock(8) . TPM2 pcrlock.json /run/systemd/ /var/lib/systemd/ . . 255. (OTHER OPTIONS) : --wipe-slot=SLOT[,SLOT...] (key slot) LUKS2 . : "all" ( ) "empty" ( ) "password" ( ) "recovery" ( ) "pkcs11" ( PKCS#11 ) "fido2" ( FIDO2 ) "tpm2" ( TPM2 ) . ( ) . . -- . : systemd-cryptenroll /dev/sda1 --wipe-slot=tpm2 --tpm2-device=auto --unlock-tpm2-device=auto TPM2 TPM2 LUKS2 . PKCS#11 FIDO2: systemd-cryptenroll /dev/sda1 --wipe-slot=pkcs11 --fido2-device=auto TPM2: systemd-cryptenroll /dev/sda1 --wipe-slot=empty --tpm2-device=auto 248. --list-devices . LUKS (symlink) . hmac-secret . 257. -h --help . --version . --no-pager (pager) . (CREDENTIALS) systemd-cryptenroll ImportCredential=/LoadCredential=/SetCredential= ( systemd.exec(5) ). : cryptenroll.passphrase cryptenroll.new-passphrase . 256. cryptenroll.tpm2-pin cryptenroll.new-tpm2-pin PIN TPM2 . 256. cryptenroll.fido2-pin FIDO2 PIN . 256. cryptenroll.pkcs11-pin PKCS#11 PIN . 256. (EXIT STATUS) 0 . (EXAMPLES) crypttab(5) systemd- measure(1) systemd-cryptenroll . (SEE ALSO) systemd(1) systemd-cryptsetup@.service(8) crypttab(5) cryptsetup(8) systemd-measure(1) (NOTES) 1. UAPI.7 Linux TPM PCR Registry https://uapi-group.org/specifications/specs/linux_tpm_pcr_registry systemd 261.2 SYSTEMD-CRYPTENROLL(1)