mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #2097] firecfg: allow for ignoring specific apps #1419
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#1419
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 @Vincent43 on GitHub (Aug 27, 2018).
Original GitHub issue: https://github.com/netblue30/firejail/issues/2097
Currently firecfg unconditionally creates symlinks for all apps it detects. This is problematic if user doesn't want to use specific app with firejail.
I propose allowing users to prevent creating symlinks for chosen apps:
firecfg --ignore <app_name>. The database of ignored apps could be saved same way as database of allowed users is currently.This was discussed before: https://github.com/netblue30/firejail/issues/1675
@chiraag-nataraj commented on GitHub (Aug 27, 2018):
How about, instead, have an
-a/--allflag which would replicate the behaviour seen here and otherwise, only link the apps listed on the command-line?@chiraag-nataraj commented on GitHub (Aug 27, 2018):
This way, you could also use
--cleanto clean up only specific links or--clean --allto clean all links.@Vincent43 commented on GitHub (Aug 27, 2018):
Ability to symlink only chosen apps would be useful too but it's something different. Usecase which I have in mind is ignoring one,two or three apps among dozens which is rather hard to type in cmdline in whitelist mode so I prefer blacklisting.
EDIT: just checked that I have over 60 firejail symlinks created with firecfg. Providing all of them in cmdline in order to exempt a few of them isn't reasonable for me.
@chiraag-nataraj commented on GitHub (Aug 27, 2018):
So maybe have files like
firecfg.allowandfirecfg.deny(names up for debate)? That way, if you only want to allow specific programs, editfirecfg.allow. If you only want to deny specific programs, editfirecfg.deny. If neither of those exists, we get the existing behavior.@Vincent43 commented on GitHub (Aug 27, 2018):
That sounds good!
@hlein commented on GitHub (Nov 21, 2020):
I propose moving
firecfg.configunder/etc/-/etc/firejail/firecfg.config, or whatever.More advanced features like a
.local,.deny,.allow, or whatever, are all well and good to keep discussing, but in the meantime I would argue simply: these amount to configuration files, they should go in a path that a) system administrators expect to find configs in and b) distribution packaging tools expect to store configs in, and therefore won't silently overwrite local customizations during version upgrades.There's multiple issues regarding this - #408 which refers to #2829 which was closed with a comment pointing here.
If I make a PR that relocates
firecfg.configfromLIBDIR/firejail/toSYSCONFDIR/firejail/, is it likely to be accepted?Thanks!
@rusty-snake commented on GitHub (Nov 21, 2020):
I am strongly in favour of using /etc instead of /usr/lib64 for this and I don't think anyone is against it.
@hlein commented on GitHub (Nov 24, 2020):
Sweet, thanks! I will work on this as soon as I get a chance.
@rusty-snake commented on GitHub (May 24, 2021):
Interesting workaround: https://github.com/kugland/nojail
@rieje commented on GitHub (Oct 2, 2021):
Couldn't you just symlink it to the actual binary you want, i.e.
/usr/bin/<app>? But I agree, an option to ignore apps so no needless symlinks are needed is ideal.@rusty-snake commented on GitHub (Nov 14, 2021):
firecfg.config is now located in
/etc/firejailwhich make overwriting by users easier.I wanted to add a note in RELNOTES about that but that got me wondering what recommendation we should give distributors
We could solve all this if we do a second relocate and implement a override mechanism.
Proposal:
LIBDIR/firecfg.configback@hlein commented on GitHub (Nov 14, 2021):
I maintain the Gentoo package of firejail, and we have a very nice mechanism for handling changes to config files:
etc-update. It knows which files being deployed/updated count as "config files", and gives a nice menu/diff/editor-based way to merge/arbitrate changes. I believe many other distros have similar mechanisms although maybe they are package-specific.My next update to the Gentoo package was going to deploy some distro-specific changes to
firecfg.config(things I know don't work well on Gentoo for whatever reason, but aren't worth disabling across the board for all firejail installs IMO). Users can also make their own local edits tofirecfg.config, and etc-update will prevent stomping on their changes across upgrades.So, I hope this won't be chosen:
but this would be great:
I was going to suggest -, but ! also makes sense.
@rusty-snake commented on GitHub (Nov 14, 2021):
The two points are linked with a logical "and" so both would be done in one PR.
Great, somebody more I know to ping for packaging issues.
Fedora: If a file is marked as
%config, it will be saved asFILENAME.rpmsaveif it has user modifications. If it is marked as%config(noreplace), it is installed asFILENAME.rpmnew. There isrpmconfandpython3-dnf-plugin-rpmconfwhich provide such install/keep/diff/... features but they are not installed by default nor do the have an effect if you update your system via gnome-software (what I not recommend to do).@hlein commented on GitHub (Nov 14, 2021):
But... do they need to be? If we will have a
firecfg.config.localfor site-local changes (and there's symmetry there for profile.localfiles), why not letfirecfg.configlive under/etc/? We don't put profiles underLIBDIR, after all.Sure :)
That sounds sort of painful, but at least it is a thing. I mean really, software deploying default config files that users/admins can modify, and then it's the distro's problem to decide what to do upon upgrading the package, is a normal thing.
@kmk3 commented on GitHub (Nov 15, 2021):
@hlein commented on Nov 15:
Considering that firecfg.config is basically just a giant list of programs
(rather than having many individual options like in firejail.config), I also
think that having a separate file for admin modifications would be better, as
it seems that conflicts would happen much more often and that the diff would be
harder to read (compared to that of firejail.config).
Agreed.
On Arch, if you tried to install a package that would conflict with a modified
/etc/firejail/firecfg.config, pacman would just save the new version as
/etc/firejail/firecfg.config.pacnew, print a warning and then finish installing
normally. After the install, these files could be compared and merged by
running
pacdiff(which would open them invimdiffby default), if/when youfelt like doing so. Details:
IIRC, on Debian apt asks interactively in an ncurses-based UI what to do if a
configuration conflict happens (personally, I'd much rather not have upgrades
interrupted by default just because of that, but I suppose that it could be
useful in places where any breakage at all would be a big problem).
So considering that configuration files like /etc/firejail/firejail.config have
been around for a long time without having .local versions and that at least
apt, emerge, pacman and rpm apparently support conflict resolution in /etc in
seemingly good enough ways, to me it seems that this is a pretty standard
feature of package managers.
@WhyNotHugo commented on GitHub (Jul 8, 2022):
How about
/etc/firejail/firecfg.d/which can include many files, processed in-order.So a default
10-default.configcan include the current defaults, but one can include overrides such as20-no-mpv.configwith!mpv?The biggest problem with having to mutate a package-provided file for configuration, is that it does not allow for a second package to ship a configuration file. I can currently have a package which ships a variety of configurations by dropping in files in
/etc/modprobe.d/,usr/lib/tmpfiles.d/, etc. However, it can't provide a file that's already installed by another package.Sure, scripts could mutate the package-provided
/etc/firejail/firecfg.config, but that requires making sure it's kept aligned with new versions after each update somehow. In the end, the idea of "mutable package-provided files" is always tricky. Being able to use drop-in files would solve this (which is what happens with the*.localfiles now for profiles.@rusty-snake commented on GitHub (Jul 8, 2022):
That's what firecfg.py does for 1,5 or 2 years now and it works great.
https://github.com/rusty-snake/firecfg.py/tree/master/firecfgpy/groups
It also solves the privileged-programs/chrom*/file-archivers can not be sandboxed on some systems issue by making own files for the which can be enabled/disable.
@kmk3 commented on GitHub (Jul 1, 2023):
PR created:
Feel free to test and review.