summaryrefslogtreecommitdiffstats
path: root/man/systemd-cryptenroll.xml
diff options
context:
space:
mode:
Diffstat (limited to 'man/systemd-cryptenroll.xml')
-rw-r--r--man/systemd-cryptenroll.xml153
1 files changed, 112 insertions, 41 deletions
diff --git a/man/systemd-cryptenroll.xml b/man/systemd-cryptenroll.xml
index 8fd885c..a47866b 100644
--- a/man/systemd-cryptenroll.xml
+++ b/man/systemd-cryptenroll.xml
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!--*-nxml-*-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
<refentry id="systemd-cryptenroll" xmlns:xi="http://www.w3.org/2001/XInclude" conditional='HAVE_LIBCRYPTSETUP'>
@@ -36,8 +36,8 @@
supports tokens and credentials of the following kind to be enrolled:</para>
<orderedlist>
- <listitem><para>PKCS#11 security tokens and smartcards that may carry an RSA key pair (e.g. various
- YubiKeys)</para></listitem>
+ <listitem><para>PKCS#11 security tokens and smartcards that may carry an RSA or EC key pair (e.g.
+ various YubiKeys)</para></listitem>
<listitem><para>FIDO2 security tokens that implement the <literal>hmac-secret</literal> extension (most
FIDO2 keys, including YubiKeys)</para></listitem>
@@ -61,6 +61,11 @@
<para>The tool supports only LUKS2 volumes, as it stores token meta-information in the LUKS2 JSON token
area, which is not available in other encryption formats.</para>
+ <para><command>systemd-cryptsetup</command> operates on the device backing <filename>/var/</filename> if
+ no device is specified explicitly, and no wipe operation is requested. (Note that in the typical case
+ where <filename>/var/</filename> is on the same file system as the root file system, this hence enrolls a
+ key into the backing device of the root file system.)</para>
+
<refsect2>
<title>TPM2 PCRs and policies</title>
@@ -222,13 +227,13 @@
<title>Limitations</title>
<para>Note that currently when enrolling a new key of one of the five supported types listed above, it is
- required to first provide a passphrase, a recovery key or a FIDO2 token. It's currently not supported to
- unlock a device with a TPM2/PKCS#11 key in order to enroll a new TPM2/PKCS#11 key. Thus, if in future key
- roll-over is desired it's generally recommended to ensure a passphrase, a recovery key or a FIDO2 token
- is always enrolled.</para>
+ required to first provide a passphrase, a recovery key, a FIDO2 token, or a TPM2 key. It's currently not
+ supported to unlock a device with a PKCS#11 key in order to enroll a new PKCS#11 key. Thus, if in future
+ key roll-over is desired it's generally recommended to ensure a passphrase, a recovery key, a FIDO2
+ token, or a TPM2 key is always enrolled.</para>
<para>Also note that support for enrolling multiple FIDO2 tokens is currently limited. When multiple FIDO2
- tokens are enrolled, <command>systemd-cryptseup</command> will perform pre-flight requests to attempt to
+ tokens are enrolled, <command>systemd-cryptsetup</command> will perform pre-flight requests to attempt to
identify which of the enrolled tokens are currently plugged in. However, this is not possible for FIDO2
tokens with user verification (UV, usually via biometrics), in which case it will fall back to attempting
each enrolled token one by one. This will result in multiple prompts for PIN and user verification. This
@@ -287,7 +292,7 @@
</varlistentry>
<varlistentry>
- <term><option>--unlock-key-file=</option><replaceable>PATH</replaceable></term>
+ <term><option>--unlock-key-file=<replaceable>PATH</replaceable></option></term>
<listitem><para>Use a file instead of a password/passphrase read from stdin to unlock the volume.
Expects the PATH to the file containing your key to unlock the volume. Currently there is nothing like
@@ -298,7 +303,7 @@
</varlistentry>
<varlistentry>
- <term><option>--unlock-fido2-device=</option><replaceable>PATH</replaceable></term>
+ <term><option>--unlock-fido2-device=<replaceable>PATH</replaceable></option></term>
<listitem><para>Use a FIDO2 device instead of a password/passphrase read from stdin to unlock the
volume. Expects a <filename>hidraw</filename> device referring to the FIDO2 device (e.g.
@@ -311,15 +316,36 @@
</varlistentry>
<varlistentry>
- <term><option>--pkcs11-token-uri=</option><replaceable>URI</replaceable></term>
+ <term><option>--unlock-tpm2-device=<replaceable>PATH</replaceable></option></term>
- <listitem><para>Enroll a PKCS#11 security token or smartcard (e.g. a YubiKey). Expects a PKCS#11
- smartcard URI referring to the token. Alternatively the special value <literal>auto</literal> may
- be specified, in order to automatically determine the URI of a currently plugged in security token
- (of which there must be exactly one). The special value <literal>list</literal> may be used to
- enumerate all suitable PKCS#11 tokens currently plugged in. The security token must contain an RSA
- key pair which is used to encrypt the randomly generated key that is used to unlock the LUKS2
- volume. The encrypted key is then stored in the LUKS2 JSON token header area.</para>
+ <listitem><para>Use a TPM2 device instead of a password/passhprase read from stdin to unlock the
+ volume. Expects a device node path referring to the TPM2 chip (e.g. <filename>/dev/tpmrm0</filename>).
+ Alternatively the special value <literal>auto</literal> may be specified, in order to automatically
+ determine the device node of a currently discovered TPM2 device (of which there must be exactly one).
+ </para>
+
+ <xi:include href="version-info.xml" xpointer="v256"/></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>--pkcs11-token-uri=<replaceable>URI</replaceable></option></term>
+
+ <listitem><para>Enroll a PKCS#11 security token or smartcard (e.g. a YubiKey). Expects a PKCS#11 URI
+ that allows finding an X.509 certificate or a public key on the token. The URI must also be suitable
+ to find a related private key after changing the type of object in it. Alternatively the special
+ value <literal>auto</literal> may be specified, in order to automatically determine the suitable URI
+ if a single security token containing a single key pair is plugged in. The special value
+ <literal>list</literal> may be used to enumerate all suitable PKCS#11 tokens currently plugged in.
+ </para>
+
+ <para>The PKCS#11 token must contain an RSA or EC key pair which will be used to unlock a LUKS2 volume.
+ For RSA, a randomly generated volume key is encrypted with a public key in the token, and stored in
+ the LUKS2 JSON token header area. To unlock a volume, the stored encrypted volume key will be decrypted
+ with a private key in the token. For ECC, ECDH algorithm is used: we generate a pair of EC keys in
+ the same EC group, then derive a shared secret using the generated private key and the public key
+ in the token. The derived shared secret is used as a volume key. The generated public key is
+ stored in the LUKS2 JSON token header area. The generated private key is erased. To unlock a volume,
+ we derive the shared secret with the stored public key and a private key in the token.</para>
<para>In order to unlock a LUKS2 volume with an enrolled PKCS#11 security token, specify the
<option>pkcs11-uri=</option> option in the respective <filename>/etc/crypttab</filename> line:</para>
@@ -335,7 +361,7 @@
</varlistentry>
<varlistentry>
- <term><option>--fido2-credential-algorithm=</option><replaceable>STRING</replaceable></term>
+ <term><option>--fido2-credential-algorithm=<replaceable>STRING</replaceable></option></term>
<listitem><para>Specify COSE algorithm used in credential generation. The default value is
<literal>es256</literal>. Supported values are <literal>es256</literal>, <literal>rs256</literal>
and <literal>eddsa</literal>.</para>
@@ -344,13 +370,13 @@
denotes 2048-bit RSA with PKCS#1.5 padding and SHA-256. <literal>eddsa</literal> denotes
EDDSA over Curve25519 with SHA-512.</para>
- <para>Note that your authenticator may not support some algorithms.</para>
+ <para>Note that your authenticator may choose not to support some algorithms.</para>
<xi:include href="version-info.xml" xpointer="v251"/></listitem>
</varlistentry>
<varlistentry>
- <term><option>--fido2-device=</option><replaceable>PATH</replaceable></term>
+ <term><option>--fido2-device=<replaceable>PATH</replaceable></option></term>
<listitem><para>Enroll a FIDO2 security token that implements the <literal>hmac-secret</literal>
extension (e.g. a YubiKey). Expects a <filename>hidraw</filename> device referring to the FIDO2
@@ -376,7 +402,7 @@
</varlistentry>
<varlistentry>
- <term><option>--fido2-with-client-pin=</option><replaceable>BOOL</replaceable></term>
+ <term><option>--fido2-with-client-pin=<replaceable>BOOL</replaceable></option></term>
<listitem><para>When enrolling a FIDO2 security token, controls whether to require the user to enter
a PIN when unlocking the volume (the FIDO2 <literal>clientPin</literal> feature). Defaults to
@@ -388,7 +414,7 @@
</varlistentry>
<varlistentry>
- <term><option>--fido2-with-user-presence=</option><replaceable>BOOL</replaceable></term>
+ <term><option>--fido2-with-user-presence=<replaceable>BOOL</replaceable></option></term>
<listitem><para>When enrolling a FIDO2 security token, controls whether to require the user to
verify presence (tap the token, the FIDO2 <literal>up</literal> feature) when unlocking the volume.
@@ -400,7 +426,7 @@
</varlistentry>
<varlistentry>
- <term><option>--fido2-with-user-verification=</option><replaceable>BOOL</replaceable></term>
+ <term><option>--fido2-with-user-verification=<replaceable>BOOL</replaceable></option></term>
<listitem><para>When enrolling a FIDO2 security token, controls whether to require user verification
when unlocking the volume (the FIDO2 <literal>uv</literal> feature). Defaults to
@@ -411,7 +437,7 @@
</varlistentry>
<varlistentry>
- <term><option>--tpm2-device=</option><replaceable>PATH</replaceable></term>
+ <term><option>--tpm2-device=<replaceable>PATH</replaceable></option></term>
<listitem><para>Enroll a TPM2 security chip. Expects a device node path referring to the TPM2 chip
(e.g. <filename>/dev/tpmrm0</filename>). Alternatively the special value <literal>auto</literal> may
@@ -436,7 +462,7 @@
</varlistentry>
<varlistentry>
- <term><option>--tpm2-device-key=</option><replaceable>PATH</replaceable></term>
+ <term><option>--tpm2-device-key=<replaceable>PATH</replaceable></option></term>
<listitem><para>Enroll a TPM2 security chip using its public key. Expects a path referring to the
TPM2 public key in TPM2B_PUBLIC format. This cannot be used with <option>--tpm2-device=</option>, as
@@ -464,7 +490,7 @@
</varlistentry>
<varlistentry>
- <term><option>--tpm2-seal-key-handle=</option><replaceable>HANDLE</replaceable></term>
+ <term><option>--tpm2-seal-key-handle=<replaceable>HANDLE</replaceable></option></term>
<listitem><para>Configures which parent key to use for sealing, using the TPM handle (index) of the
key. This is used to "seal" (encrypt) a secret and must be used later to "unseal" (decrypt) the
@@ -486,7 +512,7 @@
</varlistentry>
<varlistentry>
- <term><option>--tpm2-pcrs=</option><arg rep="repeat">PCR</arg></term>
+ <term><option>--tpm2-pcrs=<replaceable>PCR<optional>+PCR...</optional></replaceable></option></term>
<listitem><para>Configures the TPM2 PCRs (Platform Configuration Registers) to bind to when
enrollment is requested via <option>--tpm2-device=</option>. Takes a list of PCR entries, where each
@@ -511,7 +537,7 @@
</varlistentry>
<varlistentry>
- <term><option>--tpm2-with-pin=</option><replaceable>BOOL</replaceable></term>
+ <term><option>--tpm2-with-pin=<replaceable>BOOL</replaceable></option></term>
<listitem><para>When enrolling a TPM2 device, controls whether to require the user to enter a PIN
when unlocking the volume in addition to PCR binding, based on TPM2 policy authentication. Defaults
@@ -532,9 +558,9 @@
</varlistentry>
<varlistentry>
- <term><option>--tpm2-public-key=</option><arg>PATH</arg></term>
- <term><option>--tpm2-public-key-pcrs=</option><arg rep="repeat">PCR</arg></term>
- <term><option>--tpm2-signature=</option><arg>PATH</arg></term>
+ <term><option>--tpm2-public-key=<replaceable>PATH</replaceable></option></term>
+ <term><option>--tpm2-public-key-pcrs=<replaceable>PCR<optional>+PCR...</optional></replaceable></option></term>
+ <term><option>--tpm2-signature=<replaceable>PATH</replaceable></option></term>
<listitem><para>Configures a TPM2 signed PCR policy to bind encryption to. The
<option>--tpm2-public-key=</option> option accepts a path to a PEM encoded RSA public key, to bind
@@ -572,7 +598,7 @@
</varlistentry>
<varlistentry>
- <term><option>--tpm2-pcrlock=</option><arg>PATH</arg></term>
+ <term><option>--tpm2-pcrlock=<replaceable>PATH</replaceable></option></term>
<listitem><para>Configures a TPM2 pcrlock policy to bind encryption to. Expects a path to a pcrlock
policy file as generated by the
@@ -586,7 +612,7 @@
</varlistentry>
<varlistentry>
- <term><option>--wipe-slot=</option><arg rep="repeat">SLOT</arg></term>
+ <term><option>--wipe-slot=<replaceable>SLOT<optional>,SLOT...</optional></replaceable></option></term>
<listitem><para>Wipes one or more LUKS2 key slots. Takes a comma separated list of numeric slot
indexes, or the special strings <literal>all</literal> (for wiping all key slots),
@@ -630,6 +656,51 @@
</refsect1>
<refsect1>
+ <title>Credentials</title>
+
+ <para><command>systemd-cryptenroll</command> supports the service credentials logic as implemented by
+ <varname>ImportCredential=</varname>/<varname>LoadCredential=</varname>/<varname>SetCredential=</varname>
+ (see <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry> for
+ details). The following credentials are used when passed in:</para>
+
+ <variablelist class='system-credentials'>
+ <varlistentry>
+ <term><varname>cryptenroll.passphrase</varname></term>
+ <term><varname>cryptenroll.new-passphrase</varname></term>
+
+ <listitem><para>May contain the passphrase to unlock the volume with/to newly enroll.</para>
+
+ <xi:include href="version-info.xml" xpointer="v256"/></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><varname>cryptenroll.tpm2-pin</varname></term>
+ <term><varname>cryptenroll.new-tpm2-pin</varname></term>
+
+ <listitem><para>May contain the TPM2 PIN to unlock the volume with/to newly enroll.</para>
+
+ <xi:include href="version-info.xml" xpointer="v256"/></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><varname>cryptenroll.fido2-pin</varname></term>
+
+ <listitem><para>If a FIDO2 token is enrolled this may contain the PIN of the token.</para>
+
+ <xi:include href="version-info.xml" xpointer="v256"/></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><varname>cryptenroll.pkcs11-pin</varname></term>
+
+ <listitem><para>If a PKCS#11 token is enrolled this may contain the PIN of the token.</para>
+
+ <xi:include href="version-info.xml" xpointer="v256"/></listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+
+ <refsect1>
<title>Exit status</title>
<para>On success, 0 is returned, a non-zero failure code otherwise.</para>
@@ -645,13 +716,13 @@
<refsect1>
<title>See Also</title>
- <para>
- <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
- <citerefentry><refentrytitle>systemd-cryptsetup@.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
- <citerefentry><refentrytitle>crypttab</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
- <citerefentry project='die-net'><refentrytitle>cryptsetup</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
- <citerefentry><refentrytitle>systemd-measure</refentrytitle><manvolnum>1</manvolnum></citerefentry>
- </para>
+ <para><simplelist type="inline">
+ <member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
+ <member><citerefentry><refentrytitle>systemd-cryptsetup@.service</refentrytitle><manvolnum>8</manvolnum></citerefentry></member>
+ <member><citerefentry><refentrytitle>crypttab</refentrytitle><manvolnum>5</manvolnum></citerefentry></member>
+ <member><citerefentry project='die-net'><refentrytitle>cryptsetup</refentrytitle><manvolnum>8</manvolnum></citerefentry></member>
+ <member><citerefentry><refentrytitle>systemd-measure</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
+ </simplelist></para>
</refsect1>
</refentry>