mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #3874] What's are currently the best ways to configure apps to run sandboxed with firejail? (Modified .desktop files can change after updates) #2436
Labels
No labels
LTS merge
LTS merge
bug
bug
converted-to-discussion
doc-todo
documentation
duplicate
enhancement
file-transfer
firecfg
firejail-in-firejail
firetools
graphics
help wanted
information_old
installation
invalid
modif
moved
needinfo
networking
notabug
notourbug
old-version
overlayfs
packaging
profile-request
pull-request
question
question_old
removal
runtime-permissions
sandbox-ipc
security
stale
wiki
wiki
wontfix
wordpress
workaround
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/firejail#2436
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mYnDstrEAm on GitHub (Jan 6, 2021).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3874
I used to modify applications' start commands by changing .desktop files in /usr/share/applications or sometimes copying it there for a separate version that uses firejail in Debian/KDE. This can also be done by right clicking application icons->Application->changing the Command. I'm sure many users configure apps to use firejail in like this or in similar ways - for example it's also recommended in the InstallGentooWiki
The problem with that is that after package updates the Commands can be overwritten - so theoretically one would need to check every package's .desktop entry in that folder for a change to Exec in the .desktop file after it's been updated if it's firejailed.
What would be more reliable ways to configure apps to always be sandboxed with firejail?
I don't want to run firecfg to sandbox all applications with firejail.
Would moving all .desktop files from /usr/share/applications/ to ~/.local/share/applications and modifying the commands there be a good way? Edit: a complication with this would be that software could still call the binaries in /usr/bin directly (for example
web-ext runtries opening a new firefox instance.) Edit 2: related discussion at #3191@chiraag-nataraj commented on GitHub (Jan 6, 2021):
You can run
sudo ln -s /usr/bin/<x> /usr/local/bin/firejailto ensure that the program is always started with firejail (it's basically the manual version offirecfgand you can select the programs that are sandboxed by default).@kris7t commented on GitHub (Jan 7, 2021):
@chiraag-nataraj Be on the lookout that some .desktop files refer to the binary with its full path, i.e., merely linking the binary in
/usr/local/binwon't to the trick. However, If you also copy the .desktop file from/usr/share/applicationsto/usr/local/share/applicationsor$HOME/.local/share/applicationsand modify it appropriately (to invoke the symlinked binary from/usr/local/bin), then the application will run sandboxed both when started from the command line and when started from the application launcher.@chiraag-nataraj commented on GitHub (Jan 7, 2021):
@kris7t You're right. My setup is so drastically divorced from more 'mainstream' setups that I completely forgot that some
.desktopfiles refer to the full path 😜 I mostly run things from the$PATH, so everything's generally quite consistent as long as everything sees the same$PATHvariable 😂@rusty-snake commented on GitHub (Jan 7, 2021):
Options for a selective firecfg: https://github.com/netblue30/firejail/issues/3665#issuecomment-707689049
@rusty-snake commented on GitHub (Jan 8, 2021):
Forgot https://github.com/rahiel/firectl.
@rusty-snake commented on GitHub (Apr 6, 2021):
I'm closing here due to inactivity, please fell free to request to reopen if you have more questions.