Skip to content

Conversation

@HastD
Copy link
Collaborator

@HastD HastD commented Sep 15, 2025

Currently flatpak is not compatible with SELinux confined users: the flatpak executable does not have the necessary permissions to create the sandbox. This policy solves this by confining the flatpak program itself (and the helper programs it calls, such as bwrap) in an application domain with the necessary permissions, which transitions back into the user domain to run the sandboxed flatpak application.

For example, if a staff_u user runs a flatpak application from the user domain staff_t, flatpak will run in staff_flatpak_t, while the app will run in staff_t.

The policy also includes more fine-grained labeling for flatpak app library files, data files, cache files, and temporary files.

A couple logistical notes:

  • The policy module is named "flatpak-sandbox" rather than just "flatpak" because flatpak itself ships with a policy module called "flatpak", which is used to grant a few extra permissions to flatpak-system-helper, and we don't want to accidentally override that policy.
  • This PR does not include Trivalent-Flatpak integration; I figure that should be part of the Trivalent policy, which in any case will need to be revised to work with confined users.

HastD added 4 commits October 31, 2025 20:10
Currently flatpak is not compatible with SELinux confined users: the
flatpak executable does not have the necessary permissions to create the
sandbox. This policy solves this by confining the flatpak program itself
(and the helper programs it calls, such as bwrap) in an application
domain with the necessary permissions, which transitions back into the
user domain to run the sandboxed flatpak application.

For example, if a `staff_u` user runs a flatpak application from the
user domain `staff_t`, flatpak will run in `staff_flatpak_t`, while
the app will run in `staff_t`.

The policy also includes more fine-grained labeling for flatpak app
library files, data files, cache files, and temporary files.

Signed-off-by: Daniel Hast <hast.daniel@protonmail.com>
Fixes denials that newly show up with this policy in Fedora 43.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant