[GH-ISSUE #3580] Question: Firefox - How do i allow an external storage path? #2243

Closed
opened 2026-05-05 08:56:10 -06:00 by gitea-mirror · 12 comments
Owner

Originally created by @svc88 on GitHub (Aug 9, 2020).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3580

Using the default profile for Firefox in 0.9.62

I would like to allow Firefox access to a specific path under /media/drive/bla/bla/bla
What do i need to put under firefox.local ?

I tried noblacklist and whitelist but it doesnt work for /media/xxx

Originally created by @svc88 on GitHub (Aug 9, 2020). Original GitHub issue: https://github.com/netblue30/firejail/issues/3580 Using the default profile for Firefox in 0.9.62 I would like to allow Firefox access to a specific path under /media/drive/bla/bla/bla What do i need to put under firefox.local ? I tried noblacklist and whitelist but it doesnt work for /media/xxx
Author
Owner

@smitsohu commented on GitHub (Aug 9, 2020):

Try --noblacklist=/media or --ignore=disable-mnt

<!-- gh-comment-id:671094292 --> @smitsohu commented on GitHub (Aug 9, 2020): Try `--noblacklist=/media` or `--ignore=disable-mnt`
Author
Owner

@rusty-snake commented on GitHub (Aug 9, 2020):

ignore disable-mnt


Edit: smitsohu was 1 second faster 🤣

smitsohu: 2020-08-09T19:57:32Z
rusty-snake: 2020-08-09T19:57:33Z

<!-- gh-comment-id:671094295 --> @rusty-snake commented on GitHub (Aug 9, 2020): `ignore disable-mnt` --- Edit: smitsohu was 1 second faster :rofl: smitsohu: 2020-08-09T19:57:32Z rusty-snake: 2020-08-09T19:57:33Z
Author
Owner

@svc88 commented on GitHub (Aug 9, 2020):

Thanks guys.

Try --noblacklist=/media or --ignore=disable-mnt

If i try either only --noblacklist=/media OR only --ignore=disable-mnt - this allows it but at the same time, it allows ALL drives to be accessed and obviously i dont want to allow other drives to be compromised/visible, however if i try only a complete specific path such as /media/dir1/dir2/dir3/dir4 it doesnt allow it as i originally mentioned.

So what i did was (as @rusty-snake also mentioned):

ignore disable-mnt
noblacklist /media/dir1/dir2/dir3/dir4
whitelist /media/dir1/dir2/dir3/dir4

This allowed Firefox the specific device's dir path but at the same time disallows all other drives mounted which is great, so is this the correct way to go about this?

<!-- gh-comment-id:671102112 --> @svc88 commented on GitHub (Aug 9, 2020): Thanks guys. > Try `--noblacklist=/media` or `--ignore=disable-mnt` If i try either only `--noblacklist=/media` OR only `--ignore=disable-mnt` - this allows it but at the same time, it allows ALL drives to be accessed and obviously i dont want to allow other drives to be compromised/visible, however if i try only a complete specific path such as `/media/dir1/dir2/dir3/dir4` it doesnt allow it as i originally mentioned. So what i did was (as @rusty-snake also mentioned): ``` ignore disable-mnt noblacklist /media/dir1/dir2/dir3/dir4 whitelist /media/dir1/dir2/dir3/dir4 ``` This allowed Firefox the specific device's dir path but at the same time disallows all other drives mounted which is great, so is this the correct way to go about this?
Author
Owner

@svc88 commented on GitHub (Aug 9, 2020):

Is there no other way besides ignore disable-mnt ?

<!-- gh-comment-id:671102176 --> @svc88 commented on GitHub (Aug 9, 2020): Is there no other way besides `ignore disable-mnt` ?
Author
Owner

@rusty-snake commented on GitHub (Aug 9, 2020):

#3245

<!-- gh-comment-id:671104707 --> @rusty-snake commented on GitHub (Aug 9, 2020): #3245
Author
Owner

@svc88 commented on GitHub (Aug 9, 2020):

@rusty-snake your comment here, i tried it, but firstly i get the error Error: only directories in user home or /tmp are supported by mkdir

<!-- gh-comment-id:671107270 --> @svc88 commented on GitHub (Aug 9, 2020): @rusty-snake [your comment](https://github.com/netblue30/firejail/issues/3245#issuecomment-592920834) here, i tried it, but firstly i get the error `Error: only directories in user home or /tmp are supported by mkdir`
Author
Owner

@svc88 commented on GitHub (Aug 9, 2020):

It seems i cant get this to work. I dont want to blacklist specific drives. i actually want to blacklist or disable-mnt on all drives but one.
Is there another way to do this?

<!-- gh-comment-id:671107661 --> @svc88 commented on GitHub (Aug 9, 2020): It seems i cant get this to work. I dont want to blacklist specific drives. i actually want to blacklist or disable-mnt on all drives but one. Is there another way to do this?
Author
Owner

@svc88 commented on GitHub (Aug 9, 2020):

Basically since the below works and disallows the rest of the drives but with disable-mnt ignored, my question is, is this ok or is there a way the app could still get into the rest of the drives somehow?

ignore disable-mnt
noblacklist /media/dir1/dir2/dir3/dir4
whitelist /media/dir1/dir2/dir3/dir4
<!-- gh-comment-id:671108007 --> @svc88 commented on GitHub (Aug 9, 2020): Basically since the below works and disallows the rest of the drives but with disable-mnt ignored, my question is, is this ok or is there a way the app could **still** get into the rest of the drives somehow? ``` ignore disable-mnt noblacklist /media/dir1/dir2/dir3/dir4 whitelist /media/dir1/dir2/dir3/dir4 ```
Author
Owner

@rusty-snake commented on GitHub (Aug 10, 2020):

is there a way the app could still get into the rest of the drives somehow

noblacklist /media/dir1/dir2/dir3/dir4 this line is redundant, since there is no such backlist.
whitelist /media/dir1/dir2/dir3/dir4 this makes /media containing only dir1 or if dir1 is not present when the sandbox is started /media empty. However using gio/gvfs/kio over D-Bus may allow the app to see more drivers (but I don't believe that D-Bus is used to access files, this is very likely still done with open).

<!-- gh-comment-id:671186459 --> @rusty-snake commented on GitHub (Aug 10, 2020): > is there a way the app could still get into the rest of the drives somehow `noblacklist /media/dir1/dir2/dir3/dir4` this line is redundant, since there is no such `backlist`. `whitelist /media/dir1/dir2/dir3/dir4` this makes `/media` containing only `dir1` or if dir1 is not present when the sandbox is started `/media` empty. However using gio/gvfs/kio over D-Bus may allow the app to see more drivers (but I don't believe that D-Bus is used to access files, this is very likely still done with `open`).
Author
Owner

@svc88 commented on GitHub (Aug 17, 2020):

@rusty-snake thanks, noted.
Can you please explain what you mean its likely done with open ?

<!-- gh-comment-id:675031422 --> @svc88 commented on GitHub (Aug 17, 2020): @rusty-snake thanks, noted. Can you please explain what you mean its likely done with `open` ?
Author
Owner

@rusty-snake commented on GitHub (Aug 24, 2020):

https://www.man7.org/linux/man-pages/man2/open.2.html

<!-- gh-comment-id:679415155 --> @rusty-snake commented on GitHub (Aug 24, 2020): https://www.man7.org/linux/man-pages/man2/open.2.html
Author
Owner

@rusty-snake commented on GitHub (Oct 1, 2020):

I'm closing here due to inactivity, please fell free to request to reopen if you still have this issue.

<!-- gh-comment-id:702308029 --> @rusty-snake commented on GitHub (Oct 1, 2020): I'm closing here due to inactivity, please fell free to request to reopen if you still have this issue.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#2243
No description provided.