Replies: 3 comments 7 replies
-
|
I've installed discord on my Arch Linux box to assist in creating a hardened setup for it cfr. #5978. Remarks pertaining to this specific use case and symlinking under ${HOME}: IMO secure results are achieved by targetting both locations. Translating this rule-of-thumb for your specific use case I'd try the following:
To sum up: $ cat ~/.config/firejail/globals.local
[...]
blacklist ${HOME}/Private$ cat ~/.config/firejail/discord.local
# Firejail profile for discord
# Persistent local customizations
## globals.local overrides
# lift ${HOME}/Private blacklisting
noblacklist ${HOME}/Private$ cat ~/.config/firejail/discord-common.local
# Firejail profile for discord-common
# Persistent local customizations
# Discord modules like discord_{rpc,spellcheck,utils,voice} depend on nodejs
# Allow node (disabled by disable-interpreters.inc)
include allow-nodejs.inc
# Disabled until someone reported positive feedback
ignore ignore include disable-interpreters.inc
ignore ignore include disable-xdg.inc
ignore ignore include whitelist-runuser-common.inc
ignore ignore include whitelist-usr-share-common.inc
ignore ignore apparmor
ignore ignore disable-mnt
ignore ignore private-cache
#ignore dbus-user none
ignore ignore dbus-system none
# The lines below are needed to find the default Firefox profile name, to allow
# opening links in an existing instance of Firefox (note that it still fails if
# there isn't a Firefox instance running with the default profile; see #5352)
noblacklist ${HOME}/.mozilla
whitelist ${HOME}/.mozilla/firefox/profiles.ini
whitelist ${HOME}/Private/mozilla/firefox/profiles.ini
dbus-user filter
# allow D-Bus notifications
dbus-user.talk org.freedesktop.Notifications
# allow D-Bus secrets
dbus-user.talk org.freedesktop.secrets
# allow D-Bus communication with firefox for opening links
dbus-user.talk org.mozilla.*
private-bin firefox
ignore dbus-user noneHope this helps to untangle your symlink woes... |
Beta Was this translation helpful? Give feedback.
-
Revisiting this I played around a bit more and for me the below seems to do the trick: $ cat ~/.config/firejail/discord.local
# Firejail profile for discord
# Persistent local customizations
# symlink handling woes
# https://github.com/netblue30/firejail/discussions/5980
# open links in sandboxed Firefox
## globals.local overrides
# lift ${HOME}/Private blacklisting
noblacklist ${HOME}/Private
## discord.profile additions
# keep in mind the ordering 'logic' is important here
noblacklist ${HOME}/.mozilla
noblacklist ${HOME}/.mozilla/firefox
noblacklist ${HOME}/.mozilla/firefox/profiles.ini
blacklist ${HOME}/.mozilla/firefox/*
blacklist ${HOME}/.mozilla/*
whitelist ${HOME}/.mozilla
whitelist ${HOME}/Private/mozilla/*
private-bin ls,cat,firefox
dbus-user.talk org.mozilla.*HTH |
Beta Was this translation helpful? Give feedback.
-
|
For the record, there are All this doesn't invalidate your arguments for implementing #6058. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm often seeing that symlink handling in firejail is extremely confusing. I've had challenges in the past (#3133) and I'm once again working on profiles (#5978)
I have a partially-encrypted home.
~/Privateis encrypted and I move some dirs like~/.mozillainto it and symlink~/.mozilla -> Private/mozilla/.Now I'm working the discord profile. I realize that the Private symlinking requires local changes that I won't be adding to the PR. But figuring out these changes... I'm at a loss.
noblacklist ${HOME}/Private, or nothing below~/Private/is ever accessible, Ok.Should supposedly make
${HOME}/.mozilla/firefox/profiles.iniaccessible. Except it acts on the symlink target, so${HOME}/Private/mozilla/firefox/profiles.inibecomes accessible and~/.mozillais non-existent inside the jail. Now how to make~/.mozilla(the symlink) available so this can actually work?noblacklist ${HOME}/Private/mozilladoes nothing.whitelist ${HOME}/Private/mozilla/firefox/profiles.inidoes nothing.whitelist ${HOME}/.mozillaworks, too well. It makes the entire Firefox profile without whitelisting available under both~/.mozillaand~/Private/mozilla.The interactions of
blacklist,noblacklistandwhitelistin a symlinked setup is too confusing for me to follow. There is no directive to create a symlink after jail creation either.What to do at this point? Thanks a lot!
Beta Was this translation helpful? Give feedback.
All reactions