Add a portal to escape the sandbox (like sudo) #1808
Replies: 3 comments 3 replies
-
We already have |
Beta Was this translation helpful? Give feedback.
-
What would the UI for prompting the user be like? Are you imagining something like this? (probably not this text but you get the idea...)
This seems like a classic example of the dancing pigs design that portals try hard to avoid: however scary we make the text, the user is going to say "allow" because otherwise they'll be prevented from doing what they already decided they want to do. And even if we show (a stringified version of) the command that the app wants to run, how many Flatpak/Snap/etc. users can audit whether an app-provided command is "safe" in all circumstances? In particular, if the app is malicious or compromised, a rational attacker would go to great lengths to make the command look as benign as possible. For example, they might run something like |
Beta Was this translation helpful? Give feedback.
-
Putting a terminal emulator and its associated shell session in a sandbox is just not a great fit for the design and functionality of a terminal. The whole point of a shell session is that you can do anything in it, including composition of small "Unix-style" tools that interact with each other and with any/all of your files; but that's the opposite of a sandbox-friendly design. There are some terminal emulators on Flathub using Flatpak as a distribution channel, like Konsole and Ptyxis, but they run only the terminal emulator GUI inside the sandbox - the shell session is outside the sandbox, in the trusted computing base, by using the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
sudo
has traditionally been used so that most tasks are handled with user privileges, but users have a structured and somewhat secure way to escalate their privileges when needed, typically by entering their password.I think we could use a similar system for sandboxes. For example, users could run their terminals in a sandbox by default, but have a structured and secure way to escape the sandbox when necessary.
The building blocks for this already exist.
systemd-run
(or its aliasrun0
) can fill a similar role to sudo. The main difference is that it does not use SetUID, and instead talks to systemd over dbus.systemd-run --user -t bash
allows to start an unsandboxed shell. However, it does not require any password or similar, so exposingorg.freedesktop.systemd1
would just break the integrity of the sandbox.Rather than changing
systemd-run --user
to require user interaction, I think it would be a better idea to hide it behind a portal that takes care of the user interaction for it.From looking at the systemd dbus interface I think this portal could look roughly like this:
Beta Was this translation helpful? Give feedback.
All reactions