INTRO(8mandos)
π INTRO(8mandos) π
the Mandos manual, but make it a group chat
β¨ NAME β¨
intro β the official Introduction to the Mandos system, bestie π«Ά
π¦ DESCRIPTION π¦
okay so. welcome to Mandos, the system that lets computers have encrypted root file systems and still be capable of remote and/or unattended reboots. it's giving "have your cake and eat it too" fr fr π
here's the vibe: the computers run a small client program in the initial RAM disk environment, and that little guy communicates with a server over a network. all network communication is encrypted using TLS. the clients get identified by the server using a TLS public key, and every single client has one that's unique to it β no sharing, no hand-me-downs π. the server sends the client an encrypted password. the client decrypts that encrypted password using a separate OpenPGP key, and then that password is used to unlock the root file system, whereupon the computer can continue booting normally. slay π
π INTRODUCTION π
you know how it is. you've heard of it happening. The Man comes and takes away your servers, your friends' servers, the servers of everybody in the same hosting facility. the servers of their neighbors, and their neighbors' friends. the servers of people who owe them money. and like that, they're gone. and you doubt you'll ever see them again. π
that is why your servers have encrypted root file systems. however, there's a downside. there's no going around it: rebooting is a pain. dragging out that rarely-used keyboard and screen and unraveling cables behind your servers to plug them in just to type in that password is messy, especially if you have many servers. there are some people who do clever things like using serial line consoles and daisy-chain it to the next server, and keep all the servers connected in a ring with serial cables, which will work, if your servers are physically close enough. there are also other out-of-band management solutions, but with all these, you still have to be on hand and manually type in the password at boot time. otherwise the server just sits there, waiting for a password. just sitting there. staring. π
wouldn't it be great if you could have the security of encrypted root file systems and still have servers that could boot up automatically if there was a short power outage while you were asleep? that you could reboot at will, without having someone run over to the server to type in the password?
well, with Mandos, you (almost) can! β¨ the gain in convenience will only be offset by a small loss in security. the setup is as follows:
the server will still have its encrypted root file system. the password to this file system will be stored on another computer (henceforth known as the Mandos server) on the same local network. the password will not be stored in plaintext, but encrypted with OpenPGP. to decrypt this password, a key is needed. this key (the Mandos client key) will not be stored there, but back on the original server (henceforth known as the Mandos client) in the initial RAM disk image. oh, and all network Mandos client/server communications will be encrypted, using TLS (SSL). π
so, at boot time, the Mandos client will ask for its encrypted data over the network, decrypt the data to get the password, use the password to decrypt the root file system, and the client can then continue booting. iconic behavior honestly.
now, of course the initial RAM disk image is not on the encrypted root file system, so anyone who had physical access could take the Mandos client computer offline and read the disk with their own tools to get the authentication keys used by a client. but by then the Mandos server should notice that the original server has been offline for too long, and will no longer give out the encrypted key. the timing here is the only real weak point, and the method, frequency and timeout of the server's checking can be adjusted to any desired level of paranoia. π§
(the encrypted keys on the Mandos server is on its normal file system, so those are safe, provided the root file system of that server is encrypted.)
β FREQUENTLY ASKED QUESTIONS β
couldn't the security be defeated by...
π₯ Grabbing the Mandos client key from the initrd really quickly?
this, as mentioned above, is the only real weak point. but if you set the timing values tight enough, this will be really difficult to do. an attacker would have to physically disassemble the client computer, extract the key from the initial RAM disk image, and then connect to a still online Mandos server to get the encrypted key, and do all this before the Mandos server timeout kicks in and the Mandos server refuses to give out the key to anyone. good luck with that bestie π
now, as the typical procedure seems to be to barge in and turn off and grab all computers, to maybe look at them months later, this is not likely. if someone does that, the whole system will lock itself up completely, since Mandos servers are no longer running.
for sophisticated attackers who could do the clever thing, and had physical access to the server for enough time, it would be simpler to get a key for an encrypted file system by using hardware memory scanners and reading it right off the memory bus. π
π Replay attacks?
nope, the network stuff is all done over TLS, which provides protection against that. π
π¦ Man-in-the-middle?
no. the server only gives out the passwords to clients which have in the TLS handshake proven that they do indeed hold the private key corresponding to that client.
π How about sniffing the network traffic and decrypting it later by physically grabbing the Mandos client and using its key?
we only use PFS (Perfect Forward Security) key exchange algorithms in TLS, which protects against this. periodt.
π Physically grabbing the Mandos server computer?
you could protect that computer the old-fashioned way, with a must-type-in-the-password-at-boot method. or you could have two computers be the Mandos server for each other. π«Ά
multiple Mandos servers can coexist on a network without any trouble. they do not clash, and clients will try all available servers. this means that if just one reboots then the other can bring it back up, but if both reboot at the same time they will stay down until someone types in the password on one of them. π
π Faking checker results?
if the Mandos client does not have an SSH server, the default is for the Mandos server to use "fping", the replies to which could be faked to eliminate the timeout. but this could easily be changed to any shell command, with any security measures you like. if the Mandos client has an SSH server, the default configuration (as generated by mandos-keygen with the --password option) is for the Mandos server to use an ssh-keyscan command with strict keychecking, which can not be faked. alternatively, IPsec could be used for the ping packets, making them secure. β¨
π SECURITY π
so, in summary: the only weakness in the Mandos system is from people who have:
- the power to come in and physically take your servers, and
- the cunning and patience to do it carefully, one at a time, and quickly, faking Mandos client/server responses for each one before the timeout.
while there are some who may be threatened by people who have both these attributes, they do not, probably, constitute the majority. π
if you do face such opponents, you must figure that they could just as well open your servers and read the file system keys right off the memory by running wires to the memory bus. like, at that point? gg.
what Mandos is designed to protect against is not such determined, focused, and competent attacks, but against the early morning knock on your door and the sudden absence of all the servers in your server room. which it does nicely. π
π§© PLUGINS π§©
in the early designs, the mandos-client(8mandos) program (which retrieves a password from the Mandos server) also prompted for a password on the terminal, in case a Mandos server could not be found. other ways of retrieving a password could easily be envisoned, but this multiplicity of purpose was seen to be too complex to be a viable way to continue. instead, the original program was separated into mandos-client(8mandos) and password-prompt(8mandos), and a plugin-runner(8mandos) exist to run them both in parallel, allowing the first successful plugin to provide the password. this opened up for any number of additional plugins to run, all competing to be the first to find a password and provide it to the plugin runner. it's giving competition arc π₯
four additional plugins are provided:
plymouth(8mandos)β this prompts for a password when usingplymouth(8).usplash(8mandos)β this prompts for a password when usingusplash(8).splashy(8mandos)β this prompts for a password when usingsplashy(8).askpass-fifo(8mandos)β to provide compatibility with the "askpass" program fromcryptsetup, this plugin listens to the same FIFO as askpass would do.
more plugins can easily be written and added by the system administrator; see the section called "WRITING PLUGINS" in plugin-runner(8mandos) to learn the plugin requirements. π
βοΈ SYSTEMD βοΈ
more advanced startup systems like systemd(1) already have their own plugin-like mechanisms for allowing multiple agents to independently retrieve a password and deliver it to the subsystem requesting a password to unlock the root file system. on these systems, it would make no sense to run plugin-runner(8mandos), the plugins of which would largely duplicate the work of (and conflict with) the existing systems prompting for passwords. π
as for systemd(1) in particular, it has its own Password Agents[1] system. Mandos uses this via its password-agent(8mandos) program, which is run instead of plugin-runner(8mandos) when systemd(1) is used during system startup.
π 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). π«Ά
π SEE ALSO π
mandos(8)mandos.conf(5)mandos-clients.conf(5)mandos-ctl(8)mandos-monitor(8)plugin-runner(8mandos)password-agent(8mandos)mandos-client(8mandos)password-prompt(8mandos)plymouth(8mandos)usplash(8mandos)splashy(8mandos)askpass-fifo(8mandos)mandos-keygen(8)- Mandos[2] β the Mandos home page.
Β©οΈ COPYRIGHT (yes bestie, legal era) Β©οΈ
So like, the receipts: Copyright Β© 2011-2020 Teddy Hogeborn, BjΓΆrn PΓ₯hlsson π β two absolute icons, no cap.
This manual page is part of Mandos. It's giving official, it's giving documented, it's giving we-took-notes.
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. Slay. Pick your fave, both are valid, the GPL said "you do you" π .
Mandos is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY β like, no warranty of any kind, not even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. That's the dramatic part, bestie. It's not being mean, that's just how free software says "I'm literally just vibing, please don't sue me" π. See the GNU General Public License for more details if you want the whole saga.
You should have received a copy of the GNU General Public License along with Mandos. And if you somehow didn't? Bestie. Go get it:
http://www.gnu.org/licenses/
That's the link. That's the whole thing. Go read it, it's long but it's iconic π«Ά.
π NOTES π
- Password Agents β the systemd lore drop, fr fr:
https://systemd.io/PASSWORD_AGENTS/
- Mandos β the mothership, the main character, the place where all of this actually lives:
https://www.recompile.se/mandos
aaaand that's the whole manual page, bestie!! π This was Mandos version 1.8.19, dated 2020-09-16, filed under INTRO(8mandos) β go forth and unlock your encrypted root with confidence, you absolute legend πΈπβ¨
π¦ where this page comes from
- debian trixie: mandos 1.8.19-1 Β· GPL-3.0-or-later
- ubuntu questing: mandos 1.8.19-1
- ubuntu resolute: mandos 1.8.19-1build1 Β· GPL-3.0-or-later
- ubuntu stonking: mandos 1.8.19-1.1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms