mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #698] Whitelisting /var is broken #476
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#476
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 @knoy on GitHub (Aug 11, 2016).
Original GitHub issue: https://github.com/netblue30/firejail/issues/698
Inserting the following into a profile:
Doesn't work and results in all of /var/lib and /var/log being unreadable.
Adding
--whitelist=/var/libas a command line argument makes all of /var visible
@Fred-Barclay commented on GitHub (Aug 11, 2016):
G'day knoy! What version of firejail are you using?
As far as the profile goes,
blacklistshould overridewhitelistin this case, keeping all of /var/ unreadable. What you probably want to do is thisblacklist /varnoblacklist /var/lognoblacklist /var/libThat will blacklist all of /var except for /var/lib/ and /var/log/.
This is what
--whitelist=/var/libdoes on my computer:$ ls /var/backups cache lib local lock log mail opt run spool state tmp$ firejail --whitelist=/var/lib /bin/dashReading profile /etc/firejail/default.profileReading profile /etc/firejail/disable-common.incReading profile /etc/firejail/disable-programs.incReading profile /etc/firejail/disable-passwdmgr.inc*\* Note: you can use --noprofile to disable default.profile **Parent pid 15236, child pid 15237Child process initialized$ ls /varlibHope this helps. :)
Fred
@knoy commented on GitHub (Aug 11, 2016):
I'm on debian using firejail version 0.9.40.
I've tried your 'noblacklist' approach but that doesn't work either:
If I remove the blacklist command in the profile, I can read the dirs no problem
@knoy commented on GitHub (Aug 11, 2016):
Even without blacklisting at all this is apparently broken for /var/log and /var/lib? Looks like firejail is doing some behind the scenes magic with /var .. specifically
a344c555ff/src/firejail/fs_var.c (L110)This looks like its overriding anything done. A bunch of hardcoded and undocumented paths seems a little messy way to go about this.
@Fred-Barclay commented on GitHub (Aug 11, 2016):
Can you post the profile you are using?
@netblue30 commented on GitHub (Aug 11, 2016):
Let's mark it as a bug, I'll take a look. Yes, Firejail mounts by default a new /var/log and modifies some directories in /var/lib.
@netblue30 commented on GitHub (Aug 12, 2016):
@Fred-Barclay is right:
By default firejail does a lot of filesystem cleanup before blacklisting and whitelisting. You can see all the steps if you run it with --debug:
What exactly are you trying to do?