I'm trying to blacklist certain partition but unable to do so. I tried to blacklist /run/media/user/partition's name , but that didn't pay off. As of now, I don't know what do. disable-mnt won't help me as I need access to other drives. Any help would be appreciated.
Spec: Manjaro (KDE), Kernel: 5.5.x, Firejail ver: 0.9.62
where are your mounted files actually at?
in /mnt
or /media
?
where are your mounted files actually at?
in /mnt
or /media
?
/media
Do you try to blacklist inside a FUSE mount?
If yes, you somehow need to add allow_root to the FUSE mount options.
Do you try to blacklist inside a FUSE mount?
If yes, you somehow need to add
allow_rootto the FUSE mount options.
not necessarily inside a FUSE mount. What I want is close to disable-mnt but for specific drives.
I think the issue is that blacklist/whitelist has only an effect if the directory/file is already present when the sandbox is started.
I think the issue is that
blacklist/whitelisthas only an effect if the directory/file is already present when the sandbox is started.
yes... is there any workaround?
Firejail first configures the sandbox and then drops all privileges in order to start the application. At this point the sandbox is basically set in stone, at least for a regular user.
Talking about workarounds, one could in theory somehow detect the mount event and then join the sandbox as root user and modify the mount namespace of the sandbox manually, but this suffers from all kinds of race conditions. This means there would be always short time spans where the sandbox has full access to the paths that you want blacklisted.
So no, unfortunately there is no workaround.
IDK what your targeted workflow is but this works:
mkdir /media/foo # create mountpoint
firejail --whitelist=/media/foo --blacklist=/run/media --blacklist=/mnt … app
# mount anything to /media/bar, app can't see it
# mount anything to /media/foo, app can see it
@rusty-snake Right, thanks!
IDK what your targeted workflow is but this works:
mkdir /media/foo # create mountpoint firejail --whitelist=/media/foo --blacklist=/run/media --blacklist=/mnt … app # mount anything to /media/bar, app can't see it # mount anything to /media/foo, app can see itthanks.
For some reason, it never occurs to me to mount it in different location.
Closing here, as a viable workaround is available. Feel free to re-open at your discretion.
Most helpful comment
IDK what your targeted workflow is but this works: