mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #3133] Dealing with symlinked ~/.cache #1968
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#1968
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 @haarp on GitHub (Jan 8, 2020).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3133
Greetings!
Currently experimenting with Firejail and liking it so far. :)
One problem I'm facing is the fact that I have
~/.cachesymlinked to/tmp/cache-$USER./tmpresides on tmpfs and the symlink target is mkdir'ed on login with perms700.Now firejail seems to set everything with perms
700to be owned bynobody:nobody, making it impossible to access~/.cachefrom within a sandbox.Things I've tried so far:
private-cache: Would be the best solution, but fails withWarning: /home/haarp/.cache is a symbolic link, tmpfs not mounted. Is there no way to make tmpfs work on top of a symlink?private-tmp: Could work, but I would have to mkdir/tmp/cache-$USERfrom within each sandbox before the actual app runs. This complicates things as I can't just runfirejail fooanymore.noblacklist /tmp/cache-$USER: Doesn't seem to have an effect of making it accessible.Now I'm stumped. Any further ideas? I would like to avoid having to remove or replace the
~/.cachesymlink.Thanks!
@haarp commented on GitHub (Jan 8, 2020):
Ok, I figured it out the final point. There is no automatic blacklisting. I had
~/.nvsymlinked to~/.cache.~/.nvis blacklisted by default indisable-programs.inc. It appears blacklisting traverses the entire symlink chain and actually blacklists the final target.If noblacklist is to succeed, it needs to be applied to the path which triggered the blacklist in the first place. In this case,
noblacklist ${HOME}/.nv.Maybe the manpage should be updated with this information? I'm probably not the only one who was struggling to figure this out :) Cheers!
(I still would like to know if there's a way to mount tmpfs over symlinks tho)
@smitsohu commented on GitHub (Jan 15, 2020):
Not sure I understand that part, could you provide a command? Does your user own that directory?
@haarp commented on GitHub (Jan 15, 2020):
I was wrong about that, please see my second comment.
@smitsohu commented on GitHub (Jan 15, 2020):
Then, am I right in assuming that it works just fine if there is 1) no
private-tmp, 2) no whitelisting in user home and if 3)noblacklist ${HOME}/.nvis added to a file /etc/firejail/disable-programs.local?For issues associated with whitelisting in user home there is a simple solution: Just create a file /etc/firejail/whitelist-common.local and put
whitelist ${HOME}/.cacheinside; this way the link is always replicated inside the sandbox.Regarding
private-tmpyour only option currently is to modify the stock profiles: Create files with the same name and a .local ending and put the new directive inside, eithermkdir /tmp/cache-$USERorwhitelist /tmp/cache-$USER.The former basically is the same as
private-cache, whereas in the latter case all reads and writes leave the sandbox and go to the shared cache directory.Currently not, because of security considerations.
@haarp commented on GitHub (Jan 17, 2020):
Correct!
But whitelisting .cache will hide (almost) the entire home directory instead. That's a fairly impactful side-effect.
Oh wow. I just realized that
mkdiris an actual directive. Turns out there's more than just thefirejailmanpage. This'll come in handy, thanks!In conclusion, here are the possible ways of dealing with this problem:
~/.nvsymlinknoblacklist, but it has to be used on the path that triggered the blacklist in the first place (~/.nv), not its symlink target (~/.cache), or its target (/tmp/cache-$user). This behavior should be documented IMO.private-tmptogether withmkdir /tmp/cache-$userCheers!