mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #4871] Install provided profiles under LIBDIR/firejail-profiles #2798
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#2798
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 @rusty-snake on GitHub (Jan 20, 2022).
Original GitHub issue: https://github.com/netblue30/firejail/issues/4871
Is your feature request related to a problem? Please describe.
--debugdoes not indicated this.Describe the solution you'd like
/usr/lib/firejail-profiles(or to whatever --libdir is configured)./etc/firejail(-profiles). i.e. you can create/etc/firejail(-profiles)/firefox.profileat it will not be overwritten.~/.config/firejail(nothing changed)Describe alternatives you've considered
/usr/share(i.e.--datadir) but I think/usr/libis better for provided configurations.Additional context
@reinerh commented on GitHub (Jan 20, 2022):
I think
/usr/shareis actually the better place, as this is the place for platform-independent files, while/usr/libshould contain platform-specific files (afaik).@rusty-snake commented on GitHub (Jan 20, 2022):
systemd* and NetworkManager use
/usr/lib, pipewire uses/usr/share, ... looks like there is no perfect location.@reinerh commented on GitHub (Jan 20, 2022):
According to FHS:
https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s11.html
https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s06.html
@topimiettinen commented on GitHub (Jan 20, 2022):
FHS is getting outdated. Still, profiles probably shouldn't be shared across different architectures, even though they are text files. For example, system calls lists for seccomp may be different and white/blacklisting could refer to architecture dependent paths.
@kmk3 commented on GitHub (Jan 22, 2022):
@rusty-snake commented on Jan 20:
While overriding the upstream profiles with non-packaged files system-wide
could perhaps be a "cleaner" way to configure things, as a user I think it's
fine to just replace an upstream profile with the intended version (either by
manually editing the file or with automation). One benefit of the latter
approach is that the package manager notifies of any changes to the upstream
profile (and another is that this is the usual workflow for system
configuration for most packages AFAIK). Related comment:
https://github.com/netblue30/firejail/issues/2097#issuecomment-968553372
If by "normally should not modify" you mean that .local files are the preferred
form of modification, this could also be made clearer with better
documentation.
Also, user story:
The first thing I do when debugging profiles is to edit/comment things in
/etc/firejail. This usually means editing .profile files; sometimes I only
bother creating a .local file when I'm confident that my changes work (and if
they don't, I just undo them), to avoid unnecessarily creating files in
/etc/firejail.
Additionally, even if not editing the .profile file, currently I can simply do
this to open both the .profile and .local files:
To create a .local file:
To see only the local overrides:
This is the most important part to me, as having the profiles split across
multiple base dirs would make these workflows more cumbersome.
While I agree that a user failing to provide important details on an issue is
annoying, it is still their responsibility to provide enough information to
make a report reproducible.
Maybe this could be mitigated by making it part of the issue template
checklist. Example:
Also, while I agree that users are less likely to modify files in /usr, putting
files in there does not prevent them from doing so. If a package puts its
config files in /usr/(lib|share)/$package, one might just end up using that dir
as if it were /etc/$package anyway if it's more convenient.
I think that this would make profiles less discoverable. Whatever is in /etc,
I know that it is intended to be both readable and editable. So if I have a
problem with a program, usually I can just use the result of
pacman -Qlq $program | grep /etcto find out what knobs I can turn.I don't really expect to ever open anything on /usr/lib unless I want to debug
a binary or something. As far as I know, it usually contains just binaries and
"implementation details".
/usr/share might contain documentation, but again, it's rare that I'll ever
open something from it directly, especially when needing to configure a
program.
I think having to deal with 2 different base directories for system
configuration would make things more confusing; I really like the simplicity of
how it currently works.
@kmk3 commented on GitHub (Jan 22, 2022):
@topimiettinen commented on Jan 20:
If they are not to be shared by all architectures, then how would they be
divided? Would there be profiles that are architecture-specific overrides
(e.g.: amd64/firefox.profile or firefox.amd64.profile)? That does not sound
fun to maintain.
Do you mean in the arguments to
seccomp?If
seccompis breaking profiles on certain architectures, maybe we could adda seccomp subcommand for every supported architecture. Example:
(Or whatever names are used for each arch in the kernel)
And if
seccomp.block-secondaryis used, the commands for the non-native archscould be no-ops.
Well, there are already references to e.g.: /usr/lib64, which may not exist for
all architectures and may not exist on all distros. I think that this could be
helped by adding more macros, such as e.g.:
${LIB}.@topimiettinen commented on GitHub (Jan 22, 2022):
Most of the system calls are common to all architectures, so in practice there shouldn't be a problem. System call lists also help. Using raw system call numbers (
$1234) wouldn't be portable, but I don't think the profiles use them.That could work, or if the architecture specific system calls don't overlap, they could be ignored on other architectures.
Yes.
Yes, but there could be blacklists blocking some of
/usr/lib/x86_64-linux-gnu/,/usr/lib/i386-linux-gnu/and/usr/lib/x32-linux-gnu/depending on the architecture.@kmk3 commented on GitHub (Jan 24, 2022):
@topimiettinen commented on Jan 22:
Yes; maybe this could be done automatically when handling
seccomp.block-secondary. Example:@topimiettinen commented on GitHub (Jan 24, 2022):
Good idea, though I'd make it a separate option. This wouldn't help if the profile files refer to the architecture dependent paths, for example
blacklist /usr/lib/x86_64-linux-gnu/gtk-3.0. Maybe the paths could be managed with something more generic like${NATIVE_ARCH}(e.g. x86_64) and${NON_NATIVE_ARCHS}(e.g. i386, arm etc.), maybe also${SECONDARY_ARCHS}(i386, x32) for use in paths. So instead of hardcoding this to Firejail, common profile files could useblacklist /usr/lib/${NON_NATIVE_ARCHS}-*.@kmk3 commented on GitHub (Jan 25, 2022):
@topimiettinen commented on Jan 24:
(Continued on #4879)
@rusty-snake commented on GitHub (Jan 31, 2022):
rpmlint says
text files can be arch specific too ...
Does lintian something like this?
@reinerh commented on GitHub (Jan 31, 2022):
Lintian does not complain about "only non-binary" files in /usr/lib. I tested by installing the profiles in the firejail-profiles package into /usr/lib/firejail instead of /etc/firejail.
(It has a warning for the other "direction": arch-dependent-file-in-usr-share; and it also currently complains about executables in /usr/lib (instead of libexec): executable-in-usr-lib)
@ghost commented on GitHub (Feb 10, 2022):
I think intuitively people expect to find configuration files in etc. A better alternative would be to create new folders in /etc/firejail . Some applications are annoyingly hiding some configuration files in var, so that you can't find them.
for example something like this:
/etc/firejail/profiles
/etc/firejail/includes
/etc/firejail/local (higher priority then profiles and includes, lower then .config/firejail)
@reinerh commented on GitHub (Mar 1, 2022):
Just as another example, the recommended path for dbus policy files has recently moved in Debian from
/etc/dbus-1/system.dto/usr/share/dbus-1/system.d(see also #1006631).@gioele commented on GitHub (Jan 7, 2024):
Any update on this?
For the record,
firejail-profilesis at the moment the Debian package with the second highest number of files installed under/etc(1207).@rusty-snake commented on GitHub (Jan 7, 2024):
OT: Out of interest who is the winner?
@gioele commented on GitHub (Jan 7, 2024):
libopenzwave1.6with 1489 files (of which 635 PNG images...)