Relevancy of user separation for sandboxing #125
-
Hello! I've been looking at isolation solutions in Linux, and I stumbled into this quote from the Kicksecure wiki: "Sandboxing programs running as the same user has historically, never seriously worked well. It’s been the cause of many issues with e.g. Flatpak. It’s why Android/iOS have always used separate users." This quote seems to be 4 years old. Is it still preferable to run sandboxed programs as their own user if possible, using e.g. sudo or machinectl? What are some potential pitfalls of not doing so? Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hello @odomingao The obvious downside is that you will have to have some kind of privilege elevation like sudo in order to use different user to sandbox. This elevation tool can have vulnerabilities of its own which will run as root because of nature of SUID programs. Also sharing folders will become very problematic as all files will belong to a different user. |
Beta Was this translation helpful? Give feedback.
-
Yes. Users are the privilege separation ground every nix* of the last 40 years is build on. Not necessarily su(do)/pkexec/systemd/run0/machinectl. Even unprivileged podman can change the uid.
Sharing resources and accessing APIs:
Opening access to them removes already 50% of what you win with a different uid. Ideally you run a full sandboxed session for every program. TL;DR:
|
Beta Was this translation helpful? Give feedback.
Yes. Users are the privilege separation ground every nix* of the last 40 years is build on.
Not necessarily su(do)/pkexec/systemd/run0/machinectl. Even unprivileged podman can change the uid.
Sharing resources and accessing APIs:
Opening access to them removes already 50% of what you win with a different uid. Ideally you run a full sandboxed session for every program.
gnome-shell/mutter were technically good in nested usage. However it is very inco…