1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4
<!ENTITY TIMESTAMP "2016-11-27">
5
<!ENTITY % common SYSTEM "common.ent">
9
<refentry xmlns:xi="http://www.w3.org/2001/XInclude">
11
<title>Mandos Manual</title>
12
<!-- NWalsh’s docbook scripts use this to generate the footer: -->
13
<productname>Mandos</productname>
14
<productnumber>&version;</productnumber>
15
<date>&TIMESTAMP;</date>
18
<firstname>Björn</firstname>
19
<surname>Påhlsson</surname>
21
<email>belorn@recompile.se</email>
25
<firstname>Teddy</firstname>
26
<surname>Hogeborn</surname>
28
<email>teddy@recompile.se</email>
39
<holder>Teddy Hogeborn</holder>
40
<holder>Björn Påhlsson</holder>
42
<xi:include href="legalnotice.xml"/>
46
<refentrytitle>intro</refentrytitle>
47
<manvolnum>8mandos</manvolnum>
51
<refname>intro</refname>
53
Introduction to the Mandos system
57
<refsect1 id="description">
58
<title>DESCRIPTION</title>
60
This is the the Mandos system, which allows computers to have
61
encrypted root file systems and at the same time be capable of
62
remote and/or unattended reboots.
65
The computers run a small client program in the initial RAM disk
66
environment which will communicate with a server over a network.
67
All network communication is encrypted using TLS. The clients
68
are identified by the server using an OpenPGP key; each client
69
has one unique to it. The server sends the clients an encrypted
70
password. The encrypted password is decrypted by the clients
71
using the same OpenPGP key, and the password is then used to
72
unlock the root file system, whereupon the computers can
73
continue booting normally.
77
<refsect1 id="introduction">
78
<title>INTRODUCTION</title>
80
<!-- This paragraph is a combination and paraphrase of two
81
quotes from the 1995 movie “The Usual Suspects”. -->
82
You know how it is. You’ve heard of it happening. The Man
83
comes and takes away your servers, your friends’ servers, the
84
servers of everybody in the same hosting facility. The servers
85
of their neighbors, and their neighbors’ friends. The servers
86
of people who owe them money. And like
87
<emphasis>that</emphasis>, they’re gone. And you doubt you’ll
91
That is why your servers have encrypted root file systems.
92
However, there’s a downside. There’s no going around it:
93
rebooting is a pain. Dragging out that rarely-used keyboard and
94
screen and unraveling cables behind your servers to plug them in
95
to type in that password is messy, especially if you have many
96
servers. There are some people who do clever things like using
97
serial line consoles and daisy-chain it to the next server, and
98
keep all the servers connected in a ring with serial cables,
99
which will work, if your servers are physically close enough.
100
There are also other out-of-band management solutions, but with
101
<emphasis>all</emphasis> these, you still have to be on hand and
102
manually type in the password at boot time. Otherwise the
103
server just sits there, waiting for a password.
106
Wouldn’t it be great if you could have the security of encrypted
107
root file systems and still have servers that could boot up
108
automatically if there was a short power outage while you were
109
asleep? That you could reboot at will, without having someone
110
run over to the server to type in the password?
113
Well, with Mandos, you (almost) can! The gain in convenience
114
will only be offset by a small loss in security. The setup is
118
The server will still have its encrypted root file system. The
119
password to this file system will be stored on another computer
120
(henceforth known as the Mandos server) on the same local
121
network. The password will <emphasis>not</emphasis> be stored
122
in plaintext, but encrypted with OpenPGP. To decrypt this
123
password, a key is needed. This key (the Mandos client key)
124
will not be stored there, but back on the original server
125
(henceforth known as the Mandos client) in the initial RAM disk
126
image. Oh, and all network Mandos client/server communications
127
will be encrypted, using TLS (SSL).
130
So, at boot time, the Mandos client will ask for its encrypted
131
data over the network, decrypt it to get the password, use it to
132
decrypt the root file, and continue booting.
135
Now, of course the initial RAM disk image is not on the
136
encrypted root file system, so anyone who had physical access
137
could take the Mandos client computer offline and read the disk
138
with their own tools to get the authentication keys used by a
139
client. <emphasis>But</emphasis>, by then the Mandos server
140
should notice that the original server has been offline for too
141
long, and will no longer give out the encrypted key. The timing
142
here is the only real weak point, and the method, frequency and
143
timeout of the server’s checking can be adjusted to any desired
147
(The encrypted keys on the Mandos server is on its normal file
148
system, so those are safe, provided the root file system of
149
<emphasis>that</emphasis> server is encrypted.)
154
<title>FREQUENTLY ASKED QUESTIONS</title>
156
Couldn’t the security be defeated by…
158
<refsect2 id="quick">
159
<title>Grabbing the Mandos client key from the
160
initrd <emphasis>really quickly</emphasis>?</title>
162
This, as mentioned above, is the only real weak point. But if
163
you set the timing values tight enough, this will be really
164
difficult to do. An attacker would have to physically
165
disassemble the client computer, extract the key from the
166
initial RAM disk image, and then connect to a <emphasis>still
167
online</emphasis> Mandos server to get the encrypted key, and do
168
all this <emphasis>before</emphasis> the Mandos server timeout
169
kicks in and the Mandos server refuses to give out the key to
173
Now, as the typical procedure seems to be to barge in and turn
174
off and grab <emphasis>all</emphasis> computers, to maybe look
175
at them months later, this is not likely. If someone does that,
176
the whole system <emphasis>will</emphasis> lock itself up
177
completely, since Mandos servers are no longer running.
180
For sophisticated attackers who <emphasis>could</emphasis> do
181
the clever thing, <emphasis>and</emphasis> had physical access
182
to the server for enough time, it would be simpler to get a key
183
for an encrypted file system by using hardware memory scanners
184
and reading it right off the memory bus.
188
<refsect2 id="replay">
189
<title>Replay attacks?</title>
191
Nope, the network stuff is all done over TLS, which provides
192
protection against that.
197
<title>Man-in-the-middle?</title>
199
No. The server only gives out the passwords to clients which
200
have <emphasis>in the TLS handshake</emphasis> proven that
201
they do indeed hold the OpenPGP private key corresponding to
206
<refsect2 id="sniff">
207
<title>How about sniffing the network traffic and decrypting it
208
later by physically grabbing the Mandos client and using its
211
We only use <acronym>PFS</acronym> (Perfect Forward Security)
212
key exchange algorithms in TLS, which protects against this.
216
<refsect2 id="physgrab">
217
<title>Physically grabbing the Mandos server computer?</title>
219
You could protect <emphasis>that</emphasis> computer the
220
old-fashioned way, with a must-type-in-the-password-at-boot
221
method. Or you could have two computers be the Mandos server
225
Multiple Mandos servers can coexist on a network without any
226
trouble. They do not clash, and clients will try all
227
available servers. This means that if just one reboots then
228
the other can bring it back up, but if both reboot at the same
229
time they will stay down until someone types in the password
234
<refsect2 id="fakecheck">
235
<title>Faking checker results?</title>
237
If the Mandos client does not have an SSH server, the default
238
is for the Mandos server to use
239
<quote><literal>fping</literal></quote>, the replies to which
240
could be faked to eliminate the timeout. But this could
241
easily be changed to any shell command, with any security
242
measures you like. If the Mandos client
243
<emphasis>has</emphasis> an SSH server, the default
244
configuration (as generated by
245
<command>mandos-keygen</command> with the
246
<option>--password</option> option) is for the Mandos server
247
to use an <command>ssh-keyscan</command> command with strict
248
keychecking, which can not be faked. Alternatively, IPsec
249
could be used for the ping packets, making them secure.
254
<refsect1 id="security">
255
<title>SECURITY</title>
257
So, in summary: The only weakness in the Mandos system is from
263
The power to come in and physically take your servers,
264
<emphasis>and</emphasis>
269
The cunning and patience to do it carefully, one at a time,
270
and <emphasis>quickly</emphasis>, faking Mandos
271
client/server responses for each one before the timeout.
276
While there are some who may be threatened by people who have
277
<emphasis>both</emphasis> these attributes, they do not,
278
probably, constitute the majority.
281
If you <emphasis>do</emphasis> face such opponents, you must
282
figure that they could just as well open your servers and read
283
the file system keys right off the memory by running wires to
287
What Mandos is designed to protect against is
288
<emphasis>not</emphasis> such determined, focused, and competent
289
attacks, but against the early morning knock on your door and
290
the sudden absence of all the servers in your server room.
291
Which it does nicely.
295
<refsect1 id="plugins">
296
<title>PLUGINS</title>
298
In the early designs, the
299
<citerefentry><refentrytitle>mandos-client</refentrytitle
300
><manvolnum>8mandos</manvolnum></citerefentry> program (which
301
retrieves a password from the Mandos server) also prompted for a
302
password on the terminal, in case a Mandos server could not be
303
found. Other ways of retrieving a password could easily be
304
envisoned, but this multiplicity of purpose was seen to be too
305
complex to be a viable way to continue. Instead, the original
306
program was separated into <citerefentry><refentrytitle
307
>mandos-client</refentrytitle><manvolnum>8mandos</manvolnum
308
></citerefentry> and <citerefentry><refentrytitle
309
>password-prompt</refentrytitle><manvolnum>8mandos</manvolnum
310
></citerefentry>, and a <citerefentry><refentrytitle
311
>plugin-runner</refentrytitle><manvolnum>8mandos</manvolnum
312
></citerefentry> exist to run them both in parallel, allowing
313
the first successful plugin to provide the password. This
314
opened up for any number of additional plugins to run, all
315
competing to be the first to find a password and provide it to
319
Four additional plugins are provided:
324
<citerefentry><refentrytitle>plymouth</refentrytitle>
325
<manvolnum>8mandos</manvolnum></citerefentry>
329
This prompts for a password when using <citerefentry>
330
<refentrytitle>plymouth</refentrytitle><manvolnum
331
>8</manvolnum></citerefentry>.
337
<citerefentry><refentrytitle>usplash</refentrytitle>
338
<manvolnum>8mandos</manvolnum></citerefentry>
342
This prompts for a password when using <citerefentry>
343
<refentrytitle>usplash</refentrytitle><manvolnum
344
>8</manvolnum></citerefentry>.
350
<citerefentry><refentrytitle>splashy</refentrytitle>
351
<manvolnum>8mandos</manvolnum></citerefentry>
355
This prompts for a password when using <citerefentry>
356
<refentrytitle>splashy</refentrytitle><manvolnum
357
>8</manvolnum></citerefentry>.
363
<citerefentry><refentrytitle>askpass-fifo</refentrytitle>
364
<manvolnum>8mandos</manvolnum></citerefentry>
368
To provide compatibility with the "askpass" program from
369
cryptsetup, this plugin listens to the same FIFO as
376
More plugins can easily be written and added by the system
377
administrator; see the section called "WRITING PLUGINS" in
378
<citerefentry><refentrytitle>plugin-runner</refentrytitle>
379
<manvolnum>8mandos</manvolnum></citerefentry> to learn the
386
<xi:include href="bugs.xml"/>
389
<refsect1 id="see_also">
390
<title>SEE ALSO</title>
392
<citerefentry><refentrytitle>mandos</refentrytitle>
393
<manvolnum>8</manvolnum></citerefentry>,
394
<citerefentry><refentrytitle>mandos.conf</refentrytitle>
395
<manvolnum>5</manvolnum></citerefentry>,
396
<citerefentry><refentrytitle>mandos-clients.conf</refentrytitle>
397
<manvolnum>5</manvolnum></citerefentry>,
398
<citerefentry><refentrytitle>mandos-ctl</refentrytitle>
399
<manvolnum>8</manvolnum></citerefentry>,
400
<citerefentry><refentrytitle>mandos-monitor</refentrytitle>
401
<manvolnum>8</manvolnum></citerefentry>,
402
<citerefentry><refentrytitle>plugin-runner</refentrytitle>
403
<manvolnum>8mandos</manvolnum></citerefentry>,
404
<citerefentry><refentrytitle>mandos-client</refentrytitle>
405
<manvolnum>8mandos</manvolnum></citerefentry>,
406
<citerefentry><refentrytitle>password-prompt</refentrytitle>
407
<manvolnum>8mandos</manvolnum></citerefentry>,
408
<citerefentry><refentrytitle>plymouth</refentrytitle>
409
<manvolnum>8mandos</manvolnum></citerefentry>,
410
<citerefentry><refentrytitle>usplash</refentrytitle>
411
<manvolnum>8mandos</manvolnum></citerefentry>,
412
<citerefentry><refentrytitle>splashy</refentrytitle>
413
<manvolnum>8mandos</manvolnum></citerefentry>,
414
<citerefentry><refentrytitle>askpass-fifo</refentrytitle>
415
<manvolnum>8mandos</manvolnum></citerefentry>,
416
<citerefentry><refentrytitle>mandos-keygen</refentrytitle>
417
<manvolnum>8</manvolnum></citerefentry>
422
<ulink url="https://www.recompile.se/mandos">Mandos</ulink>
426
The Mandos home page.
433
<!-- Local Variables: -->
434
<!-- time-stamp-start: "<!ENTITY TIMESTAMP [\"']" -->
435
<!-- time-stamp-end: "[\"']>" -->
436
<!-- time-stamp-format: "%:y-%02m-%02d" -->