table of contents
MANDOS-CLIENT(8mandos) | Mandos Manual | MANDOS-CLIENT(8mandos) |
NAME¶
mandos-client - Client for Mandos
SYNOPSIS¶
mandos-client
[--connect ADDRESS:PORT |
-c ADDRESS:PORT]
[--interface NAME[,NAME...] |
-i NAME[,NAME...]...]
[--pubkey FILE |
-p FILE]
[--seckey FILE |
-s FILE]
[--tls-privkey FILE |
-t FILE]
[--tls-pubkey FILE |
-T FILE]
[--priority STRING]
[--dh-bits BITS]
[--dh-params FILE]
[--delay SECONDS]
[--retry SECONDS]
[--network-hook-dir DIR]
[--debug]
mandos-client {--help | -?}
mandos-client --usage
mandos-client {--version | -V}
DESCRIPTION¶
mandos-client is a client program that communicates with mandos(8) to get a password. In slightly more detail, this client program brings up network interfaces, uses the interfaces’ IPv6 link-local addresses to get network connectivity, uses Zeroconf to find servers on the local network, and communicates with servers using TLS with a raw public key to ensure authenticity and confidentiality. This client program keeps running, trying all servers on the network, until it receives a satisfactory reply or a TERM signal. After all servers have been tried, all servers are periodically retried. If no servers are found it will wait indefinitely for new servers to appear.
The network interfaces are selected like this: If any interfaces are specified using the --interface option, those interface are used. Otherwise, mandos-client will use all interfaces that are not loopback interfaces, are not point-to-point interfaces, are capable of broadcasting and do not have the NOARP flag (see netdevice(7)). (If the --connect option is used, point-to-point interfaces and non-broadcast interfaces are accepted.) If any used interfaces are not up and running, they are first taken up (and later taken down again on program exit).
Before network interfaces are selected, all “network hooks” are run; see the section called “NETWORK HOOKS”.
This program is not meant to be run directly; it is really meant to be run by other programs in the initial RAM disk environment; see the section called “OVERVIEW”.
PURPOSE¶
The purpose of this is to enable remote and unattended rebooting of client host computer with an encrypted root file system. See the section called “OVERVIEW” for details.
OPTIONS¶
This program is commonly not invoked from the command line; it is normally started by another program as described in the section called “DESCRIPTION”. Any command line options this program accepts are therefore normally provided by the invoking program, and not directly.
--connect=ADDRESS:PORT, -c ADDRESS:PORT
Normally, Zeroconf would be used to locate Mandos servers, in which case this option would only be used when testing and debugging.
--interface=NAME[,NAME...], -i NAME[,NAME...]
If the --connect option is used, and exactly one interface name is specified (except “none”), this specifies the interface to use to connect to the address given.
Note that since this program will normally run in the initial RAM disk environment, the interface must be an interface which exists at that stage. Thus, the interface can normally not be a pseudo-interface such as “br0” or “tun0”; such interfaces will not exist until much later in the boot process, and can not be used by this program, unless created by a “network hook” — see the section called “NETWORK HOOKS”.
NAME can be the string “none”; this will make mandos-client only bring up interfaces specified before this string. This is not recommended, and only meant for advanced users.
--pubkey=FILE, -p FILE
--seckey=FILE, -s FILE
--tls-pubkey=FILE, -T FILE
--tls-privkey=FILE, -t FILE
--priority=STRING
“SECURE128:!CTYPE-X.509:+CTYPE-RAWPK:!RSA:!VERS-ALL:+VERS-TLS1.3:%PROFILE_ULTRA” when using raw public keys in TLS, and “SECURE256:!CTYPE-X.509:+CTYPE-OPENPGP:!RSA:+SIGN-DSA-SHA256” when using OpenPGP keys in TLS,. See gnutls_priority_init(3) for the syntax. Warning: changing this may make the TLS handshake fail, making server-client communication impossible. Changing this option may also make the network traffic decryptable by an attacker.
--dh-bits=BITS
--dh-params=FILE
--delay=SECONDS
--retry=SECONDS
--network-hook-dir=DIR
--debug
It will also enable debug mode in the Avahi and GnuTLS libraries, making them print large amounts of debugging output.
--help, -?
--usage
--version, -V
OVERVIEW¶
This is part of the Mandos system for allowing computers to have encrypted root file systems and at the same time be capable of remote and/or unattended reboots. The computers run a small client program in the initial RAM disk environment which will communicate with a server over a network. All network communication is encrypted using TLS. The clients are identified by the server using a TLS key; each client has one unique to it. The server sends the clients an encrypted password. The encrypted password is decrypted by the clients using a separate OpenPGP key, and the password is then used to unlock the root file system, whereupon the computers can continue booting normally.
This program is the client part. It is run automatically in an initial RAM disk environment.
In an initial RAM disk environment using systemd(1), this program is started by the Mandos password-agent(8mandos), which in turn is started automatically by the systemd(1) “Password Agent” system.
In the case of a non-systemd(1) environment, this program is started as a plugin of the Mandos plugin-runner(8mandos), which runs in the initial RAM disk environment because it is specified as a “keyscript” in the crypttab(5) file.
This program could, theoretically, be used as a keyscript in /etc/crypttab, but it would then be impossible to enter a password for the encrypted root disk at the console, since this program does not read from the console at all.
EXIT STATUS¶
This program will exit with a successful (zero) exit status if a server could be found and the password received from it could be successfully decrypted and output on standard output. The program will exit with a non-zero exit status only if a critical error occurs. Otherwise, it will forever connect to any discovered Mandos servers, trying to get a decryptable password and print it.
ENVIRONMENT¶
MANDOSPLUGINHELPERDIR
This program does not use any other environment variables, not even the ones provided by cryptsetup(8).
NETWORK HOOKS¶
If a network interface like a bridge or tunnel is required to find a Mandos server, this requires the interface to be up and running before mandos-client starts looking for Mandos servers. This can be accomplished by creating a “network hook” program, and placing it in a special directory.
Before the network is used (and again before program exit), any runnable programs found in the network hook directory are run with the argument “start” or “stop”. This should bring up or down, respectively, any network interface which mandos-client should use.
REQUIREMENTS¶
A network hook must be an executable file, and its name must consist entirely of upper and lower case letters, digits, underscores, periods, and hyphens.
A network hook will receive one argument, which can be one of the following:
start
stop
files
It is not necessary to print any non-executable files already in the network hook directory, these will be copied implicitly if they otherwise satisfy the name requirements.
modules
The network hook will be provided with a number of environment variables:
MANDOSNETHOOKDIR
DEVICE
MODE
VERBOSITY
DELAY
CONNECT
A hook may not read from standard input, and should be restrictive in printing to standard output or standard error unless VERBOSITY is “1”.
FILES¶
/conf/conf.d/mandos/pubkey.txt, /conf/conf.d/mandos/seckey.txt
/conf/conf.d/mandos/tls-pubkey.pem, /conf/conf.d/mandos/tls-privkey.pem
/lib/mandos/network-hooks.d
BUGS¶
Please report bugs to the Mandos development mailing list: <mandos-dev@recompile.se> (subscription required). Note that this list is public. The developers can be reached privately at <mandos@recompile.se> (OpenPGP key fingerprint 153A 37F1 0BBA 0435 987F 2C4A 7223 2973 CA34 C2C4 for encrypted mail).
EXAMPLE¶
Note that normally, command line options will not be given directly, but passed on via the program responsible for starting this program; see the section called “OVERVIEW”.
Normal invocation needs no options, if the network interfaces can be automatically determined:
mandos-client
Search for Mandos servers (and connect to them) using one specific interface:
mandos-client --interface eth1
Run in debug mode, and use custom keys:
mandos-client --debug --pubkey keydir/pubkey.txt --seckey keydir/seckey.txt --tls-pubkey keydir/tls-pubkey.pem --tls-privkey keydir/tls-privkey.pem
Run in debug mode, with custom keys, and do not use Zeroconf to locate a server; connect directly to the IPv6 link-local address “fe80::aede:48ff:fe71:f6f2”, port 4711, using interface eth2:
mandos-client --debug --pubkey keydir/pubkey.txt --seckey keydir/seckey.txt --tls-pubkey keydir/tls-pubkey.pem --tls-privkey keydir/tls-privkey.pem --connect fe80::aede:48ff:fe71:f6f2:4711 --interface eth2
SECURITY¶
This program assumes that it is set-uid to root, and will switch back to the original (and presumably non-privileged) user and group after bringing up the network interface.
To use this program for its intended purpose (see the section called “PURPOSE”), the password for the root file system will have to be given out to be stored in a server computer, after having been encrypted using an OpenPGP key. This encrypted data which will be stored in a server can only be decrypted by the OpenPGP key, and the data will only be given out to those clients who can prove they actually have that key. This key, however, is stored unencrypted on the client side in its initial RAM disk image file system. This is normally readable by all, but this is normally fixed during installation of this program; file permissions are set so that no-one is able to read that file.
The only remaining weak point is that someone with physical access to the client hard drive might turn off the client computer, read the OpenPGP and TLS keys directly from the hard drive, and communicate with the server. To safeguard against this, the server is supposed to notice the client disappearing and stop giving out the encrypted data. Therefore, it is important to set the timeout and checker interval values tightly on the server. See mandos(8).
It will also help if the checker program on the server is configured to request something from the client which can not be spoofed by someone else on the network, like SSH server key fingerprints, and unlike unencrypted ICMP echo (“ping”) replies.
Note: This makes it completely insecure to have Mandos clients which dual-boot to another operating system which is not trusted to keep the initial RAM disk image confidential.
SEE ALSO¶
intro(8mandos), cryptsetup(8), crypttab(5), mandos(8), password-agent(8mandos), plugin-runner(8mandos)
Zeroconf[1]
Avahi[2]
GnuTLS[3]
GPGME[4]
RFC 4291: IP Version 6 Addressing Architecture
Section 2.2: Text Representation of Addresses
Section 2.5.5.2: IPv4-Mapped IPv6 Address
Section 2.5.6, Link-Local IPv6 Unicast Addresses
RFC 5246: The Transport Layer Security (TLS) Protocol Version 1.2
RFC 4880: OpenPGP Message Format
RFC 7250: Using Raw Public Keys in Transport Layer Security (TLS) and Datagram Transport Layer Security (DTLS)
RFC 6091: Using OpenPGP Keys for Transport Layer Security
COPYRIGHT¶
Copyright © 2008-2019 Teddy Hogeborn, Björn
Påhlsson
This manual page is part of Mandos.
Mandos 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.
Mandos 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.
You should have received a copy of the GNU General Public License along with Mandos. If not, see http://www.gnu.org/licenses/.
NOTES¶
- 1.
- Zeroconf
- 2.
- Avahi
- 3.
- GnuTLS
- 4.
- GPGME
2023-10-21 | Mandos 1.8.17 |