mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #1098] Cannot whitelist symlinks that point outside home directory #752
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#752
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 @lheckemann on GitHub (Feb 11, 2017).
Original GitHub issue: https://github.com/netblue30/firejail/issues/1098
I'm on NixOS, and I want to whitelist
~/.nix-profile(symlink to/nix/var/nix/profiles/per-user/linus/profile) for read-only access (so the symlink cannot be modified from inside the jail). However, this no longer works in firejail 0.9.44.4; it worked in the previous version I had installed, which I believe was 0.9.44.2.@netblue30 commented on GitHub (Feb 11, 2017):
The directory your link points to, needs to be owned by the regular user starting the sandbox. If it is owned by root, it will refuse to build the link and print a "Error: invalid whitelist path ..." message. You can still make the directory read-only (chmod 511 directory).
@lheckemann commented on GitHub (Feb 12, 2017):
Is it not possible to make the symlink itself visible inside the sandbox? I want it available even though the (final) target is owned by root (and should remain so).
@netblue30 commented on GitHub (Feb 12, 2017):
OK, I put a fix on mainline git. Grab the new version, open /etc/firejail/firejail.config and add "follow-symlink-as-user no".
@lheckemann commented on GitHub (Feb 12, 2017):
Awesome, thanks! I'll try it out later.
@tilpner commented on GitHub (Mar 6, 2017):
@netblue30 Could you please reopen this issue?
@lheckemann mentioned on IRC that he hasn't actually tried the fix yet, and it doesn't seem to fix the problem for me
I added
follow-symlink-as-user nointo/etc/firejail/firejail.configand~/.config/firejail/firejail.config, but firejail still errors withError: invalid whitelist pathfor anything that links to/nix/store/*.There's no indication firejail even reads those files, possibly because they're both symlinks again. Putting invalid lines into both of them ("foobar") doesn't cause invocations with
--debugto print anything related.Would this cause firejail to not read the config? Unfortunately strace-ing firejail triggers sandbox detection...
@netblue30 commented on GitHub (Mar 7, 2017):
I'll try it out.
@vtpoet commented on GitHub (Mar 26, 2017):
Also had this problem. (All my home folders are symlnked to a separate partition.) Added your PPA and updated. Works now. Thanks!
@tex commented on GitHub (Apr 8, 2017):
@vtpoet what is PPA?
I have the same problem, how to fix it?
@vtpoet commented on GitHub (Apr 8, 2017):
Hi Tex,
You can use the PPA if you're using an Ubuntu-based system. The PPA is here:
https://launchpad.net/~deki/+archive/ubuntu/firejail
If you're using Debian, you can still install the app at the PPA but it's a bit more complicated. For information on what a PPA is, try this:
https://askubuntu.com/questions/4983/what-are-ppas-and-how-do-i-use-them
@tex commented on GitHub (Apr 8, 2017):
Thank you. Unfortunately I'm running NixOs right now.
@vtpoet commented on GitHub (Apr 8, 2017):
Yeah, that's the downside to these niche linux distros.
If you're really determined, you still might be able to compile the PPA's version on NixOS by using the source code. I've done it myself and it's not hard (once you know how). It's installing all the dependencies and finding a reliable and well-constructed guide that's time consuming.
@lheckemann commented on GitHub (Apr 9, 2017):
Try
git clone https://github.com/netblue30/firejail
nix-build -E "with import {}; firejail.overrideAttrs (orig: {src = ./firejail;})"
@vtpoet commented on GitHub (Mar 27, 2019):
Can you reopen this? I bumped into this issue again when I moved my .cache directory to a larger partition. Long story short: My system partition is relatively small so I opt to symbolically link my home folders, including .cache, to a larger partition. (My .cache directory can get to be several gigabytes in size.) Starting up firejail, I get the invalid whitelist error:
@vtpoet commented on GitHub (Mar 27, 2019):
Nevermind. Fixed. Turns out it was a permission problem. When I used root to move the .cache folder, the permissions, naturally enough, were assigned to root. Nothing Chown couldn't fix.