mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #3201] How to make applications have access to a virtual filepath (like flatpak does) #2004
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#2004
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 @Joe23232 on GitHub (Feb 5, 2020).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3201
So with flatpak if you download something like Steam, Steam has access to and virtual file paths, therefore games get installed in the virtual filepath, but with the download directory, it has access to the real download directory.
How would I do this with firejail?
@smitsohu commented on GitHub (Feb 5, 2020):
I'm not really familiar with Steam, but you might want to take a look at the
--private=option.In a profile it could look like
In this case the app would always see ~/fakehome instead of the real home directory.
@Joe23232 commented on GitHub (Feb 5, 2020):
@smitsohu So this creates a
fakehomedirectory and what doesprivate ${HOME}/fakehomethis do exactly?Can the application still see the root directory and external drives's contents that are connected to my PC?
@smitsohu commented on GitHub (Feb 5, 2020):
It makes the app see ~/fakehome instead of the real home directory.
Just try it out :)
The
--private=option is not sufficient to create a complete sandbox, obviously.But it is my superficial understanding that all games and settings are stored in the user home directory. For everything else there are other precautions and other options (default read-only filesystem, blacklisting,
disable-mnt, ...), and you can also use more of the private options (private-bin,private-etc, ...) to "virtualize" other parts of the file system.@Joe23232 commented on GitHub (Feb 5, 2020):
Probably I want to virtualise everything but the downloads directory. So if the home directory is virtualised, is it possible to still allow the application to ONLY have access to the real Downloads' directory?
@smitsohu commented on GitHub (Feb 6, 2020):
You will need to make some kind of compromise. The alternative to the
privateoptions iswhitelist. There, a top level directory is "virtualized", so to say, but holes are punched in this virtualization for user defined files and directories. In a profile that translates to simplyIf Flatpak does a combination of those two things, this is something that users currently cannot do in Firejail.
Btw, only in case I was unclear, all modifications in ~/fakehome (the
--private=option suggested above) are persistent. So the sandbox just has its own Downloads directory.@Joe23232 commented on GitHub (Feb 6, 2020):
Is there a command which virtualises everything all in one go?
@smitsohu commented on GitHub (Feb 6, 2020):
Ok, it is possible to get rather close to that end with the
--overlayand--chrootoptions. For example, it could look like:firejail --private-tmp --private-dev --overlay-named=somenameUnfortunately there is currently a bug in the overlay implementation (kernels > 4.19). So if a complete chroot is in scope, the answer is probably yes. Otherwise the answer is probably no (edit: until the issue with overlay is resolved).
@rusty-snake commented on GitHub (Mar 14, 2020):
I'm closing here due to inactivity, please fell free to reopen if you have more questions.