1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY VERSION "1.0">
<!ENTITY COMMANDNAME "mandos">
<!ENTITY OVERVIEW SYSTEM "overview.xml">
]>
<refentry>
<refentryinfo>
<title>&COMMANDNAME;</title>
<!-- NWalsh’s docbook scripts use this to generate the footer: -->
<productname>&COMMANDNAME;</productname>
<productnumber>&VERSION;</productnumber>
<authorgroup>
<author>
<firstname>Björn</firstname>
<surname>Påhlsson</surname>
<address>
<email>belorn@fukt.bsnet.se</email>
</address>
</author>
<author>
<firstname>Teddy</firstname>
<surname>Hogeborn</surname>
<address>
<email>teddy@fukt.bsnet.se</email>
</address>
</author>
</authorgroup>
<copyright>
<year>2008</year>
<holder>Teddy Hogeborn</holder>
<holder>Björn Påhlsson</holder>
</copyright>
<legalnotice>
<para>
This manual page is free software: you can redistribute it
and/or modify it under the terms of the GNU General Public
License as published by the Free Software Foundation,
either version 3 of the License, or (at your option) any
later version.
</para>
<para>
This manual page is distributed in the hope that it will
be useful, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License
for more details.
</para>
<para>
You should have received a copy of the GNU General Public
License along with this program; If not, see
<ulink url="http://www.gnu.org/licenses/"/>.
</para>
</legalnotice>
</refentryinfo>
<refmeta>
<refentrytitle>&COMMANDNAME;</refentrytitle>
<manvolnum>8</manvolnum>
</refmeta>
<refnamediv>
<refname><command>&COMMANDNAME;</command></refname>
<refpurpose>
Sends encrypted passwords to authenticated Mandos clients
</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
<command>&COMMANDNAME;</command>
<arg choice="opt">--interface<arg choice="plain">IF</arg></arg>
<arg choice="opt">--address<arg choice="plain">ADDRESS</arg></arg>
<arg choice="opt">--port<arg choice="plain">PORT</arg></arg>
<arg choice="opt">--priority<arg choice="plain">PRIORITY</arg></arg>
<arg choice="opt">--servicename<arg choice="plain">NAME</arg></arg>
<arg choice="opt">--configdir<arg choice="plain">DIRECTORY</arg></arg>
<arg choice="opt">--debug</arg>
</cmdsynopsis>
<cmdsynopsis>
<command>&COMMANDNAME;</command>
<arg choice="opt">-i<arg choice="plain">IF</arg></arg>
<arg choice="opt">-a<arg choice="plain">ADDRESS</arg></arg>
<arg choice="opt">-p<arg choice="plain">PORT</arg></arg>
<arg choice="opt">--priority<arg choice="plain">PRIORITY</arg></arg>
<arg choice="opt">--servicename<arg choice="plain">NAME</arg></arg>
<arg choice="opt">--configdir<arg choice="plain">DIRECTORY</arg></arg>
<arg choice="opt">--debug</arg>
</cmdsynopsis>
<cmdsynopsis>
<command>&COMMANDNAME;</command>
<arg choice="plain">--help</arg>
</cmdsynopsis>
<cmdsynopsis>
<command>&COMMANDNAME;</command>
<arg choice="plain">--version</arg>
</cmdsynopsis>
<cmdsynopsis>
<command>&COMMANDNAME;</command>
<arg choice="plain">--check</arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1 id="description">
<title>DESCRIPTION</title>
<para>
<command>&COMMANDNAME;</command> is a server daemon which
handles incoming request for passwords for a pre-defined list of
client host computers. The Mandos server uses Zeroconf to
announce itself on the local network, and uses TLS to
communicate securely with and to authenticate the clients. The
Mandos server uses IPv6 to allow Mandos clients to use IPv6
link-local addresses, since the clients will probably not have
any other addresses configured (see <xref linkend="overview"/>).
Any authenticated client is then given the stored pre-encrypted
password for that specific client.
</para>
</refsect1>
<refsect1 id="purpose">
<title>PURPOSE</title>
<para>
The purpose of this is to enable <emphasis>remote and unattended
rebooting</emphasis> of client host computer with an
<emphasis>encrypted root file system</emphasis>. See <xref
linkend="overview"/> for details.
</para>
</refsect1>
<refsect1 id="options">
<title>OPTIONS</title>
<variablelist>
<varlistentry>
<term><literal>-h</literal>, <literal>--help</literal></term>
<listitem>
<para>
Show a help message and exit
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>-i</literal>, <literal>--interface <replaceable>
IF</replaceable></literal></term>
<listitem>
<para>
Only announce the server and listen to requests on network
interface <replaceable>IF</replaceable>. Default is to
use all available interfaces.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>-a</literal>, <literal>--address <replaceable>
ADDRESS</replaceable></literal></term>
<listitem>
<para>
If this option is used, the server will only listen to a
specific address. This must currently be an IPv6 address;
an IPv4 address can be specified using the
<quote><literal>::FFFF:192.0.2.3</literal></quote> syntax.
Also, if a link-local address is specified, an interface
should be set, since a link-local address is only valid on
a single interface. By default, the server will listen to
all available addresses.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>-p</literal>, <literal>--port <replaceable>
PORT</replaceable></literal></term>
<listitem>
<para>
If this option is used, the server to bind to that
port. By default, the server will listen to an arbitrary
port given by the operating system.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>--check</literal></term>
<listitem>
<para>
Run the server’s self-tests. This includes any unit
tests, etc.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>--debug</literal></term>
<listitem>
<para>
If the server is run in debug mode, it will run in the
foreground and print a lot of debugging information. The
default is <emphasis>not</emphasis> to run in debug mode.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>--priority <replaceable>
PRIORITY</replaceable></literal></term>
<listitem>
<para>
GnuTLS priority string for the TLS handshake with the
clients. The default is
<quote><literal>SECURE256:!CTYPE-X.509:+CTYPE-OPENPGP</literal></quote>.
See <citerefentry><refentrytitle>gnutls_priority_init
</refentrytitle><manvolnum>3</manvolnum></citerefentry>
for the syntax. <emphasis>Warning</emphasis>: changing
this may make the TLS handshake fail, making communication
with clients impossible.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>--servicename <replaceable>NAME</replaceable>
</literal></term>
<listitem>
<para>
Zeroconf service name. The default is
<quote><literal>Mandos</literal></quote>. You only need
to change this if you for some reason want to run more
than one server on the same <emphasis>host</emphasis>,
which would not normally be useful. If there are name
collisions on the same <emphasis>network</emphasis>, the
newer server will automatically rename itself to
<quote><literal>Mandos #2</literal></quote>, and so on;
therefore, this option is not needed in that case.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>--configdir <replaceable>DIR</replaceable>
</literal></term>
<listitem>
<para>
Directory to search for configuration files. Default is
<quote><literal>/etc/mandos</literal></quote>. See
<citerefentry><refentrytitle>mandos.conf</refentrytitle>
<manvolnum>5</manvolnum></citerefentry> and <citerefentry>
<refentrytitle>mandos-clients.conf</refentrytitle>
<manvolnum>5</manvolnum></citerefentry>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>--version</literal></term>
<listitem>
<para>
Prints the program version and exit.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="overview">
<title>OVERVIEW</title>
&OVERVIEW;
<para>
This program is the server part. It is a normal server program
and will run in a normal system environment, not in an initial
RAM disk environment.
</para>
</refsect1>
<refsect1 id="protocol">
<title>NETWORK PROTOCOL</title>
<para>
The Mandos server announces itself as a Zeroconf service of type
<quote><literal>_mandos._tcp</literal></quote>. The Mandos
client connects to the announced address and port, and sends a
line of text where the first whitespace-separated field is the
protocol version, which currently is
<quote><literal>1</literal></quote>. The client and server then
start a TLS protocol handshake with a slight quirk: the Mandos
server program acts as a TLS <quote>client</quote> while the
connecting Mandos client acts as a TLS <quote>server</quote>.
The Mandos client must supply an OpenPGP certificate, and the
fingerprint of this certificate is used by the Mandos server to
look up (in a list read from <filename>clients.conf</filename>
at start time) which binary blob to give the client. No other
authentication or authorization is done by the server.
</para>
<table>
<title>Mandos Protocol (Version 1)</title><tgroup cols="3"><thead>
<row>
<entry>Mandos Client</entry>
<entry>Direction</entry>
<entry>Mandos Server</entry>
</row>
</thead><tbody>
<row>
<entry>Connect</entry>
<entry>-><!-- → --></entry>
</row>
<row>
<entry><quote><literal>1\r\en</literal></quote></entry>
<entry>-><!-- → --></entry>
</row>
<row>
<entry>TLS handshake <emphasis>as TLS <quote>server</quote>
</emphasis></entry>
<entry><-><!-- ⟷ --></entry>
<entry>TLS handshake <emphasis>as TLS <quote>client</quote>
</emphasis></entry>
</row>
<row>
<entry>OpenPGP public key (part of TLS handshake)</entry>
<entry>-><!-- → --></entry>
</row>
<row>
<entry/>
<entry><-<!-- ← --></entry>
<entry>Binary blob (client will assume OpenPGP data)</entry>
</row>
<row>
<entry/>
<entry><-<!-- ← --></entry>
<entry>Close</entry>
</row>
</tbody></tgroup></table>
</refsect1>
<refsect1 id="checking">
<title>CHECKING</title>
<para>
The server will, by default, continually check that the clients
are still up. If a client has not been confirmed as being up
for some time, the client is assumed to be compromised and is no
longer eligible to receive the encrypted password. The timeout,
checker program, and interval between checks can be configured
both globally and per client; see <citerefentry>
<refentrytitle>mandos.conf</refentrytitle>
<manvolnum>5</manvolnum></citerefentry> and <citerefentry>
<refentrytitle>mandos-clients.conf</refentrytitle>
<manvolnum>5</manvolnum></citerefentry>.
</para>
</refsect1>
<refsect1 id="logging">
<title>LOGGING</title>
<para>
The server will send log messaged with various severity levels
to <filename>/dev/log</filename>. With the
<option>--debug</option> option, it will log even more messages,
and also show them on the console.
</para>
</refsect1>
<refsect1 id="exit_status">
<title>EXIT STATUS</title>
<para>
The server will exit with a non-zero exit status only when a
critical error is encountered.
</para>
</refsect1>
<refsect1 id="file">
<title>FILES</title>
<para>
Use the <option>--configdir</option> option to change where
<command>&COMMANDNAME;</command> looks for its configurations
files. The default file names are listed here.
</para>
<variablelist>
<varlistentry>
<term><filename>/etc/mandos/mandos.conf</filename></term>
<listitem>
<para>
Server-global settings. See
<citerefentry><refentrytitle>mandos.conf</refentrytitle>
<manvolnum>5</manvolnum></citerefentry> for details.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><filename>/etc/mandos/clients.conf</filename></term>
<listitem>
<para>
List of clients and client-specific settings. See
<citerefentry><refentrytitle>mandos-clients.conf</refentrytitle>
<manvolnum>5</manvolnum></citerefentry> for details.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><filename>/var/run/mandos/mandos.pid</filename></term>
<listitem>
<para>
The file containing the process id of
<command>&COMMANDNAME;</command>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><filename>/dev/log</filename></term>
<listitem>
<para>
The Unix domain socket to where local syslog messages are
sent.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="bugs">
<title>BUGS</title>
<para>
This server might, on especially fatal errors, emit a Python
backtrace. This could be considered a feature.
</para>
</refsect1>
<refsect1 id="examples">
<title>EXAMPLES</title>
<informalexample>
<para>
Normal invocation needs no options:
</para>
<para>
<userinput>mandos</userinput>
</para>
</informalexample>
<informalexample>
<para>
Run the server in debug mode, read configuration files from
the <filename>~/mandos</filename> directory, and use the
Zeroconf service name <quote>Test</quote> to not collide with
any other official Mandos server on this host:
</para>
<para>
<!-- do not wrap this line -->
<userinput>mandos --debug --configdir ~/mandos --servicename Test</userinput>
</para>
</informalexample>
<informalexample>
<para>
Run the server normally, but only listen to one interface and
only on the link-local address on that interface:
</para>
<para>
<!-- do not wrap this line -->
<userinput>mandos --interface eth7 --address fe80::aede:48ff:fe71:f6f2</userinput>
</para>
</informalexample>
</refsect1>
<refsect1 id="security">
<title>SECURITY</title>
<refsect2>
<title>SERVER</title>
<para>
Running this &COMMANDNAME; server program should not in itself
present any security risk to the host computer running it.
The program does not need any special privileges to run, and
is designed to run as a non-root user.
</para>
</refsect2>
<refsect2>
<title>CLIENTS</title>
<para>
The server only gives out its stored data to clients which
does have the OpenPGP key of the stored fingerprint. This is
guaranteed by the fact that the client sends its OpenPGP
public key in the TLS handshake; this ensures it to be
genuine. The server computes the fingerprint of the key
itself and looks up the fingerprint in its list of
clients. The <filename>clients.conf</filename> file (see
<citerefentry><refentrytitle>mandos-clients.conf</refentrytitle>
<manvolnum>5</manvolnum></citerefentry>)
<emphasis>must</emphasis> be made non-readable by anyone
except the user running the server.
</para>
<para>
As detailed in <xref linkend="checking"/>, the status of all
client computers will continually be checked and be assumed
compromised if they are gone for too long.
</para>
<para>
For more details on client-side security, see
<citerefentry><refentrytitle>password-request</refentrytitle>
<manvolnum>8mandos</manvolnum></citerefentry>.
</para>
</refsect2>
</refsect1>
<refsect1 id="see_also">
<title>SEE ALSO</title>
<variablelist>
<varlistentry>
<term>
<citerefentry>
<refentrytitle>password-request</refentrytitle>
<manvolnum>8mandos</manvolnum>
</citerefentry>
</term>
<listitem>
<para>
This is the actual program which talks to this server.
Note that it is normally not invoked directly, and is only
run in the initial RAM disk environment, and not on a
fully started system.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<ulink url="http://www.zeroconf.org/">Zeroconf</ulink>
</term>
<listitem>
<para>
Zeroconf is the network protocol standard used by clients
for finding this Mandos server on the local network.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<ulink url="http://www.avahi.org/">Avahi</ulink>
</term>
<listitem>
<para>
Avahi is the library this server calls to implement
Zeroconf service announcements.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<ulink
url="http://www.gnu.org/software/gnutls/">GnuTLS</ulink>
</term>
<listitem>
<para>
GnuTLS is the library this server uses to implement TLS for
communicating securely with the client, and at the same time
confidently get the client’s public OpenPGP key.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<citation>RFC 4291: <citetitle>IP Version 6 Addressing
Architecture</citetitle>, section 2.5.6, Link-Local IPv6
Unicast Addresses</citation>
</term>
<listitem>
<para>
The clients use IPv6 link-local addresses, which are
immediately usable since a link-local addresses is
automatically assigned to a network interfaces when it is
brought up.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<citation>RFC 4346: <citetitle>The Transport Layer Security
(TLS) Protocol Version 1.1</citetitle></citation>
</term>
<listitem>
<para>
TLS 1.1 is the protocol implemented by GnuTLS.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<citation>RFC 4880: <citetitle>OpenPGP Message
Format</citetitle></citation>
</term>
<listitem>
<para>
The data sent to clients is binary encrypted OpenPGP data.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<citation>RFC 5081: <citetitle>Using OpenPGP Keys for
Transport Layer Security</citetitle></citation>
</term>
<listitem>
<para>
This is implemented by GnuTLS and used by this server so
that OpenPGP keys can be used.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
</refentry>
|