2 ms·
One thing bothers me: > Unfortunately, you can’t encrypt your server key and it must be always available, or else sshd won’t start. The only thing protecting i
by mschuster91 12y ago
One thing bothers me:
> Unfortunately, you can’t encrypt your server key and it must be always available, or else sshd won’t start. The only thing protecting it is OS access controls.
That should be solvable with systemd and fuse - create an encrypting filesystem with a fixed key obtained from an USB pendrive, which is then ejected (so it would need a reboot to be enumerated again), and have the filesystem limit open() calls to the key file. It should not need more than one read call when openssh starts.
- mhurron 12y agoThat actually makes setting up SELinux seem like the simpler route.
- mschuster91 12y agoiirc SELinux can only restrict the process groups that are able to read the file, which doesn't help you in a remote code execution exploit inside openssh. The question is, is is possible to use the keys without having them in RAM any more?
- falcolas 12y ago> which doesn't help you in a remote code execution exploit inside openssh To be fair, If it gets to the point where they are executing arbitrary code in the openssh process, your key is already compromised. SELinux would help with most other causes of key leaks, however. > The question is, is is possible to use the keys without having them in RAM any more? In my (albeit limited) experience, no. Even if only because context switching would push the key out of the CPU registers and into RAM if it occurred at the wrong time.
- jamiesonbecker 12y ago> To be fair, If it gets to the point where they are executing arbitrary code in the openssh process, your key is already compromised. This. Exactly.
- tedunangst 12y agohttp://en.wikipedia.org/wiki/TRESOR http://en.wikipedia.org/wiki/TRESOR
- Gracana 12y agoAnother option would be to store the keys in a TPM, though there are some downsides to that as well. Here's one page that details such a process: http://www.lorier.net/docs/tpm http://www.lorier.net/docs/tpm
- cnvogel 12y agoUnfortunately the ssh-key (probably not the verbatim file, but of course the parts comprising the mathematical key) will have to stay in the sshd process' memory. If one wants to make it impossible for a "offline thief" (e.g. one that does not have permanent root-access to a compromised server) to make a man-in-the-middle using the server's key, one would have to store the ssh-server's key in a secure USB token. Ideally this token will count the number of ssh-signing and key-exchange operations so that an attacker remotely accessing the USB token might also be detectable.