mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #397] Make all programs start with firejail automatically #288
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#288
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 @ghost on GitHub (Mar 31, 2016).
Original GitHub issue: https://github.com/netblue30/firejail/issues/397
Is there a way to tell firejail to start all userspace programs with it automatically? If not can it be added?
@netblue30 commented on GitHub (Apr 1, 2016):
It is kind of difficult, it would require same sort of kernel support. So far we can only start firejail automatically if the application is started from a .desktop file. Such is the case with desktop manager menus and icons, or from command line. The relevant information is this:
@HulaHoopWhonix commented on GitHub (Apr 8, 2016):
What if something like incron is used to monitor the filesystem and execute the firejail command upon detecting the start-up of a program file which has a confinement profile? The original access would be terminated by closing the file and instead the firejail command is executed in its place.
http://www.cyberciti.biz/faq/linux-inotify-examples-to-replicate-directories/
Available in Debian:
https://packages.debian.org/stretch/incron
EDIT:
Additionally there could be a global setting that forces any other programs without profiles to run under the generic one which is a step up in protection even if its not as secure as a tailored profile.
END OF EDIT
If the above idea doesn't work, the way Oz is doing this is:
https://github.com/subgraph/oz
@netblue30 commented on GitHub (Apr 9, 2016):
inotify: the problem is by the time you get the notification, the kernel already started the program. The events you receive from the kernel are asynchronous.
For Oz people is easy, they are a distribution and they can control what gets installed on the user system. On a regular disro, once you update a program like Firefox, the update will replace the link with whatever is in the new package.
@HulaHoopWhonix commented on GitHub (Apr 10, 2016):
Orthogonal to the first idea is to use some form of hooking https://en.wikipedia.org/wiki/Hooking#Linux to control the execution of other processes. ptrace might not work on Grsec kernels however.
You can use Dpkg hooks (DPkg::Post-Invoke) to ensure symlinks are maintained even across software updates.
@netblue30 commented on GitHub (Apr 10, 2016):
Ptrace syscall is disabled by seccomp.
Dpkg hooks will give firejail too much control over the user desktop, I think we should stay away. The user still can implement it, but for us to change how the package manager works would be very intrusive.
@FedericoCeratto commented on GitHub (Apr 10, 2016):
dpkg-divert and update-alternatives, used together, can do the trick - but for one application at a time:
@HulaHoopWhonix commented on GitHub (Apr 10, 2016):
Not really. GRsec's paxctl uses a similar technique for re-applying PaX flags to updated binaries. You can make this behavior optional on Firejail's first start by asking the user if they want to enable it.
Automatically starting programs under protection is the single biggest usability feature IMO. A regular user should not have to use the command line or even know what a symlink is to benefit from Firejail. Making this opt-in sets the right balance.
Lets say a user wants to easily reverse this for some specific program. Firetools should immediately delete the symlink for any application whose icon is dragged outside its widget.
@requiredregistration commented on GitHub (Apr 11, 2016):
an ignorant and careless user will never be safe for long.
ease of use is something good, but making it easier to use must never lower security.
@adrelanos commented on GitHub (Apr 19, 2016):
Which is problematic, since lots of users occasionally also start applications from the command line.
So perhaps implemented in a separate optional package?
Are the kernel developers already aware of the need for this feature? Is there a feature request already? Is this something you could implement into the kernel?
@ghost commented on GitHub (Apr 19, 2016):
@netblue30 Please reopen the issue
@netblue30 commented on GitHub (Apr 20, 2016):
Reopened!
@HulaHoopWhonix commented on GitHub (May 10, 2016):
@netblue30 why didn't you mention firecfg? It does what I was looking for and the symlinks survive package upgrades :)
One thing I ran into was firecfg didn't create symlinks for Iceweasel although its installed and has a supported profile.
The link is created for firefox (which is rebranded on Debian to Iceweasel) but all the links on the system point to the name of the latter.
$ sudo firecfg --list
/usr/local/bin/icedove
/usr/local/bin/vlc
/usr/local/bin/xchat
/usr/local/bin/firefox
@HulaHoopWhonix commented on GitHub (May 10, 2016):
Turns out the problem is caused because the Iceweasel profile redirects to the Firefox one for confinement rules. To fix this a full custom rule-set is needed for Iceweasel because its directory names are different.
@netblue30 commented on GitHub (May 11, 2016):
The version in github repository decouples firefox and iceweasel profiles. Each one has its own file in /etc/firejail directory. I have a new release coming in about one week - hopefully!
This is what you can do if you are on 0.9.38:
Create a ~/.config/firejail directory
Copy firefox.profile there as iceweasel.profile
Open ~/.config/firejail/iceweasel.profile in a text editor and modify it.
@HulaHoopWhonix commented on GitHub (May 11, 2016):
Thank you. Sounds good. Feel free to close this ticket as the original topic has been covered.
EDIT:
I noticed a typo in the manpage where --clear is mentioned though it has been deprecated in favor of --clean.
https://firejail.wordpress.com/features-3/man-firecfg/
@netblue30 commented on GitHub (May 12, 2016):
clear/clean is fixed in git.
@hfont commented on GitHub (Feb 24, 2019):
Would it be possible to do this in the shell?
I was looking at this code here:
https://unix.stackexchange.com/questions/250713/modify-all-bash-commands-through-a-program-before-executing-them