mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #1743] Can't combine --private with --whitelist #1182
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#1182
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 @eevee on GitHub (Jan 20, 2018).
Original GitHub issue: https://github.com/netblue30/firejail/issues/1743
With
--private=DIR, I can replace my entire home directory with a persistent substitute. With--whitelist=DIR, I can preserve part of my home directory while hiding everything else. But there doesn't seem to be any way to combine these behaviors — e.g., if I want to run a game (which needs all its data files to exist) and still let it write out a save file to some undocumented place elsewhere in my home directory.This is also troublesome for writing a flexible general-purpose profile. If I put
privatein the profile, then I can't use--whiteliston the command line at all; if I don't putprivatein the profile, then if I don't use--whiteliston the command line my entire home directory remains exposed.In general it would be nice if
--private,--whitelist, and--overlayhad clearer interactions with each other.Relates to:
@netblue30 commented on GitHub (Jan 27, 2018):
I started adding support for it. So far I have: private-dev, private-tmp and whitelist support for --overlay and --chroot sandboxes. You can try it out.
Support for --private=dir and --private-home is coming soon.
@qutetemp commented on GitHub (Feb 3, 2018):
Do I need the latest master because it doesn't seem to work.
@netblue30 commented on GitHub (Feb 3, 2018):
Yes, it is only in master. Also, there are some more general fixes related to overlay there. It will go into the next release.
@Ninlives commented on GitHub (Aug 8, 2018):
What's the status for whitelist support for --private now?
@H8to commented on GitHub (Sep 28, 2018):
Also hoping for this feature!
I use firejail as a Firefox profile template engine. For each of my customers the customer-template jail from a fully configured Firefox is copied to "customer-n", which then should be used for customer stuff (--private=customer-n). However I'd like to access e.g. downloads with other applications and this leads to problems as I cannot whitelist paths outside of the jail. Also copying from within the jailed Firefox is not possible as long as I can't whitelist my home/x/Desktop path.
@Vincent43 commented on GitHub (Sep 28, 2018):
Perhaps it's not complete solution for you but it's possible to transfer files from/to
--privatesandbox with--get/--putoptions. SeeFILE TRANSFERsection in manpage.@H8to commented on GitHub (Sep 28, 2018):
Thank you for your suggestion, I read through it!
I know that's not really the point of a private "jail", but I'd like to be able to download something in the jailed Firefox and then move it to a folder that's shared with the jail via drag and drop. This is the most comforty option. Put and get are demanding to much effort as I could also then just open Nemo and dragNdrop the files or folders from the jail home/downloads folder.
@chiraag-nataraj commented on GitHub (Sep 28, 2018):
@H8to I actually have a similar system for so-called "ephemeral profiles". The script is in my Firejail Profiles repo and is called
firefox.common. If you don't wantfirefoxto be able to access other profiles, you can just use a--whitelistcommand to whitelist only that specific profile instead of whitelisting~/.mozilla/firefox[edit: the script does this by default now!]. You could probably adapt a simpler version of the script for your use.@Vincent43 commented on GitHub (Sep 28, 2018):
Also making
--whitelistcompatible with--privateis not that easy. Currently--privatecan be used on top of any existent profile and it always give you separated and temporary$HOMEregardless of what rules specific profile contains. If we make it compatible then suddenly all--whitelistrules existent in profile will take effect which make--privatenot effective. Perhaps separated option like--private-whitelistmay be used if anything to no break existing usage.@chiraag-nataraj commented on GitHub (Sep 28, 2018):
To add to that, more fundamentally, a "private" jail is not meant to share data with other jails or the host. That's the whole point of a private jail. It's basically meant to act as a chroot for your home directory (which can be set-up by a regular user). If you want to share data, you're probably better off figuring out a solution with
whitelistand scripts (such as thefirefox.commonscript I alluded to in my previous reply).@Vincent43 commented on GitHub (Sep 28, 2018):
Yeah, I fully agree. Should we close this as wontfix? 😄
@chiraag-nataraj commented on GitHub (Sep 28, 2018):
@Vincent43 Let's close it for now. If it seems like there is a legimate reason to reconsider it, we'll re-open it.
@modelfe commented on GitHub (Jul 25, 2019):
I'm not sure I understand the reasoning for the wontfix here.
In my case, I'm using a firejailed Firefox browser profile for my work. Using --private=~/work is super useful, as it allows me to have a persistent Firefox browser profile setup, while isolating the browser from everything outside the work directory. However, I have a large number of media files in a directory on a separate HDD that I'd like to be able to regularly access from this Firefox profile. Being able to simply whitelist the desired media directory so I could access it would be enormously useful.
Please consider somehow adding this functionality.
@modelfe commented on GitHub (Jul 26, 2019):
To follow up on my last post; it turns out it actually is possible to do this by whitelisting the media directory in a custom firejail profile. But whitelisting the same directory with --whitelist does not work.
So including
whitelist /media/<username>/work_mediain a custom firejail profile works, even when launching with --private=~/workBut launching with
--whitelist=/media/<username>/work_mediadoes not.Is there a reason for this inconsistency, or is this a bug?
@rusty-snake commented on GitHub (Jul 26, 2019):
@modelfe
--private"breaks"whitelisting only in $HOME.If you for example run
firejail --whitelist=/media/<username>/work_media firefox, firejail will load the firejail profile which containsdisable-mnt.disable-mntblacklists/mnt,/media, ... .You can try adding--noprofileor--ignore=disable-mnt.@3ThumbsUp commented on GitHub (Jan 13, 2022):
I'd like to voice support for this feature.
One of my use cases is that I use firejail with Steam. As Steam seems to clutter the home directory more than any other program, I've given it its own firejailed home. That way Steam can do whatever it wants to, and all the clutter is out of my way in a separate directory. However, this limits some of the features. For example, I would still like Steam to be able to create desktop shortcuts, but for this to work, it needs access to /usr/share/applications and /usr/share/icons in the real home directory. Ideally, I would like it to have a firejailed home for all directories except those.
The same argument goes for some proprietary video editing software (Davinci Resolve in my case). I want to give it its own home directory to not clutter my personal home, but it obviously still needs access to my Video directory. And I can't just use regular whitelists without private mode, because the files it creates are still important for functionality. I just want to avoid unnecessary clutter in my home directory while still sharing a few important directories with the firejailed application.
I like Vincent43s suggestion of a separate whitelist to not break existing functionality. In any case, not being able to share some directories between the personal home and the firejail home is limiting some functionality.
@evren320 commented on GitHub (Dec 14, 2022):
I need this feature too.
A separate permanent home for the app, with some folders of the user home accessible.
As a workaround, mount --bind serves this purpose, but requires root password to run every time launching the app and raises some security concern.
@hvhaugwitz commented on GitHub (May 25, 2024):
An option like
--private-whitelisthas legit use cases (see comments above).Please consider to reopen this bug/feature request.
@pjhfggij commented on GitHub (Oct 28, 2024):
I think
"--private-with-whitelisting=SOME_PATH"option to poke a hole in --private firejail process would be a good idea. Otherwise I had to manually patch all the whitelist "holes" introduced by upstream profiles to be able to introduce my own selected whitelisted folders, I've had to spend an hour just to replicate --private in librewolf.local profile and I'm not looking forward having to redo this for other programs."--private-whitelist"could free users from such chores.@kolAflash commented on GitHub (Feb 4, 2025):
It took me quite some time to figure out how
--noprofile, --privateand--whitelist=...interact. **Please add some documentation.** Either in the man-page. Or ideallyfirejailshould report an error if the user callsfirejail --private --whitelist=$HOME/something`.It should be noted, that:
--noprofiledisables--private--noprofilethe--profile=default.profileis enabled by default.defaultblacklists directories like/etc/ssh/and markes files like~/.bashrcread-only.read-onlycan only be overwritten from another profile, not with command line --read-write=...--noprofileremoves read-only and blacklist entries for sensitive files / directories--whitelist=automatically hides$HOME--privatea--whitelist=$HOME/somethingwill be ignored@rusty-snake commented on GitHub (Feb 4, 2025):
default.profileisn't secure either.@kolAflash commented on GitHub (Feb 5, 2025):
@rusty-snake
Thanks! Can you post a link?
@rusty-snake commented on GitHub (Feb 5, 2025):
manpage:
and https://github.com/netblue30/firejail/wiki/Creating-overrides
if you have ideas how this can be documented in a better way, send a PR.
@rusty-snake commented on GitHub (Feb 6, 2025):
#6622 had been merged