mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #3601] Improving symlink invocation? #2257
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#2257
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 @curiosityseeker on GitHub (Aug 25, 2020).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3601
Symlink invocation was introduced in Firejail 0.9.38, and since then it has been automated by executing
sudo firecfgto make sure that all applications with a Firejail profile will start sandboxed.While this works well in most cases we all know that there are, at least, two problems with this approach:
/usr/local/binisn't set before/usr/binin the $PATH. This happens rarely - but I have seen such distros in the past. While this can be easily adjusted, the user has to aware of this problem and know how to do it.So how can we improve that situation? One idea that came to my mind is the following: Change the behavior of firecfg such that it
usr/bin/firefoxto/usr/bin/firefox-fj,/usr/bin, e.g.,/usr/bin/firefox, pointing to/usr/bin/firejail(needless to say that the symlinks in/usr/local/binare consequently no longer needed)/usr/bin/firefox-fjchown root:firejail /usr/bin/*-fjandchmod 4750 /usr/bin/*-fjas explained here.This would make sure that the respective applications will always be sandboxed regardless if they are executed with their full path or not.
An obvious problem is that the symlinks created in
/usr/binwould be overwritten with every update of the respective applications. A possible solution is that we create hooks for the various package managers similarly like the one mentioned here.What do you think? Does this make sense? Or is it a crazy or too complicate idea? Did I miss other problems?
@rusty-snake commented on GitHub (Aug 25, 2020):
Manipulating binaries in /usr/bin which are "owned" by a package-manager is IMHO a bad idea. It will likely make more trouble then good.
It may be possible to use /etc/fstab to bind-mount a helper script over /usr/bin/foo and bind-mount /usr/bin/foo under /bar/firejail/baz/foo. However, package-managers can then no longer make updates (except if we provide a undo-script/boot-entry).
Forcing programs in a sandbox belongs IMO in the kernel-space and isn't a task for the user-space. Use AppArmor or SELinux if you want to force a program in a sandbox.
Regarding point 1: We could warn the user. Sadly sudo changes $PATH.
@FOSSONLY commented on GitHub (Aug 26, 2020):
Regarding point 1:
The problem with the PATH variable, from a realistic point of view, only affects exotic or largely insignificant linux distributions. And considering that the big and most important linux distributions are completely unproblematic in this respect, it is difficult to see a real problem here. Is it really necessary to support every workflow, no matter how exotic and not standard-compliant?
Regarding point 2:
From my point of view, firejail could be used as a restricted shell. This way, the login shell would always be isolated, but could in principle start nothing else but isolated programs (even with absolute paths). And the default profile could be further customized via the configuration.
@curiosityseeker commented on GitHub (Aug 26, 2020):
Okay, it was a bad idea. Closing.