mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #3991] private-etc doesn't allow subdirs #2495
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#2495
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 @g-v-egidy on GitHub (Feb 15, 2021).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3991
Bug and expected behavior
I want to allow a program access to the directory /etc/pki/ca-trust/ and below, but not to /etc/pki/tls/private.
As the private keys are really sensitvie, I want not just rely on blacklisting, but remove the private keys fully from the mount with the private-etc option.
When I try to use this in a profile file:
I get the error:
The manpage suggests that copying subdirs of /etc is allowed as the example given there:
uses default/motd-news.
Environment
@smitsohu commented on GitHub (Feb 15, 2021):
A simple workaround for now would be to switch from
private-etctowhitelist. It is about as secure as long as you don't add awritable-etcoption.@smitsohu commented on GitHub (Feb 15, 2021):
Alternatively you can also layer
noblacklist/blackliston top of the private-etc:@g-v-egidy commented on GitHub (Feb 15, 2021):
Thanks for your quick reply.
I'm already using the blacklist solution for now. But it would be nice if private-etc could be improved to also allow the subdirs, because I think this is more secure.
@brisad commented on GitHub (Mar 11, 2021):
Hi! I recently found Firejail, and thought I'd start to help out a little. So I just took a look a this problem and wanted to see if I could fix it.
I am guessing here that the expected behavior would be that
would yield
/etc/pki/ca-trust.private-libon the other hand, which does support sub-directories, mapsto
/lib/c(not/lib/a/b/c). That is, it copies the target path to the top level/libdir.For consistency within Firejail, I would assume it should follow the
private-libimplementation. But perhaps that won't solve @g-v-egidy 's problem. What is the right approach here?@g-v-egidy commented on GitHub (Mar 11, 2021):
For libs the exact path usually doesn't matter as long as it is within the configured ld.so.conf.
For /etc the exact path really matters and just copying files without preserving their path is useless.
So I think private-etc should work differently than private-lib in this regard.
@brisad commented on GitHub (Mar 11, 2021):
Didn't think about that, but now that you say it, it's very true. Thanks :)
@rusty-snake commented on GitHub (Mar 11, 2021):
#4045
@brisad commented on GitHub (Apr 25, 2021):
Sorry for disappearing right after offering to help. It's been busy times. But I finally took a shot at this and attached a PR.