[GH-ISSUE #3581] Blacklisting /media/ except for one folder #2246

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

Originally created by @ihasaquesion on GitHub (Aug 10, 2020).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3581

When I use a profile that has noblacklist /media/directory/path followed by a later blacklist /media/ I keep getting blacklist violations in the syslog: syscall opendir, path /media. These errors only appear when I include blacklist /media/.

How to blacklist all /media/ except for one directory?

And it also doesn't work when whitelisting the directory (next to the other whitelistings in the profile).

firejail version 0.9.62

Originally created by @ihasaquesion on GitHub (Aug 10, 2020). Original GitHub issue: https://github.com/netblue30/firejail/issues/3581 When I use a profile that has `noblacklist /media/directory/path` followed by a later `blacklist /media/` I keep getting blacklist violations in the syslog: `syscall opendir, path /media`. These errors only appear when I include `blacklist /media/`. How to blacklist all /media/ except for one directory? And it also doesn't work when whitelisting the directory (next to the other whitelistings in the profile). firejail version 0.9.62
Author
Owner

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

It is easy, just do --noblacklist=/media/dir --blacklist=/media/*

<!-- gh-comment-id:671871754 --> @smitsohu commented on GitHub (Aug 11, 2020): It is easy, just do `--noblacklist=/media/dir --blacklist=/media/*`
Author
Owner

@ihasaquesion commented on GitHub (Aug 11, 2020):

Doesn't work.
I'd like to use a profile, not command-line parameters. The profile is:

...
noblacklist /media/veracrypt1/dir
...
blacklist /media/*
...
<!-- gh-comment-id:671982864 --> @ihasaquesion commented on GitHub (Aug 11, 2020): Doesn't work. I'd like to use a profile, not command-line parameters. The profile is: ``` ... noblacklist /media/veracrypt1/dir ... blacklist /media/* ... ```
Author
Owner

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

Ok, then it is

noblacklist /media/veracrypt
blacklist /media/*
noblacklist /media/veracrypt/dir
blacklist /media/veracrypt/*

Or just whitelist /media/veracrypt/dir.

If the latter does not work, please post the output of firejail --debug-whitelists --whitelist=/media/veracrypt/dir. Redact the name of the directory if you like.

<!-- gh-comment-id:671993511 --> @smitsohu commented on GitHub (Aug 11, 2020): Ok, then it is ``` noblacklist /media/veracrypt blacklist /media/* noblacklist /media/veracrypt/dir blacklist /media/veracrypt/* ``` Or just `whitelist /media/veracrypt/dir`. If the latter does not work, please post the output of `firejail --debug-whitelists --whitelist=/media/veracrypt/dir`. Redact the name of the directory if you like.
Author
Owner

@ihasaquesion commented on GitHub (Aug 11, 2020):

Thanks, whitelisting beneath the profile's blacklistings worked. Previously it didn't - probably because I kept the blacklistings.

<!-- gh-comment-id:672005142 --> @ihasaquesion commented on GitHub (Aug 11, 2020): Thanks, whitelisting beneath the profile's blacklistings worked. Previously it didn't - probably because I kept the blacklistings.
Author
Owner

@ihasaquesion commented on GitHub (Aug 11, 2020):

It worked for one profile but not the other. I also put whitelist to the bottom of the profile before caps.drop all. I tried removing the noblacklist for the same directory. It's the profile for #3579

<!-- gh-comment-id:672013155 --> @ihasaquesion commented on GitHub (Aug 11, 2020): It worked for one profile but not the other. I also put whitelist to the bottom of the profile before caps.drop all. I tried removing the noblacklist for the same directory. It's the profile for #3579
Author
Owner

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

Is there a disable-mnt line in that other profile?

<!-- gh-comment-id:672018630 --> @smitsohu commented on GitHub (Aug 11, 2020): Is there a `disable-mnt` line in that other profile?
Author
Owner

@ihasaquesion commented on GitHub (Aug 11, 2020):

No, it's mostly the default JDownloader profile. I added include chromium.profile.

<!-- gh-comment-id:672025794 --> @ihasaquesion commented on GitHub (Aug 11, 2020): No, it's mostly the default JDownloader profile. I added `include chromium.profile`.
Author
Owner

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

No, it's mostly the default JDownloader profile. I added include chromium.profile.

… which includes chromium-common.profile which sets disable-mnt 🙄 .

<!-- gh-comment-id:672045439 --> @rusty-snake commented on GitHub (Aug 11, 2020): > No, it's mostly the default JDownloader profile. I added include chromium.profile. … which `include`s chromium-common.profile which sets `disable-mnt` :roll_eyes: .
Author
Owner

@ihasaquesion commented on GitHub (Aug 11, 2020):

I suspected this line to be the culprit. How to enable-mnt without having to modify this profile?

<!-- gh-comment-id:672055115 --> @ihasaquesion commented on GitHub (Aug 11, 2020): I suspected this line to be the culprit. How to enable-mnt without having to modify this profile?
Author
Owner

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

Add ignore disable-mnt before you include chromium.profile.

<!-- gh-comment-id:672060193 --> @rusty-snake commented on GitHub (Aug 11, 2020): Add `ignore disable-mnt` before you `include chromium.profile`.
Author
Owner

@ihasaquesion commented on GitHub (Aug 11, 2020):

Thank you!!

<!-- gh-comment-id:672065201 --> @ihasaquesion commented on GitHub (Aug 11, 2020): Thank you!!
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#2246
No description provided.