/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk
493 by Teddy Hogeborn
* Makefile (DOCS): Added "intro.8mandos".
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" [
899 by Teddy Hogeborn
Update copyright year to 2017
4
<!ENTITY TIMESTAMP "2017-02-23">
493 by Teddy Hogeborn
* Makefile (DOCS): Added "intro.8mandos".
5
<!ENTITY % common SYSTEM "common.ent">
6
%common;
7
]>
8
9
<refentry xmlns:xi="http://www.w3.org/2001/XInclude">
10
   <refentryinfo>
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>
16
    <authorgroup>
17
      <author>
18
	<firstname>Björn</firstname>
19
	<surname>Påhlsson</surname>
20
	<address>
505.1.2 by Teddy Hogeborn
Change "fukt.bsnet.se" to "recompile.se" throughout.
21
	  <email>belorn@recompile.se</email>
493 by Teddy Hogeborn
* Makefile (DOCS): Added "intro.8mandos".
22
	</address>
23
      </author>
24
      <author>
25
	<firstname>Teddy</firstname>
26
	<surname>Hogeborn</surname>
27
	<address>
505.1.2 by Teddy Hogeborn
Change "fukt.bsnet.se" to "recompile.se" throughout.
28
	  <email>teddy@recompile.se</email>
493 by Teddy Hogeborn
* Makefile (DOCS): Added "intro.8mandos".
29
	</address>
30
      </author>
31
    </authorgroup>
32
    <copyright>
33
      <year>2011</year>
544 by Teddy Hogeborn
Updated year in copyright notices.
34
      <year>2012</year>
778 by Teddy Hogeborn
Update copyright year.
35
      <year>2013</year>
36
      <year>2014</year>
37
      <year>2015</year>
807 by Teddy Hogeborn
Update copyright year.
38
      <year>2016</year>
899 by Teddy Hogeborn
Update copyright year to 2017
39
      <year>2017</year>
493 by Teddy Hogeborn
* Makefile (DOCS): Added "intro.8mandos".
40
      <holder>Teddy Hogeborn</holder>
41
      <holder>Björn Påhlsson</holder>
42
    </copyright>
43
    <xi:include href="legalnotice.xml"/>
44
  </refentryinfo>
45
  
46
  <refmeta>
47
    <refentrytitle>intro</refentrytitle>
48
    <manvolnum>8mandos</manvolnum>
49
  </refmeta>
50
  
51
  <refnamediv>
52
    <refname>intro</refname>
53
    <refpurpose>
54
      Introduction to the Mandos system
55
    </refpurpose>
56
  </refnamediv>
57
  
58
  <refsect1 id="description">
59
    <title>DESCRIPTION</title>
60
    <para>
61
      This is the the Mandos system, which allows computers to have
62
      encrypted root file systems and at the same time be capable of
63
      remote and/or unattended reboots.
64
    </para>
65
    <para>
66
      The computers run a small client program in the initial RAM disk
67
      environment which will communicate with a server over a network.
68
      All network communication is encrypted using TLS.  The clients
69
      are identified by the server using an OpenPGP key; each client
70
      has one unique to it.  The server sends the clients an encrypted
71
      password.  The encrypted password is decrypted by the clients
72
      using the same OpenPGP key, and the password is then used to
73
      unlock the root file system, whereupon the computers can
74
      continue booting normally.
75
    </para>
76
  </refsect1>
77
  
78
  <refsect1 id="introduction">
79
    <title>INTRODUCTION</title>
80
    <para>
889 by Teddy Hogeborn
Add comment in documentation source with clarifying text.
81
      <!-- This paragraph is a combination and paraphrase of two
82
           quotes from the 1995 movie “The Usual Suspects”. -->
493 by Teddy Hogeborn
* Makefile (DOCS): Added "intro.8mandos".
83
      You know how it is.  You’ve heard of it happening.  The Man
84
      comes and takes away your servers, your friends’ servers, the
85
      servers of everybody in the same hosting facility. The servers
86
      of their neighbors, and their neighbors’ friends.  The servers
87
      of people who owe them money.  And like
88
      <emphasis>that</emphasis>, they’re gone.  And you doubt you’ll
89
      ever see them again.
90
    </para>
91
    <para>
92
      That is why your servers have encrypted root file systems.
93
      However, there’s a downside.  There’s no going around it:
94
      rebooting is a pain.  Dragging out that rarely-used keyboard and
95
      screen and unraveling cables behind your servers to plug them in
96
      to type in that password is messy, especially if you have many
97
      servers.  There are some people who do clever things like using
98
      serial line consoles and daisy-chain it to the next server, and
99
      keep all the servers connected in a ring with serial cables,
100
      which will work, if your servers are physically close enough.
101
      There are also other out-of-band management solutions, but with
102
      <emphasis>all</emphasis> these, you still have to be on hand and
103
      manually type in the password at boot time.  Otherwise the
104
      server just sits there, waiting for a password.
105
    </para>
106
    <para>
107
      Wouldn’t it be great if you could have the security of encrypted
108
      root file systems and still have servers that could boot up
109
      automatically if there was a short power outage while you were
110
      asleep?  That you could reboot at will, without having someone
111
      run over to the server to type in the password?
112
    </para>
113
    <para>
114
      Well, with Mandos, you (almost) can!  The gain in convenience
115
      will only be offset by a small loss in security.  The setup is
116
      as follows:
117
    </para>
118
    <para>
119
      The server will still have its encrypted root file system.  The
120
      password to this file system will be stored on another computer
121
      (henceforth known as the Mandos server) on the same local
122
      network.  The password will <emphasis>not</emphasis> be stored
123
      in plaintext, but encrypted with OpenPGP.  To decrypt this
124
      password, a key is needed.  This key (the Mandos client key)
125
      will not be stored there, but back on the original server
126
      (henceforth known as the Mandos client) in the initial RAM disk
127
      image.  Oh, and all network Mandos client/server communications
128
      will be encrypted, using TLS (SSL).
129
    </para>
130
    <para>
131
      So, at boot time, the Mandos client will ask for its encrypted
132
      data over the network, decrypt it to get the password, use it to
133
      decrypt the root file, and continue booting.
134
    </para>
135
    <para>
136
      Now, of course the initial RAM disk image is not on the
137
      encrypted root file system, so anyone who had physical access
138
      could take the Mandos client computer offline and read the disk
139
      with their own tools to get the authentication keys used by a
140
      client.  <emphasis>But</emphasis>, by then the Mandos server
141
      should notice that the original server has been offline for too
142
      long, and will no longer give out the encrypted key.  The timing
143
      here is the only real weak point, and the method, frequency and
144
      timeout of the server’s checking can be adjusted to any desired
145
      level of paranoia
146
    </para>
147
    <para>
148
      (The encrypted keys on the Mandos server is on its normal file
149
      system, so those are safe, provided the root file system of
150
      <emphasis>that</emphasis> server is encrypted.)
151
    </para>
152
  </refsect1>
153
  
154
  <refsect1 id="faq">
155
    <title>FREQUENTLY ASKED QUESTIONS</title>
156
    <para>
157
      Couldn’t the security be defeated by…
158
    </para>
159
    <refsect2 id="quick">
160
      <title>Grabbing the Mandos client key from the
161
      initrd <emphasis>really quickly</emphasis>?</title>
162
    <para>
163
      This, as mentioned above, is the only real weak point.  But if
164
      you set the timing values tight enough, this will be really
165
      difficult to do.  An attacker would have to physically
166
      disassemble the client computer, extract the key from the
167
      initial RAM disk image, and then connect to a <emphasis>still
168
      online</emphasis> Mandos server to get the encrypted key, and do
169
      all this <emphasis>before</emphasis> the Mandos server timeout
170
      kicks in and the Mandos server refuses to give out the key to
171
      anyone.
172
    </para>
173
    <para>
174
      Now, as the typical procedure seems to be to barge in and turn
175
      off and grab <emphasis>all</emphasis> computers, to maybe look
176
      at them months later, this is not likely.  If someone does that,
177
      the whole system <emphasis>will</emphasis> lock itself up
178
      completely, since Mandos servers are no longer running.
179
    </para>
180
    <para>
181
      For sophisticated attackers who <emphasis>could</emphasis> do
182
      the clever thing, <emphasis>and</emphasis> had physical access
183
      to the server for enough time, it would be simpler to get a key
184
      for an encrypted file system by using hardware memory scanners
185
      and reading it right off the memory bus.
186
    </para>
187
    </refsect2>
188
    
189
    <refsect2 id="replay">
190
      <title>Replay attacks?</title>
191
      <para>
192
	Nope, the network stuff is all done over TLS, which provides
193
	protection against that.
194
      </para>
195
    </refsect2>
196
    
197
    <refsect2 id="mitm">
198
      <title>Man-in-the-middle?</title>
199
      <para>
200
	No.  The server only gives out the passwords to clients which
201
	have <emphasis>in the TLS handshake</emphasis> proven that
202
	they do indeed hold the OpenPGP private key corresponding to
203
	that client.
204
      </para>
205
    </refsect2>
206
    
742 by Teddy Hogeborn
Add ":!RSA" to GnuTLS priority string, to disallow non-DHE kx.
207
    <refsect2 id="sniff">
208
      <title>How about sniffing the network traffic and decrypting it
209
      later by physically grabbing the Mandos client and using its
210
      key?</title>
211
      <para>
212
	We only use <acronym>PFS</acronym> (Perfect Forward Security)
213
	key exchange algorithms in TLS, which protects against this.
214
      </para>
215
    </refsect2>
216
    
493 by Teddy Hogeborn
* Makefile (DOCS): Added "intro.8mandos".
217
    <refsect2 id="physgrab">
218
      <title>Physically grabbing the Mandos server computer?</title>
219
      <para>
220
	You could protect <emphasis>that</emphasis> computer the
221
	old-fashioned way, with a must-type-in-the-password-at-boot
222
	method.  Or you could have two computers be the Mandos server
223
	for each other.
224
      </para>
225
      <para>
226
	Multiple Mandos servers can coexist on a network without any
227
	trouble.  They do not clash, and clients will try all
228
	available servers.  This means that if just one reboots then
229
	the other can bring it back up, but if both reboot at the same
230
	time they will stay down until someone types in the password
231
	on one of them.
232
      </para>
233
    </refsect2>
234
    
708 by Teddy Hogeborn
mandos-keygen: Generate "checker" option to use SSH fingerprints.
235
    <refsect2 id="fakecheck">
236
      <title>Faking checker results?</title>
493 by Teddy Hogeborn
* Makefile (DOCS): Added "intro.8mandos".
237
      <para>
708 by Teddy Hogeborn
mandos-keygen: Generate "checker" option to use SSH fingerprints.
238
	If the Mandos client does not have an SSH server, the default
239
	is for the Mandos server to use
493 by Teddy Hogeborn
* Makefile (DOCS): Added "intro.8mandos".
240
	<quote><literal>fping</literal></quote>, the replies to which
241
	could be faked to eliminate the timeout.  But this could
242
	easily be changed to any shell command, with any security
708 by Teddy Hogeborn
mandos-keygen: Generate "checker" option to use SSH fingerprints.
243
	measures you like.  If the Mandos client
244
	<emphasis>has</emphasis> an SSH server, the default
245
	configuration (as generated by
246
	<command>mandos-keygen</command> with the
247
	<option>--password</option> option) is for the Mandos server
248
	to use an <command>ssh-keyscan</command> command with strict
249
	keychecking, which can not be faked.  Alternatively, IPsec
250
	could be used for the ping packets, making them secure.
493 by Teddy Hogeborn
* Makefile (DOCS): Added "intro.8mandos".
251
      </para>
252
    </refsect2>
253
  </refsect1>
254
  
255
  <refsect1 id="security">
256
    <title>SECURITY</title>
257
    <para>
258
      So, in summary:  The only weakness in the Mandos system is from
259
      people who have:
260
    </para>
261
    <orderedlist>
262
      <listitem>
263
	<para>
264
	  The power to come in and physically take your servers,
265
	  <emphasis>and</emphasis>
266
	</para>
267
      </listitem>
268
      <listitem>
269
	<para>
270
	  The cunning and patience to do it carefully, one at a time,
271
	  and <emphasis>quickly</emphasis>, faking Mandos
272
	  client/server responses for each one before the timeout.
273
	</para>
274
      </listitem>
275
    </orderedlist>
276
    <para>
277
      While there are some who may be threatened by people who have
278
      <emphasis>both</emphasis> these attributes, they do not,
279
      probably, constitute the majority.
280
    </para>
281
    <para>
282
      If you <emphasis>do</emphasis> face such opponents, you must
283
      figure that they could just as well open your servers and read
284
      the file system keys right off the memory by running wires to
285
      the memory bus.
286
    </para>
287
    <para>
288
      What Mandos is designed to protect against is
289
      <emphasis>not</emphasis> such determined, focused, and competent
290
      attacks, but against the early morning knock on your door and
291
      the sudden absence of all the servers in your server room.
292
      Which it does nicely.
293
    </para>
294
  </refsect1>
295
  
296
  <refsect1 id="plugins">
297
    <title>PLUGINS</title>
298
    <para>
299
      In the early designs, the
300
      <citerefentry><refentrytitle>mandos-client</refentrytitle
301
      ><manvolnum>8mandos</manvolnum></citerefentry> program (which
302
      retrieves a password from the Mandos server) also prompted for a
303
      password on the terminal, in case a Mandos server could not be
304
      found.  Other ways of retrieving a password could easily be
305
      envisoned, but this multiplicity of purpose was seen to be too
306
      complex to be a viable way to continue.  Instead, the original
307
      program was separated into <citerefentry><refentrytitle
308
      >mandos-client</refentrytitle><manvolnum>8mandos</manvolnum
309
      ></citerefentry> and <citerefentry><refentrytitle
310
      >password-prompt</refentrytitle><manvolnum>8mandos</manvolnum
311
      ></citerefentry>, and a <citerefentry><refentrytitle
312
      >plugin-runner</refentrytitle><manvolnum>8mandos</manvolnum
313
      ></citerefentry> exist to run them both in parallel, allowing
314
      the first successful plugin to provide the password.  This
315
      opened up for any number of additional plugins to run, all
316
      competing to be the first to find a password and provide it to
317
      the plugin runner.
318
    </para>
319
    <para>
320
      Four additional plugins are provided:
321
    </para>
322
    <variablelist>
323
      <varlistentry>
324
	<term>
325
	  <citerefentry><refentrytitle>plymouth</refentrytitle>
326
	  <manvolnum>8mandos</manvolnum></citerefentry>
327
	</term>
328
	<listitem>
329
	  <para>
330
	    This prompts for a password when using <citerefentry>
331
	    <refentrytitle>plymouth</refentrytitle><manvolnum
332
	    >8</manvolnum></citerefentry>.
333
	  </para>
334
	</listitem>
335
      </varlistentry>
336
      <varlistentry>
337
	<term>
338
	  <citerefentry><refentrytitle>usplash</refentrytitle>
339
	  <manvolnum>8mandos</manvolnum></citerefentry>
340
	</term>
341
	<listitem>
342
	  <para>
343
	    This prompts for a password when using <citerefentry>
344
	    <refentrytitle>usplash</refentrytitle><manvolnum
345
	    >8</manvolnum></citerefentry>.
346
	  </para>
347
	</listitem>
348
      </varlistentry>
349
      <varlistentry>
350
	<term>
351
	  <citerefentry><refentrytitle>splashy</refentrytitle>
352
	  <manvolnum>8mandos</manvolnum></citerefentry>
353
	</term>
354
	<listitem>
355
	  <para>
356
	    This prompts for a password when using <citerefentry>
357
	    <refentrytitle>splashy</refentrytitle><manvolnum
358
	    >8</manvolnum></citerefentry>.
359
	  </para>
360
	</listitem>
361
      </varlistentry>
362
      <varlistentry>
363
	<term>
364
	  <citerefentry><refentrytitle>askpass-fifo</refentrytitle>
365
	  <manvolnum>8mandos</manvolnum></citerefentry>
366
	</term>
367
	<listitem>
368
	  <para>
369
	    To provide compatibility with the "askpass" program from
370
	    cryptsetup, this plugin listens to the same FIFO as
371
	    askpass would do.
372
	  </para>
373
	</listitem>
374
      </varlistentry>
375
    </variablelist>
376
    <para>
377
      More plugins can easily be written and added by the system
378
      administrator; see the section called "WRITING PLUGINS" in
379
      <citerefentry><refentrytitle>plugin-runner</refentrytitle>
380
      <manvolnum>8mandos</manvolnum></citerefentry> to learn the
381
      plugin requirements.
382
    </para>
383
  </refsect1>
384
  
821 by Teddy Hogeborn
Add bug reporting information to manual pages
385
  <refsect1 id="bugs">
386
    <title>BUGS</title>
387
    <xi:include href="bugs.xml"/>
388
  </refsect1>
389
  
493 by Teddy Hogeborn
* Makefile (DOCS): Added "intro.8mandos".
390
  <refsect1 id="see_also">
391
    <title>SEE ALSO</title>
392
    <para>
393
      <citerefentry><refentrytitle>mandos</refentrytitle>
394
      <manvolnum>8</manvolnum></citerefentry>,
395
      <citerefentry><refentrytitle>mandos.conf</refentrytitle>
396
      <manvolnum>5</manvolnum></citerefentry>,
397
      <citerefentry><refentrytitle>mandos-clients.conf</refentrytitle>
398
      <manvolnum>5</manvolnum></citerefentry>,
399
      <citerefentry><refentrytitle>mandos-ctl</refentrytitle>
400
      <manvolnum>8</manvolnum></citerefentry>,
401
      <citerefentry><refentrytitle>mandos-monitor</refentrytitle>
402
      <manvolnum>8</manvolnum></citerefentry>,
403
      <citerefentry><refentrytitle>plugin-runner</refentrytitle>
404
      <manvolnum>8mandos</manvolnum></citerefentry>,
405
      <citerefentry><refentrytitle>mandos-client</refentrytitle>
406
      <manvolnum>8mandos</manvolnum></citerefentry>,
407
      <citerefentry><refentrytitle>password-prompt</refentrytitle>
408
      <manvolnum>8mandos</manvolnum></citerefentry>,
409
      <citerefentry><refentrytitle>plymouth</refentrytitle>
410
      <manvolnum>8mandos</manvolnum></citerefentry>,
411
      <citerefentry><refentrytitle>usplash</refentrytitle>
412
      <manvolnum>8mandos</manvolnum></citerefentry>,
413
      <citerefentry><refentrytitle>splashy</refentrytitle>
414
      <manvolnum>8mandos</manvolnum></citerefentry>,
415
      <citerefentry><refentrytitle>askpass-fifo</refentrytitle>
416
      <manvolnum>8mandos</manvolnum></citerefentry>,
417
      <citerefentry><refentrytitle>mandos-keygen</refentrytitle>
418
      <manvolnum>8</manvolnum></citerefentry>
419
    </para>
420
    <variablelist>
421
      <varlistentry>
422
	<term>
844 by Teddy Hogeborn
Use HTTPS in home page links
423
	  <ulink url="https://www.recompile.se/mandos">Mandos</ulink>
493 by Teddy Hogeborn
* Makefile (DOCS): Added "intro.8mandos".
424
	</term>
425
	<listitem>
426
	  <para>
427
	    The Mandos home page.
428
	  </para>
429
	</listitem>
430
      </varlistentry>
431
    </variablelist>
432
  </refsect1>
433
</refentry>
434
<!-- Local Variables: -->
435
<!-- time-stamp-start: "<!ENTITY TIMESTAMP [\"']" -->
436
<!-- time-stamp-end: "[\"']>" -->
437
<!-- time-stamp-format: "%:y-%02m-%02d" -->
438
<!-- End: -->