A new userspace should be built similar to Android with proper capability-based sandboxes.
A new userspace should be built similar to Android with proper capability-based sandboxes.
Flatpak, snap, etc don't work as they just try to make the current desktop philosophy secure, without the application and the rest of the OS really being aware of it. Android and ios have been designed to offer native features for fine grained access control and isolation. For a desktop os, you need the same, from the ground up, and every app needs to be tailored to this. You'll start with a desert and tumbleweed.
This will never work, because it's simply too late: The web. A Chromebook pretty much does all the isolation you want on a different level, and is enough for the vast majority of people. I know you can now list a thousand things you cannot do in a browser and whatnot, but consider that the folks here on HN are a very rare breed.
And again, as you even said, for such a hypothetical sndboxing desktop os, user space needs to be rebuilt in large parts from scratch. Not in a hundred years. There so many things that are still lacking on the linux desktop today that this would at best be yet another experimental toy OS with no real world usability.
For me it's simply two separate, physical machines, one for online banking and sensitive stuff, the other for dev work, games, goofing off, and one or two android devices for other random crap. That's my sandboxing.
Also, Linux user space is not famous for being binary backwards compatible, and everything being source available, I think with a clever abstraction it could potentially work.
From the several toe dips I did with Linux desktop over the years, 99.9% of all user-space GUI programs will not be missed by more than 5000 hardcore fans anyway.
Rust, Zig, Nim, D -- all fine languages, and all gradually travel to having a proper UI toolkit (or solid bindings to the existing ones, more often).
I happen to believe that when the solid foundation gets created we'll see an explosion of high-quality Linux desktop programs. But various problems with Qt and GTK are preventing it (licenses included)... for now.
IMO desktop Linux has a future -- and I am saying this as a vocal critic of it. But there are some obstacles that haven't been overcome yet.
On the other hand, maybe Gnome should copy qubes or everyone should just make qubes ready for everyday use.
As for Qubes, it is cool, but I don’t think that such a massive performance degradation/requirement is feasible. Also, I’m not sure how great it is from an everyday usability point of view. If the user will rather run everything in a single vm, because it doesn’t work otherwise, we are back to where we are now.
If the Linux desktop started with a design just as good I don't think I would live long enough to see it rendered acceptable.
But I agree that ios has it better.
Why do poeple always forget that Plan9 exists? The Android way is the wrong way to do it.
But my knowledge of Plan9 is not extensive so correct me if I’m wrong.
When you plug in an USB device it shows up in the list of devices. Then you can mount it as your unprivileged user in the private namespace of your own shell, no issues there with permissions. If that USB device has a filesystem that supports user/group permissions, then you have access only to the files that you own.
Your user will have access to devices when it's included in the required system groups, 'sys' IIRC. It might get added to that group when it is created by the "hostowner" user, usually "glenda".
If you don't know Plan 9, you should check out the linked user guide, it's an excellent introduction to the concepts.
[1]: https://pspodcasting.net/dan/blog/2019/plan9_desktop.html
Also, the major threats to my security from my laptop are not other users. I'm not scared of the other users of my laptop. Who even are they? they're people who've already taken advantage of security holes in applications to break in. The people who I am concerned with are the authors of the applications that run. It's more like reading the file I want to publish vs data exfiltration: I want the application to engage in this class of actions - but only the members of this class that I authorise, not everything.
I want Firefox to be able to read and write within my home directory, but under no circumstances should a bug in Firefox allow a website to read a file I haven't given it.
But I also don't want my private file to be somehow in the private namespace of a certain program. Private files are not the property of a foreign program, they're my property. I want to know where they are so I can back them up, replace them atomically for all programs that use it etc. The Android approach of making my private information the property of some semi-trusted application author is crazy.
To me, it seems like a secure system would not give a program access to global namespaces like the filesystem nor to be able to enumerate local resources. The program could have its own state and configuration stores, but when it wants to access a file, it asks for permission to read a file, the system asks me how to fulfil that (i.e. pops up a file selection interface), I make a choice, the system passes a file descriptor, the program knows that it uses 7 to read and write. But the system doesn't know that it's getting /home/me/downloads/ketchup-and-mayo.jpg. Likewise, the system asks for my location, and I get a few buttons "give current location, give stored location, spoof".
Does plan9 address this? Android I know is too course-grained. It has enough of this to be annoying but in reality you can either give the program full power over this or that feature or you can give it no power and it probably just won't meaningfully run. I'd love to run every program in a sandbox, but I want to be able to own my files.
The Linux "root" account, or UID 0, is the same everywhere, and this becomes a problem when you start working in a clustered environments with multiple computers sharing resources. Look at NFS and its multiple versions and that huge fight to protect access via 'root' account.
In Plan 9 there's a concept of a "hostowner" account, by convention named "glenda". It's the account that the system is started with, and it only concerns itself with resources on that host, there's no sharing with other systems. The 'glenda' account owns resources of the host and can give access to them to other accounts, either via filesystem permissions or via the "factotum" authentication service. Combine this with the fact that on Plan 9 you can change process privileges and capabilities dynamically, unlike in Linux where this can happen only when process is created, and this creates a really nice and secure environment to work in.
> Also, the major threats to my security from my laptop are not other users. I'm not scared of the other users of my laptop. Who even are they? they're people who've already taken advantage of security holes in applications to break in. The people who I am concerned with are the authors of the applications that run. It's more like reading the file I want to publish vs data exfiltration: I want the application to engage in this class of actions - but only the members of this class that I authorise, not everything.
> I want Firefox to be able to read and write within my home directory, but under no circumstances should a bug in Firefox allow a website to read a file I haven't given it.
Before you start Firefox, you can clean up its private namespace and unmount the sutff you don't want to give it access to. Or create a new private namespace and only mount specific directories from your home directory in it, like /home/user/Downloads. This is basically whitelisting access to the filesystem instead of having to blacklist everything but specific directories which will never be foolproof.
> But I also don't want my private file to be somehow in the private namespace of a certain program. Private files are not the property of a foreign program, they're my property. I want to know where they are so I can back them up, replace them atomically for all programs that use it etc. The Android approach of making my private information the property of some semi-trusted application author is crazy.
Then create the process namespace from scratch, mount only the files that program is supposed to access and then start that program in there. It will not be able to mount anything else because your home directory or other shared resources will not be reachable by the process.
> To me, it seems like a secure system would not give a program access to global namespaces like the filesystem nor to be able to enumerate local resources. The program could have its own state and configuration stores, but when it wants to access a file, it asks for permission to read a file, the system asks me how to fulfil that (i.e. pops up a file selection interface), I make a choice, the system passes a file descriptor, the program knows that it uses 7 to read and write. But the system doesn't know that it's getting /home/me/downloads/ketchup-and-mayo.jpg. Likewise, the system asks for my location, and I get a few buttons "give current location, give stored location, spoof".
You can just unmount /dev to disallow access to devices. You can unmount /net to disallow access to the network.
> Does plan9 address this? Android I know is too course-grained. It has enough of this to be annoying but in reality you can either give the program full power over this or that feature or you can give it no power and it probably just won't meaningfully run. I'd love to run every program in a sandbox, but I want to be able to own my files.
Yes, the notion that privileged access does not exist at all might seem crazy at first, but when you think about it, and imagine how currently "privileged" actions like mounting filesystems could be done without it, it starts to make sense.
(EDIT: I'd not propose to actually rewrite existing infra in Rust, but at least flatpack 3.0 or whatever the next version would be, would benefit from this)