4 ms·
> There is no reason why your PDF viewer should be able to read your SSH keys, for example. Well GNOME's evince can read remote files over at least http/https
by rwmj 8y ago
> There is no reason why your PDF viewer should be able to read your SSH keys, for example.
Well GNOME's evince can read remote files over at least http/https and ftp, eg: evince ftp://remote/foo.pdf. I guess it's just a short step to adding ssh/sftp support. The remote support is implemented using glib's https://developer.gnome.org/gio//2.36/GFile.html#g-file-new-for-uri https://developer.gnome.org/gio//2.36/GFile.html#g-file-new-... which has a generic plugin mechanism for URL schemas, although I didn't look into whether ssh is already supported.
:-)
- doomrobo 8y agoEven then, an ssh subprocess can talk to ssh-agent instead of directly reading keys.
- rwmj 8y agoI have some interest in this since I wrote the initial version of ssh integration in qemu, and I have looked at how sshfs is implemented too. For the ssh integration in qemu we used libssh2 (initially, about to be replaced by libssh which is confusingly a different but better library). sshfs on the other hand runs the plain ssh binary in a subprocess and performs its own sftp protocol on top of the ssh connection (with sftp being done inside the sshfs binary). From a security point of view sshfs is certainly a better approach. However for qemu we were concerned mainly about performance, and some testing that I did at the time indicated that the library approach (libssh2/libssh) would perform better which was why we went that way. I guess the lesson here is that retrofitting security to existing applications is difficult, or perhaps the lesson is that Linux applications should be split into cooperating processes using lightweight messaging, like QNX or L4. Even ignoring ssh, the same problem applies to evince + https currently (reading client certificates), and that is certainly not implemented using a subprocess, nor would it be very easy to change that considering how difficult it is to correctly run a subprocess from a multithreaded library using Linux / POSIX APIs.
- Athas 8y agoI'd argue this is a misfeature. Different users have different needs, but I really like knowing that especially my basic "view a file downloaded from the Internet"-applications have a limited attack surface, even if that means it has fewer features. Actually, I'd prefer to have that confidence for all my applications, possibly except necessarily overcomplicated behemoths like web browsers or Emacs.
- mikepurvis 8y agoWouldn't it be better to expose these other schemas via FUSE mounts anyway? I suppose the main issue is one of UX— how do you make a system "Open file/path" dialog that under the hood is capable of setting up and properly lifecycling something like an sshfs mount? Almost seems like a thing you'd want support for at the systemd service level. OTOH, doing it as a system dialog that runs safely in its own process feels a lot better to me than building the functionality into every app in a piecemeal way.
- chmod775 8y agoThings like sshfs exist to solve this transparently. You could even create a wrapper that'd mount the remote endpoint to a temporary location, runs your application with that path, then unmounts once your application exits.
- rwmj 8y agoThis doesn't actually help assuming that unveil(2) persists across a fork (and if it doesn't then that's a back door, and if fork is banned using pledge(2) then you can't use sshfs anyway).