| 1 |
<?xml version="1.0"?> |
| 2 |
<!--*-nxml-*--> |
| 3 |
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" |
| 4 |
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"> |
| 5 |
<!-- |
| 6 |
SPDX-License-Identifier: LGPL-2.1-or-later |
| 7 |
|
| 8 |
--> |
| 9 |
<refentry id="integritytab" conditional='HAVE_LIBCRYPTSETUP' xmlns:xi="http://www.w3.org/2001/XInclude"> |
| 10 |
|
| 11 |
<refentryinfo> |
| 12 |
<title>integritytab</title> |
| 13 |
<productname>systemd</productname> |
| 14 |
</refentryinfo> |
| 15 |
|
| 16 |
<refmeta> |
| 17 |
<refentrytitle>integritytab</refentrytitle> |
| 18 |
<manvolnum>5</manvolnum> |
| 19 |
</refmeta> |
| 20 |
|
| 21 |
<refnamediv> |
| 22 |
<refname>integritytab</refname> |
| 23 |
<refpurpose>Configuration for integrity block devices</refpurpose> |
| 24 |
</refnamediv> |
| 25 |
|
| 26 |
<refsynopsisdiv> |
| 27 |
<para><filename>/etc/integritytab</filename></para> |
| 28 |
</refsynopsisdiv> |
| 29 |
|
| 30 |
<refsect1> |
| 31 |
<title>Description</title> |
| 32 |
|
| 33 |
<para>The <filename>/etc/integritytab</filename> file describes |
| 34 |
integrity protected block devices that are set up during |
| 35 |
system boot.</para> |
| 36 |
|
| 37 |
<para>Empty lines and lines starting with the <literal>#</literal> |
| 38 |
character are ignored. Each of the remaining lines describes one |
| 39 |
verity integrity protected block device. Fields are delimited by |
| 40 |
white space.</para> |
| 41 |
|
| 42 |
<para>Each line is in the form<programlisting><replaceable>volume-name</replaceable> <replaceable>block-device</replaceable> |
| 43 |
<replaceable>[keyfile|-]</replaceable> <replaceable>[options|-]</replaceable></programlisting> |
| 44 |
The first two fields are mandatory, the remaining two are optional and only required if user specified non-default options during integrity format.</para> |
| 45 |
|
| 46 |
<para>The first field contains the name of the resulting integrity volume; its block device is set up |
| 47 |
below <filename>/dev/mapper/</filename>.</para> |
| 48 |
|
| 49 |
<para>The second field contains a path to the underlying block device, or a specification of a block device via |
| 50 |
<literal>UUID=</literal> followed by the UUID, |
| 51 |
<literal>PARTUUID=</literal> followed by the partition UUID, |
| 52 |
<literal>LABEL=</literal> followed by the label, |
| 53 |
<literal>PARTLABEL=</literal> followed by the partition label. |
| 54 |
</para> |
| 55 |
|
| 56 |
<para>The third field if present contains an absolute filename path to a key file or a <literal>-</literal> |
| 57 |
to specify none. When the filename is present, the "integrity-algorithm" defaults to <literal>hmac-sha256</literal> |
| 58 |
with the key length derived from the number of bytes in the key file. At this time the only supported integrity algorithms |
| 59 |
when using key file are hmac-sha256, hmac-sha512, phmac-sha256, and hmac-sha512. The maximum size of the key file is 4096 bytes. |
| 60 |
</para> |
| 61 |
|
| 62 |
<para>The fourth field, if present, is a comma-delimited list of options or a <literal>-</literal> to specify none. The following options are |
| 63 |
recognized:</para> |
| 64 |
<variablelist> |
| 65 |
|
| 66 |
<varlistentry> |
| 67 |
<term><option>allow-discards</option></term> |
| 68 |
|
| 69 |
<listitem><para> |
| 70 |
Allow the use of discard (TRIM) requests for the device. |
| 71 |
This option is available since the Linux kernel version 5.7. |
| 72 |
</para> |
| 73 |
|
| 74 |
<xi:include href="version-info.xml" xpointer="v250"/></listitem> |
| 75 |
</varlistentry> |
| 76 |
|
| 77 |
<varlistentry> |
| 78 |
<term><option>mode=(journal|bitmap|direct)</option></term> |
| 79 |
|
| 80 |
<listitem><para> |
| 81 |
Enable journaled, bitmapped or direct (passthrough) mode. Journaled mode is the default when this option is not specified. |
| 82 |
It provides safety against crashes, but can be slow because all data has to be written twice. |
| 83 |
Bitmap mode is more efficient since it requires only a single write, but it is less reliable because if data corruption happens when the machine crashes, it might not be detected. |
| 84 |
Direct mode disables the journal and the bitmap. Corresponds to the "direct writes" mode documented in |
| 85 |
<ulink url="https://docs.kernel.org/admin-guide/device-mapper/dm-integrity.html">the dm-integrity documentation</ulink>. |
| 86 |
Note that without a journal, if there is a crash, it is possible that the integrity tags and data will not match. If used, the journal-* |
| 87 |
options below will have no effect if passed. |
| 88 |
</para> |
| 89 |
|
| 90 |
<xi:include href="version-info.xml" xpointer="v254"/></listitem> |
| 91 |
</varlistentry> |
| 92 |
|
| 93 |
<varlistentry> |
| 94 |
<term><option>journal-watermark=[0..100]%</option></term> |
| 95 |
|
| 96 |
<listitem><para> |
| 97 |
Journal watermark in percent. When the journal percentage exceeds this watermark, the journal flush will be started. Setting a value of |
| 98 |
"0%" uses default value. |
| 99 |
</para> |
| 100 |
|
| 101 |
<xi:include href="version-info.xml" xpointer="v250"/></listitem> |
| 102 |
</varlistentry> |
| 103 |
|
| 104 |
<varlistentry> |
| 105 |
<term><option>journal-commit-time=[0..N]</option></term> |
| 106 |
|
| 107 |
<listitem><para> |
| 108 |
Commit time in milliseconds. When this time passes (and no explicit flush operation was issued), the journal is written. Setting a value of |
| 109 |
zero uses default value. |
| 110 |
</para> |
| 111 |
|
| 112 |
<xi:include href="version-info.xml" xpointer="v250"/></listitem> |
| 113 |
</varlistentry> |
| 114 |
|
| 115 |
<varlistentry> |
| 116 |
<term><option>data-device=/dev/disk/by-...</option></term> |
| 117 |
|
| 118 |
<listitem><para> |
| 119 |
Specify a separate block device that contains existing data. The second field specified in the |
| 120 |
integritytab for block device then will contain calculated integrity tags and journal for data-device, |
| 121 |
but not the end user data. |
| 122 |
</para> |
| 123 |
|
| 124 |
<xi:include href="version-info.xml" xpointer="v250"/></listitem> |
| 125 |
</varlistentry> |
| 126 |
|
| 127 |
<varlistentry> |
| 128 |
<term><option>integrity-algorithm=[crc32c|crc32|xxhash64|sha1|sha256|hmac-sha256|hmac-sha512|phmac-sha256|phmac-sha512]</option></term> |
| 129 |
|
| 130 |
<listitem><para> |
| 131 |
The algorithm used for integrity checking. The default is crc32c. Must match option used during format. |
| 132 |
</para> |
| 133 |
|
| 134 |
<xi:include href="version-info.xml" xpointer="v250"/></listitem> |
| 135 |
</varlistentry> |
| 136 |
|
| 137 |
<varlistentry> |
| 138 |
<term><option>_netdev</option></term> |
| 139 |
|
| 140 |
<listitem><para>Marks this veritysetup device as requiring network. It will be started after the |
| 141 |
network is available, similarly to |
| 142 |
<citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry> |
| 143 |
units marked with <option>_netdev</option>. The service unit to set up this device will be ordered |
| 144 |
between <filename>remote-fs-pre.target</filename> and |
| 145 |
<filename>remote-integritysetup.target</filename>, instead of |
| 146 |
<filename>integritysetup-pre.target</filename> and <filename>integritysetup.target</filename>.</para> |
| 147 |
|
| 148 |
<para>Hint: if this device is used for a mount point that is specified in <citerefentry |
| 149 |
project='man-pages'><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry>, the |
| 150 |
<option>_netdev</option> option should also be used for the mount point. Otherwise, a dependency loop |
| 151 |
might be created where the mount point will be pulled in by <filename>local-fs.target</filename>, |
| 152 |
while the service to configure the network is usually only started <emphasis>after</emphasis> the |
| 153 |
local file system has been mounted.</para> |
| 154 |
|
| 155 |
<xi:include href="version-info.xml" xpointer="v258"/> |
| 156 |
</listitem> |
| 157 |
</varlistentry> |
| 158 |
|
| 159 |
<varlistentry> |
| 160 |
<term><option>noauto</option></term> |
| 161 |
|
| 162 |
<listitem><para>This device will not be added to <filename>integritysetup.target</filename>. This |
| 163 |
means that it will not be automatically enabled on boot, unless something else pulls it in. In |
| 164 |
particular, if the device is used for a mount point, it'll be enabled automatically during boot, |
| 165 |
unless the mount point itself is also disabled with <option>noauto</option>.</para> |
| 166 |
|
| 167 |
<xi:include href="version-info.xml" xpointer="v258"/></listitem> |
| 168 |
</varlistentry> |
| 169 |
|
| 170 |
<varlistentry> |
| 171 |
<term><option>nofail</option></term> |
| 172 |
|
| 173 |
<listitem><para>This device will not be a hard dependency of |
| 174 |
<filename>integritysetup.target</filename>. It'll still be pulled in and started, but the system will |
| 175 |
not wait for the device to show up and be enabled, and boot will not fail if this is |
| 176 |
unsuccessful. Note that other units that depend on the enabled device may still fail. In particular, |
| 177 |
if the device is used for a mount point, the mount point itself also needs to have the |
| 178 |
<option>nofail</option> option, or the boot will fail if the device is not enabled |
| 179 |
successfully.</para> |
| 180 |
|
| 181 |
<xi:include href="version-info.xml" xpointer="v258"/></listitem> |
| 182 |
</varlistentry> |
| 183 |
</variablelist> |
| 184 |
|
| 185 |
<para>At early boot and when the system manager configuration is |
| 186 |
reloaded, this file is translated into native systemd units by |
| 187 |
<citerefentry><refentrytitle>systemd-integritysetup-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para> |
| 188 |
</refsect1> |
| 189 |
|
| 190 |
<refsect1> |
| 191 |
<title>Examples</title> |
| 192 |
<example> |
| 193 |
<title>/etc/integritytab</title> |
| 194 |
<para>Set up two integrity protected block devices. </para> |
| 195 |
|
| 196 |
<programlisting>home PARTUUID=4973d0b8-1b15-c449-96ec-94bab7f6a7b8 - journal-commit-time=10,allow-discards,journal-watermark=55% |
| 197 |
data PARTUUID=5d4b1808-be76-774d-88af-03c4c3a41761 - allow-discards |
| 198 |
</programlisting> |
| 199 |
</example> |
| 200 |
|
| 201 |
<example> |
| 202 |
<title>/etc/integritytab</title> |
| 203 |
<para>Set up 1 integrity protected block device using defaults </para> |
| 204 |
|
| 205 |
<programlisting>home PARTUUID=4973d0b8-1b15-c449-96ec-94bab7f6a7b8</programlisting> |
| 206 |
</example> |
| 207 |
|
| 208 |
<example> |
| 209 |
<title>/etc/integritytab</title> |
| 210 |
<para>Set up 1 integrity device using existing data block device which contains user data </para> |
| 211 |
|
| 212 |
<programlisting>home PARTUUID=4973d0b8-1b15-c449-96ec-94bab7f6a7b8 - data-device=/dev/disk/by-uuid/9276d9c0-d4e3-4297-b4ff-3307cd0d092f</programlisting> |
| 213 |
</example> |
| 214 |
|
| 215 |
<example> |
| 216 |
<title>/etc/integritytab</title> |
| 217 |
<para>Set up 1 integrity device using a HMAC key file using defaults </para> |
| 218 |
|
| 219 |
<programlisting>home PARTUUID=4973d0b8-1b15-c449-96ec-94bab7f6a7b8 /etc/hmac.key</programlisting> |
| 220 |
</example> |
| 221 |
|
| 222 |
</refsect1> |
| 223 |
|
| 224 |
<refsect1> |
| 225 |
<title>See Also</title> |
| 226 |
<para><simplelist type="inline"> |
| 227 |
<member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> |
| 228 |
<member><citerefentry><refentrytitle>[email protected]</refentrytitle><manvolnum>8</manvolnum></citerefentry></member> |
| 229 |
<member><citerefentry><refentrytitle>systemd-integritysetup-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry></member> |
| 230 |
<member><citerefentry project='die-net'><refentrytitle>integritysetup</refentrytitle><manvolnum>8</manvolnum></citerefentry></member> |
| 231 |
</simplelist></para> |
| 232 |
</refsect1> |
| 233 |
|
| 234 |
</refentry> |