mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #374] Losing internet access on blacklist /var #266
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#266
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 @msva on GitHub (Mar 22, 2016).
Original GitHub issue: https://github.com/netblue30/firejail/issues/374
Hi!
I'm not sure if it is really issue, but since it is no place to just talk about firejail (like irc channel or xmpp muc), I'd ask here.
So, in previous versions of firejail I've profile, containing
blacklist /varworking fine, but with latest git master it leads to no internet access in jailed application.I've reproduced it with both
$ firejail --private --blacklist=/var firefoxand$ firejail --private --whitelist=/var/cache.I guess, it needs
/var/run/firejailthere (isn't it?), but unfortunately, it is not possible to justwhitelist /var/run/firejail(it says 'wrong path', because/var/runis a symlink to/runon my system (distro FHS policy), and you're checking path to be local in fs_whitelist.c).And
noblacklist /var/run/firejail+blacklist /varseems to doesn't help in that situation too.So, how is that possible to be in this situation?
And one thing more: not sure if should create separate issue, or can be discussed here:
in git master (not sure starting from which commit) ping/ping6 stopped to work and saying
operation not permitted(while both of them do have suid-bit on 65534 user (under which pid 1 (firejail) is running). Reproduceable even in clean$ firejail --private.@msva commented on GitHub (Mar 22, 2016):
Actually, talking about main question in the issue (not the ping issue):
why do
whitelistsupports only several paths, but not allowing some random paths?And also why don't allow to whitelist external symlinks? The only security issue I know about that is allowing to execute binaries from the "host", but it working only if there is some bugs at kernel level (see last overlayfs+namespaces bug). And I don't think possibility of such bugs is a reason for firejail to disallow such useful functionality ;)
@netblue30 commented on GitHub (Mar 22, 2016):
Blacklisting /var is a very bad idea. Lots of software use /var, and usually they expect the files to be there read/write. Sometimes they just crash without any kind of error recovery.
For example, I run on a Ubuntu 10.04 "firejail --blacklist=/var firefox" and I get:
I still get network connectivity, but something is definitely broken - in this case IBus, using a foreign keyboard mapping will not work.
ping/ping6: SUID binaries are disabled in the sandbox, so ping will not work. For testing you can try to run with --noprofile. This will enable SUID binaries.
65534 is a user id without any privileges. The kernel uses it to replace unwanted users in a user namespace.
External symlinks in --whitelist open the sandbox to all kind of exploits, so I have to disable them.
Allowing external symlinks under
@msva commented on GitHub (Mar 22, 2016):
Yeah, I know that some software _can_ use
/varand it can brake something, but I doing that (white/blacklisting/var/*) only with properly testing and full responsibility for the result ;)And I wanted very much to hide
/varand some other "non-standard" directories from some proprietary software I forced to use. Andwhitelistwould be ideal variant, because I want they don't know that such path exist at all, and not just be forbidden to open them.//nb: your comment is cut on "under" word and looks unfinished.
@netblue30 commented on GitHub (Mar 22, 2016):
OK, I think if I allow in --whitelist /var/run and /var/lock to point outside /var, all would be fine. I'll bring in a fix.
@msva commented on GitHub (Mar 22, 2016):
By the way, isn't it a way to ask firejail to not whitelist, but create new
/var/runinside?And question about one more restriction:
But firejail do mount tmpfs on parent directories of whitelisted things. So, what is the point of such restriction?
And, also, can you share your thoughts, what can be the reason of the fact, that any jailed soft losing access to internet if it has no access to run? Was I right on suggestion, that jail need access to some files in firejail's directory for that?
And one more thing: I think, it will be nice to hide firejail mountpoints and other service things from jailed software. I think, this is security breach:
So, any jailed software
@netblue30 commented on GitHub (Mar 23, 2016):
I think on your platform you have /etc/resolv.conf a symlink in /run. So, if /run disappears you will not get network connectivity. I would make /etc/resolv.conf a real file.
I'll bring in fixes for all the other issues, thanks.
@msva commented on GitHub (Mar 23, 2016):
I do not have/etc/resolv.confas symlink to/run/*. It is regular fileI do, sorry. It is
connmanhijacked it :(.@netblue30 commented on GitHub (Mar 23, 2016):
I put a fix in for /var/run and /var/lock, you can whitelist them now. Also, I mounted tmpfs on top of /run/firejail/{bandwidth,name,network,x11}, so there won't be any information leaks.
tmps as user opens the door to some nice SUID exploits, so I had to remove it. Let me know if you find something else, thanks!