this post was submitted on 29 Apr 2025
19 points (100.0% liked)
Linux Questions
1676 readers
2 users here now
Linux questions Rules (in addition of the Lemmy.zip rules)
- stay on topic
- be nice (no name calling)
- do not post long blocks of text such as logs
- do not delete your posts
- only post questions (no information posts)
Tips for giving and receiving help
- be as clear and specific
- say thank you if a solution works
- verify your solutions before posting them as facts.
Any rule violations will result in disciplinary actions
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Flatpak isn’t as strong as a sandbox as Android. But if you tweak permissions, it can be deemed good enough.
If you really wanted security, you’d want to learn SELinux, but that’s a whole rabbit hole of complexity.
To elaborate on this a little, you can use Flatseal to specify which directories a Flatpak app can have access to directly. For example, in a music player that stores the path of your music library, you'd want to use Flatseal to be sure it has direct access to that folder. This is similar to GrapheneOS's storage scopes.
Aside from that, apps can also call on a file picker that lets you choose any file/folder on your system, and flatpak then creates a virtual path to bridge to that file/folder without exposing the entire rest of the filesystem. This is nice for one-time open/save commands, but doesn't work for apps that need persistent access to a specific directory like in the music player example. This is similar to Android's file provider API.
I don't recall off the top of my head what flatpak apps have access to by default. Some subset of the home folder, I think?
By default, flatpaks have no permissions. All permissions must be manually specified in the manifest file. But if you look at the top apps on Flathub, they tend to have broad filesystem permissions, including home and host. This are pretty bad permissions because it's insanely easy to escape the sandbox with them since there are no protections against writing to files like .bashrc. Snap at least prevents apps from accessing hidden files for this reason.