Skip to content

feat: Sandbox flatpak-system-update.service#1940

Draft
Exponent64 wants to merge 18 commits intosecureblue:livefrom
Exponent64:systemd-services-sandboxing
Draft

feat: Sandbox flatpak-system-update.service#1940
Exponent64 wants to merge 18 commits intosecureblue:livefrom
Exponent64:systemd-services-sandboxing

Conversation

@Exponent64
Copy link
Copy Markdown
Contributor

This PR attempts to make some progress on the issue #114. It reduces the level of exposure of the flatpak-system-update service from 9.6 to 1.4. Unfortunately, the ExecCondition of the service makes having access to /run/dbus a requirement, and therefore, it is still trivial to escape the sandbox.

@Exponent64 Exponent64 changed the title Sandbox flatpak-system-update.service feat: Sandbox flatpak-system-update.service Feb 14, 2026
@Exponent64 Exponent64 requested a review from HastD February 14, 2026 04:07
Comment thread files/system/desktop/usr/lib/systemd/system/flatpak-system-update.service Outdated
@Exponent64 Exponent64 requested a review from HastD February 14, 2026 16:24
Copy link
Copy Markdown
Collaborator

@HastD HastD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this. At this point, it looks good to me in the abstract, but I haven't tested it yet to make sure it actually works and doesn't block intended functionality. What testing have you done with this so far?

@Exponent64
Copy link
Copy Markdown
Contributor Author

Thanks for working on this. At this point, it looks good to me in the abstract, but I haven't tested it yet to make sure it actually works and doesn't block intended functionality. What testing have you done with this so far?

So far, I have tested the sandboxed service on a kinoite-main-hardened image, always using the latest image available, in a vm under the qemu user session, and it has worked exactly the same as if it were unsandboxed. It succeeds when running systemctl start flatpak-system-update.service, and neither systemctl status flatpak-system-update.service nor journalctl -u flatpak-system-update.service (as root) show any error logs

@Exponent64
Copy link
Copy Markdown
Contributor Author

Something I have to mention, though, is that when a system remote is present in the system, the service will fail when trying to run flatpak --system repair. This happens whether the service is sandboxed or not, so it isn't the sandbox's fault. This issue will most likely need to be addressed in a separate issue. (I can confirm that removing flatpak --system repair from the service fixes it.)

@HastD
Copy link
Copy Markdown
Collaborator

HastD commented Feb 21, 2026

Just to clearly state the sort of testing I'd like to see for this: I'd want this to be tested on a system with a variety of flatpaks installed in a system installation, including some flatpaks like Steam that have more complex install hooks. The testing should also cover the case when updates are actually installed, not just checking for updates and not finding any. The failure mode here would be flatpaks (likely silently) failing to update, which is something we definitely want to avoid, so this needs thorough testing.

@Exponent64 Exponent64 marked this pull request as draft March 6, 2026 16:16
@mathbreed
Copy link
Copy Markdown
Contributor

@HastD Would it help if we add a line like OnFailure=<run script that pushes a desktop notification> to all the auto update services? This way users will be notified when auto update fails. I'm envisioning something like the security-related update notification we run on every auto update.

@codacy-production
Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

TIP This summary will be updated as you push new changes. Give us feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants