mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #3072] Question about OverlayFS #1925
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#1925
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 @Futureknows on GitHub (Dec 4, 2019).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3072
I am looking for a certain functionality as follows: Allow a FJ sandbox to write files to a folder without being able to view or access any of the preexisting contents of the folder. Then when sandbox is closed "flatten" the folder so that all the new and old contents are retained.
Is this possible with the overlayfs or other arguments?
@ghost commented on GitHub (Dec 14, 2019):
Personally I've never had the need for such a use-case, so this is untested, but I think you can use the
--overlay-named=namein combination with the--putoptions.Quoting from
man firejail:Mount a filesystem overlay on top of the current filesystem. Unlike the regular filesystem container, the system directories are mounted read-write. All filesystem modifications go into the overlay. Directories /run, /tmp and /dev are not covered by the overlay. The overlay is stored in $HOME/.firejail/ directory. The created overlay can be reused between multiple sessions. If the sandbox is started as a regular user, nonewprivs and a default capabilities filter are enabled.
You can drop files into any noblacklisted/whitelisted directory using --put once the relevant sandbox is active (started with an additional --name=foo for ease-of-use):
firejail --put=foo ~/my_special_file ~/my_special_folder/my_special_fileYou'll need to do the above for each file you want to transfer into the sandbox. See the FILE TRANSFER section in
man firejailfor more details. I do recommend experimenting/testing with a small sample of test files before committing such a scripted approach. HTH.@Futureknows commented on GitHub (Jan 7, 2020):
Thanks it looks like a good solution. I settled on a script that moves the files above the folder on each launch so the jail just gets the empty directory and I can access all the files outside.