mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #1450] firecfg incompletely installing #976
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#976
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 @Boruch-Baum on GitHub (Aug 9, 2017).
Original GitHub issue: https://github.com/netblue30/firejail/issues/1450
For firejail version 0.9.48, in debian, firecfg is not creating symlinks for all available profiles.
This proved to be very frustrating when trying to figure out why a process tree consisting of less / .lessfilter / highlight was being rejected by firejail. Once I manually created the symlink, the operation succeeded.
Just in case there might be a second issue here, the case was:
Before I wised up and noticed the lack of the symlink, the following WOULD succeed:
@netblue30 commented on GitHub (Aug 10, 2017):
You can try the version on git mainline. less command was added after 0.9.48 release.
@Boruch-Baum commented on GitHub (Aug 10, 2017):
Debian occasionally adds/removes stuff so maybe they put the less.profile in version 0.9.48, because it is there. What didn't happen was when I ran firecfg, it didn't create the symlink for very many commands that had profiles in the /etc/firejail directory, the first of which I noticed now when debugging my problem with less. Most of the missing symlinks are for programs not currenlty installed on my system.
Is firecfg supposed to create links for all profiles in the /etc/firejail directory?
If you mean that the file 'less.profile' really shouldn't be in my version (ie. debian patched it in), then should I manually write a simple one-liner script to create symlinks for everything in the directory?
@Fred-Barclay commented on GitHub (Aug 10, 2017):
I think the intention is for all profiles in /etc/firejail/ to be linked, but in reality we've had to leave a few out for various reasons. You can see which programs should always be linked in src/firecfg/firecfg.config.
@Boruch-Baum commented on GitHub (Aug 10, 2017):
Thanks @Fred-Barclay. My install only created 62 of 309 symlinks.
I must admit that the whole resort to symlinks makes me a bit uneasy, as it will break for any scenario using absolute paths (eg. legacy scripts), and it makes firejail easy to intentionally circumvent. I expect you've hashed out the pros and cons already.
Have you considered this option?: It's pretty clear that this project is going to single-handedly 'take over' the /usr/local/bin directory, which concerns me, from a 'big picture' perspective. Have you considered putting the symlinks in a dedicated directory (eg. /usr/bin/firejail, /usr/lib/firejail), and asking users (or distributions, or sysadmins) that as part of the install process they should add that dedicated directory to their $PATH ? That would keep /usr/local/bin for its original purpose and allow for firejail to operate upon real executables that a local sysadmin correctly wants to exist in that directory. I realise this suggestion is late in the game, so possibly introduce it as an option, or just mention in the documentation the notion of doing so manually (if there wouldn't be aproblem with that working).
@SkewedZeppelin commented on GitHub (Aug 10, 2017):
It'll only create symlinks for profiles that it has located in /etc/firejail and that are installed
Its not really meant to prevent a malicious user sitting at the computer, and more of reducing harm by exploits/malware.
That could probably be easily added as an option in firejail.config, eg. "firecfg-use-dedicated-dir", and then just have firecfg add a warning if it doesn't detect it in $PATH
@Boruch-Baum commented on GitHub (Aug 10, 2017):
In practice, at this point, I'm tremendously gratified that firejail is easy to circumvent, as I've been going through more install pain. Here's a continuation:
As I mentioned in my opening comment, I have 'less' call a shell script called ~/.lessfilter, which decides how to colorize less output. For many files, it uses GNU highlight, and for log files, it uses ccze. When I open a root terminal to examine my syslog, I'm now getting the message:
What seems to be happening is that the whitelists work for commands early in the script .lessfilter (eg. readlink, dirname), but not for a call to ccze (my line 32), in the form "ccze -A <"$1" , where $1 would be /var/log/syslog.
Note that if I try:
without both whitelists, the script fails earlier, when trying to run dirname
What is going on? Do I need a separate profile for ccze? If so, why not for readlink and dirname? Why when explicitly calling less.profile does it behave differently than when called by default? Does the redirection in the script mess things up?
For colorizing log files, this is a tremendous waste of time, but for figuring out what's going on in firejail not so much.
@reinerh commented on GitHub (Aug 10, 2017):
That's not an issue with your script.
By default firejail only mounts a minimal /var/log into the sandbox.
See:
If you need this, you can add
writable-var-logto your local less profile.@Boruch-Baum commented on GitHub (Aug 10, 2017):
Thanks, @reinerh! What a relief!
However, this raises another question? This is the kind of setting that should be default for any user with admin privileges probably for many command profiles, so how are such people (sysadmins, root account) expected to use firejail? Must they / we manually copy and customize all profiles to /root/.config/firejail ?
@reinerh commented on GitHub (Aug 10, 2017):
If you intend to use less on for example /var/log/syslog and don't do it that often, you could use the command line flag.
If you use it more often you could put it into /etc/firejail/less.local (which is loaded in the /etc/firejail/less.profile profile).
If you use it even more with also other tools, you can put it into /etc/firejail/globals.local, which is loaded by all profiles.
@Boruch-Baum commented on GitHub (Aug 10, 2017):
@reinerh, your solution worked like a charm.
So in a multi-user environment that would mean, for example,
creating a file /root/.config/firejail/globals.local?
I imagine as firejail becomes more popular, this type of dual-use issue will arise often and consistently, because even a single-user device that maintains a distinction between a normal and a privileged state (eg sudo), will need some special ruleset for the privileged account(s).
@reinerh commented on GitHub (Aug 10, 2017):
$HOME/.config/firejail/globals.local would not work, because this file is nowhere included.
What you could do (but would be a bit more effort) is creating user-local profiles that load the normal profile and a user-local global overwrite, like this (/root/.config/firejail/less.profile):
Then you can put your user-specific global overwrites to this globals.local file.
@Boruch-Baum commented on GitHub (Aug 10, 2017):
Thanks. At this point, for me personally, the issue could be closed as solved, but it would be considerate for other users maybe to keep it open for a conversation / decision about whether / what something should be done in the package to address this for others. The people deciding to install / deploy firejail are going to be sysadmins themselves (at least in some sense of the word), and the current situation will give them a frustrating first impression that may cause them to just ditch the idea of using firejail if its a hassle for them.
@netblue30 commented on GitHub (Aug 10, 2017):
I put a fix in git. It turns out we already have a --writable-var-log command line option and profile command to disable the sandboxing of /var/log. Also, let's not add private-bin to the profile, ~/.lessfilter seems to be quite popular with power users.
In the next version we'll add another way to handle desktop integration based on a LD_PRELOAD library, so you wouldn't have to mess with /usr/local/bin.
@rusty-snake commented on GitHub (Jan 25, 2020):
Is there anything left to do here?