Anyone know how to contain (sandbox) .appimage files on Linux?
I have certain game launcher (I don’t wanna disclose which) that spreads through appimage. And I don’t feel comfortable game having full r/w on my /home dir.
I’ve found it’s easiest to start by extracting the appimage file using:
./YourAppImage.AppImage --appimage-extract
then make a launch file that points to the AppRun file in the extracted AppImage. With that launch file, you can define what the appimage has access to using bwrap
Then change the exec= line in the .desktop file you use to launch the AppImage to point to the bwrap launch file, and you’re done!
Yeah it’s basically a DIY flatpak I’d be interested in finding out if there’s a more user-friendly way to do this, since managing bwrap permissions without a GUI is a pain.
I’d be happy to hear if anyone has any suggestions here, so we could potentially implement this to the site!
Do you use X11 on Mint? If you do, you need Xephyr, Xpra or similar to even lay the basis for sandboxing gui applications, otherwise X11 will be a sandbox escape.
There is also the package manager AM (aka AppMan) that allows you to easily install, update and sandbox a wide range of AppImage applications.
The sandbox utility simple-appimage-sandbox (sas), which depends on Bubblewrap, is used by AM when the “–sandbox” flag is supplied.
It should be noted that the created sandbox is somewhat permissive by default; it doesn’t unshare the network socket with the application. It’s possible to configure access to the home directory, but I haven’t found a way to fine-tune the sandbox’s other permissions. I don’t know how difficult it would be for an application to escape that sandbox, but I guess it’s better than nothing..
If you decide to use AM, please be aware that its database of app installation scripts is similiar to the design of the Arch User Repository (AUR). If an app isn’t distributed as an AppImages by its developer, then it may be provided as an unofficial, community-built AppImage.