/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to intro.xml

  • Committer: Teddy Hogeborn
  • Date: 2016-03-19 03:51:23 UTC
  • Revision ID: teddy@recompile.se-20160319035123-53w4dbzdyjef29m1
Server: New tmpfiles.d file for persistent state directory

Provide a tmpfiles.d(5) file for systemd to create persistent state
directory on so-called "volatile" systems.

* Makefile (TMPFILES): New.
  (install-server): Also install "tmpfiles.d-mandos.conf" file as
                    "/usr/lib/tmpfiles.d/mandos.conf".
* tmpfiles.d-mandos.conf: New.

Show diffs side-by-side

added added

removed removed

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