Update Red Hat Copyright Notices
[nbdkit.git] / filters / luks / nbdkit-luks-filter.pod
blob1daebd20e2730bee1227f5f2be69f3e886791651
1 =head1 NAME
3 nbdkit-luks-filter - read and write LUKS-encrypted disks and partitions
5 =head1 SYNOPSIS
7  nbdkit file encrypted-disk.img --filter=luks passphrase=+/tmp/secret
9 =head1 DESCRIPTION
11 C<nbdkit-luks-filter> is a filter for L<nbdkit(1)> which transparently
12 opens a LUKS-encrypted disk image.  LUKS ("Linux Unified Key Setup")
13 is the Full Disk Encryption (FDE) system commonly used by Linux
14 systems.  This filter is compatible with LUKSv1 as implemented by the
15 Linux kernel (dm_crypt), and by qemu.
17 You can place this filter on top of L<nbdkit-file-plugin(1)> to
18 decrypt a local file:
20  nbdkit file encrypted-disk.img --filter=luks passphrase=+/tmp/secret
22 If LUKS is present inside a partition in the disk image then you will
23 have to combine this filter with L<nbdkit-partition-filter(1)>.  The
24 order of the filters is important:
26  nbdkit file encrypted-disk.img \
27              --filter=luks passphrase=+/tmp/secret \
28              --filter=partition partition=1
30 This filter also works on top of other plugins such as
31 L<nbdkit-curl-plugin(1)>:
33  nbdkit curl https://example.com/encrypted-disk.img \
34              --filter=luks passphrase=+/tmp/secret
36 The web server sees only the encrypted data.  Without knowing the
37 passphrase, the web server cannot access the decrypted disk.  Only
38 encrypted data is sent over the HTTP connection.  nbdkit itself will
39 serve I<unencrypted> disk data over the NBD connection (if this is a
40 problem see L<nbdkit-tls(1)>, or use a Unix domain socket I<-U>).
42 The passphrase can be stored in a file (as shown), passed directly on
43 the command line (insecure), entered interactively, or passed to
44 nbdkit over a file descriptor.
46 This filter can read and write LUKSv1.  It cannot create disks, change
47 passphrases, add keyslots, etc.  To do that, you can use ordinary
48 Linux tools like L<cryptsetup(8)>.  Note you must force LUKSv1
49 (eg. using cryptsetup I<--type luks1>).  L<qemu-img(1)> can also
50 create compatible disk images:
52  qemu-img create -f luks \
53                  --object secret,data=SECRET,id=sec0 \
54                  -o key-secret=sec0 \
55                  encrypted-disk.img 1G
57 =head1 PARAMETERS
59 =over 4
61 =item B<passphrase=>SECRET
63 Use the secret passphrase when decrypting the disk.
65 Note that passing this on the command line is not secure on shared
66 machines.
68 =item B<passphrase=->
70 Ask for the passphrase (interactively) when nbdkit starts up.
72 =item B<passphrase=+>FILENAME
74 Read the passphrase from the named file.  This is a secure method to
75 supply a passphrase, as long as you set the permissions on the file
76 appropriately.
78 =item B<passphrase=->FD
80 Read the passphrase from file descriptor number C<FD>, inherited from
81 the parent process when nbdkit starts up.  This is also a secure
82 method to supply a passphrase.
84 =back
86 =head1 FILES
88 =over 4
90 =item F<$filterdir/nbdkit-luks-filter.so>
92 The plugin.
94 Use C<nbdkit --dump-config> to find the location of C<$filterdir>.
96 =back
98 =head1 VERSION
100 C<nbdkit-luks-filter> first appeared in nbdkit 1.32.
102 =head1 SEE ALSO
104 L<nbdkit-curl-plugin(1)>,
105 L<nbdkit-file-plugin(1)>,
106 L<nbdkit-ip-filter(1)>,
107 L<nbdkit-partition-filter(1)>,
108 L<nbdkit(1)>,
109 L<nbdkit-tls(1)>,
110 L<nbdkit-plugin(3)>,
111 L<cryptsetup(8)>,
112 L<qemu-img(1)>.
114 =head1 AUTHORS
116 Richard W.M. Jones
118 =head1 COPYRIGHT
120 Copyright Red Hat