mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #487] Question: Whitelisting devices #343
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#343
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 @pyamsoft on GitHub (Apr 28, 2016).
Original GitHub issue: https://github.com/netblue30/firejail/issues/487
Forgive me if I have simply missed a part of the documentation.
Is there any current way to whitelist devices in the /dev folder? I know that the
--private-devoption creates a jail with only certain devices in it. I will admit that I have no idea how this actually works. What I am wondering if there is a way to whitelist certain devices paths in the /dev folder for inclusion into this limited private /dev.For example, lets say I have a device
/dev/foothat I want to be accessible from my jail, and a/dev/barthat I want hidden. I would still like to make a private dev, as I don't want programs in the system to access/dev/bar. I am wondering if it would be feasible to create an option like--whitelist-devwhich allows me to run a--private-devthat includes access to my/dev/fooCurrently it seems that in this kind of scenario, I would either have to make a jail that does not have a private dev, letting programs access my
/dev/baror I create a private dev and lose access to my/dev/foo. Forgive me if this is already possible with the current version of firejail, I have not noticed anything in the documents that would suggest so.@netblue30 commented on GitHub (Apr 28, 2016):
You can whitelist files and directories in /dev, and only the whitelisted files will be visible under /dev/ Example:
@pyamsoft commented on GitHub (Apr 28, 2016):
Thank you for your response.
This was a mistake on my part then as I did not read the documentation closely enough.
@pyamsoft commented on GitHub (Apr 28, 2016):
A follow up question:
ArchLinux firejail 9.40-rc1
The following command will create a private dev as expected in the jail
What is the expected behavior in the following case then?
Should one expect, because of the whitelist call that /dev only has null as shown? Or should private-dev still populate a dev folder and then link
/dev/nullinto it?@netblue30 commented on GitHub (Apr 28, 2016):
Looking through the code, first private-dev is applied, than whitelist. You'll end up only with a /dev/null inside /dev.
@pyamsoft commented on GitHub (Apr 29, 2016):
Thank you for that clarification. Do you believe the current implementation is the best way of handling that kind of use case where a whitelist and private-dev or private-tmp is specified in the command line?
I personally would expect the private-dev call to guarantee the presence of null and shm and the like, and then change or add to with my whitelisted devices, but I am curious to hear your thoughts about this.
@netblue30 commented on GitHub (Apr 30, 2016):
The idea is that --private-* creates a new tmpfs directory and copies files over from the real filesystem, while --whitelist creates a new tmpfs and links to the real files in the filesystem. As a result, private-* will discard modifications when you exit the sandbox, while --whitelist will preserve modifications.