Scenario
A developer reports: “My Flatpak app can read my home directory and access the network.” You need to validate the trust source (remotes), inspect current permissions on a target Flatpak app, then apply a tighter policy that is verifiable. The app must still launch so the user can continue working.
Flatpak isolation is not a guarantee of least privilege. You still need to review remotes, understand the permission model, and enforce policy using overrides when the default sandbox grants more access than required.
Objective
- Confirm Flatpak is installed and operational.
- Audit configured remotes and validate the system trust source.
- Install Flatseal to support permission review workflows.
- Inspect current application permissions using Flatpak tooling.
- Apply and verify overrides to restrict filesystem and network access.
- Validate behavior by launching the app, then reset overrides to restore defaults.
Concepts
- Trust source verification through remotes and installation scope (system versus user).
- Flatpak permissions as an explicit policy surface: network, sockets, devices, and filesystems.
-
Permission inspection via
flatpak info --show-permissions. -
Enforcing least privilege with overrides and validating enforcement with
flatpak override --show. - Operational validation: the app should launch and behavior should match the enforced policy.
Walkthrough
flatpak --version
Flatpak 1.14.6
This is a baseline check that the client exists and the workstation can run Flatpak workflows. If Flatpak is missing, you cannot proceed with permission auditing or policy enforcement.
flatpak remotes --show-details
Name Title URL Collection ID Subset Filter Priority Options
flathub Flathub https://dl.flathub.org/repo/ org.flathub - - 1 system
Remotes define the trust source for applications and runtimes. You need to know exactly where content is coming from before you evaluate permissions.
flatpak remote-list --system
Name Options
flathub system
System remotes apply consistently across users on the workstation. This matters when you need policy and install behavior to be repeatable.
flatpak search flatseal
Name Description Application ID Version Branch Remotes
Flatseal Manage Flatpak application permissions com.github.tchx84.Flatseal 2.2.0 stable flathub
Capture the application ID. Even if your enforcement is CLI-based, Flatseal is useful in support workflows when you need quick review and stakeholder visibility.
sudo flatpak install -y flathub com.github.tchx84.Flatseal
Looking for matches…
Installing…
1. [####################] org.gnome.Platform 45
2. [####################] com.github.tchx84.Flatseal 2.2.0 stable
Installation complete.
Flatseal requires the GNOME platform runtime. On first install, expect runtime pulls that are larger than the application itself.
flatpak list --app | grep -i firefox
Firefox org.mozilla.firefox 123.0.1 stable flathub system
This lab uses Firefox as the target application for permission inspection and overrides. If Firefox is not present, you cannot validate the policy changes against a known app ID.
flatpak info --show-permissions org.mozilla.firefox
[Context]
shared=network;ipc;
sockets=x11;pulseaudio;
devices=dri;
filesystems=home;xdg-download;
[Session Bus Policy]
org.freedesktop.Notifications=talk
This output is your permission baseline. You need a before/after view so you can prove what changed and confirm that enforcement is active.
Filesystem and network access are high-impact permissions. Validate the business requirement before removing access and document expected behavior changes for the user.
sudo flatpak override --nosocket=ssh-auth --nofilesystem=home --nofilesystem=xdg-download org.mozilla.firefox
This applies explicit restrictions: remove the SSH agent socket and block access to the home directory and the downloads portal. You will verify enforcement in a later step.
sudo flatpak override --unshare=network org.mozilla.firefox
Disabling network access is a strong control. The app should still launch, but browsing and external calls should fail. Treat this as a targeted policy test.
flatpak override --show org.mozilla.firefox
[Context]
unshare=network;
filesystems=!home;!xdg-download;
sockets=!ssh-auth;
This is the enforcement proof. You should see the explicit restrictions reflected in the override output.
flatpak run org.mozilla.firefox
[flatpak] Launching org.mozilla.firefox...
(GUI application started)
(Browsing fails as expected: network is disabled by override)
(Application exited)
A successful security change is not just “settings applied.” You need runtime validation. The app should start, and the expected restriction (no network) should be observable.
sudo flatpak override --reset org.mozilla.firefox
Reset is part of safe operations. You return the workstation to a known baseline after validating the policy behavior.
Common breakpoints
If Flathub is missing or configured only for a user install, you may get inconsistent behavior across accounts. Confirm remote scope and document what is approved for the environment.
Managed workstations may restrict outbound access or require proxy configuration. Confirm network reachability to the remote URL and validate that software sourcing is permitted.
If org.mozilla.firefox is not installed, you cannot run permission inspection and overrides against
it. Confirm the app list and select a known installed Flatpak app ID for testing.
Restricting filesystem or network access can break workflows. Validate the business requirement, communicate the expected change, and verify that restrictions are scoped to the minimum needed.
Cleanup checklist
This lab installs Flatseal and applies overrides to a Flatpak application. Clean up by removing Flatseal if it is not needed on the workstation and confirming overrides have been reset.
sudo flatpak override --reset org.mozilla.firefox
sudo flatpak uninstall -y com.github.tchx84.Flatseal
flatpak override --show org.mozilla.firefox
flatpak override --show returns no active restrictions for Firefox, and Flatseal is removed if it is
not part of your standard workstation baseline.
Reference
-
flatpak --version: Prints the installed Flatpak version. -
flatpak remotes --show-details: Lists configured remotes with detailed metadata.--show-details: Includes URL, collection ID, and installation scope.
-
flatpak remote-list --system: Lists remotes configured system-wide.--system: Restricts output to system installation scope.
-
flatpak search <term>: Searches remotes for matching applications. -
sudo flatpak install -y flathub com.github.tchx84.Flatseal: Installs Flatseal from Flathub non-interactively.-y: Automatically answers “yes” to prompts.flathub: Remote name used as the install source.
-
flatpak list --app | grep -i firefox: Confirms the Firefox Flatpak is installed.--app: Shows only applications (not runtimes).|: Pipes output from the left command into the right command.grep -i firefox: Filters lines matching “firefox” case-insensitively.
-
flatpak info --show-permissions org.mozilla.firefox: Shows the current permission set for a Flatpak application.--show-permissions: Prints sandbox permissions and bus policies.
-
sudo flatpak override --nosocket=ssh-auth --nofilesystem=home --nofilesystem=xdg-download org.mozilla.firefox: Applies a restrictive override for sockets and filesystem access.--nosocket=ssh-auth: Removes access to the SSH agent socket.--nofilesystem=home: Removes access to the user’s home directory.--nofilesystem=xdg-download: Removes access to the downloads directory.
-
sudo flatpak override --unshare=network org.mozilla.firefox: Disables network access for the application.--unshare=network: Removes network namespace sharing.
-
flatpak override --show org.mozilla.firefox: Displays effective overrides applied to the application.--show: Prints overrides currently in effect.
-
flatpak run org.mozilla.firefox: Launches the application by ID. -
sudo flatpak override --reset org.mozilla.firefox: Resets overrides to application defaults.--reset: Removes override rules for the application.
-
sudo flatpak uninstall -y com.github.tchx84.Flatseal: Uninstalls Flatseal non-interactively.-y: Automatically answers “yes” to prompts.