firejail/etc/profile-a-l/keepassxc.profile
Kelvin M. Klann 5df1f27c63 etc: use ${DOCUMENTS} macro where appropriate
Currently, some paths are hard-coded:

    $ grep -Fnr '${HOME}/Documents' etc etc-fixes
    etc/profile-m-z/Mathematica.profile:19:mkdir ${HOME}/Documents/Wolfram Mathematica
    etc/profile-m-z/Mathematica.profile:22:whitelist ${HOME}/Documents/Wolfram Mathematica
    etc/profile-a-l/keepassxc.profile:34:# If you do so, you MUST store your database under ${HOME}/Documents/KeePassXC/foo.kdbx
    etc/profile-a-l/keepassxc.profile:35:#mkdir ${HOME}/Documents/KeePassXC
    etc/profile-a-l/keepassxc.profile:36:#whitelist ${HOME}/Documents/KeePassXC

Commands used to search and replace:

    $ find etc etc-fixes/ -type f -exec \
      sed -i.bak -e 's|\${HOME}/Documents|${DOCUMENTS}|' '{}' +

Related to that, the (lack of) usage of ${DOWNLOADS} has been recently
fixed on commit deae31301 ("use ${DOWNLOADS} in lutris.profile
(#3955)").

With the above change, all macros other than ${DOCUMENTS} seem to be
already used appropriately:

    $ grep -Fnr '${HOME}/Desktop' etc etc-fixes
    $ grep -Fnr '${HOME}/Downloads' etc etc-fixes
    $ grep -Fnr '${HOME}/Music' etc etc-fixes
    $ grep -Fnr '${HOME}/Pictures' etc etc-fixes
    $ grep -Fnr '${HOME}/Videos' etc etc-fixes

See src/firejail/macros.c for details.
2021-02-08 18:47:21 -03:00

100 lines
3.8 KiB
Text

# Firejail profile for keepassxc
# Description: Cross Platform Password Manager
# This file is overwritten after every install/update
# Persistent local customizations
include keepassxc.local
# Persistent global definitions
include globals.local
noblacklist ${HOME}/*.kdb
noblacklist ${HOME}/*.kdbx
noblacklist ${HOME}/.cache/keepassxc
noblacklist ${HOME}/.config/keepassxc
noblacklist ${HOME}/.keepassxc
noblacklist ${DOCUMENTS}
# Allow browser profiles, required for browser integration.
noblacklist ${HOME}/.config/BraveSoftware
noblacklist ${HOME}/.config/chromium
noblacklist ${HOME}/.config/google-chrome
noblacklist ${HOME}/.config/vivaldi
noblacklist ${HOME}/.local/share/torbrowser
noblacklist ${HOME}/.mozilla
include disable-common.inc
include disable-devel.inc
include disable-exec.inc
include disable-interpreters.inc
include disable-passwdmgr.inc
include disable-programs.inc
include disable-shell.inc
include disable-xdg.inc
# You can enable whitelisting for keepassxc by uncommenting (or adding to you keepassxc.local) the following lines.
# If you do so, you MUST store your database under ${DOCUMENTS}/KeePassXC/foo.kdbx
#mkdir ${DOCUMENTS}/KeePassXC
#whitelist ${DOCUMENTS}/KeePassXC
# Needed for KeePassXC-Browser
#mkfile ${HOME}/.config/BraveSoftware/Brave-Browser/NativeMessagingHosts/org.keepassxc.keepassxc_browser.json
#whitelist ${HOME}/.config/BraveSoftware/Brave-Browser/NativeMessagingHosts/org.keepassxc.keepassxc_browser.json
#mkfile ${HOME}/.config/chromium/NativeMessagingHosts/org.keepassxc.keepassxc_browser.json
#whitelist ${HOME}/.config/chromium/NativeMessagingHosts/org.keepassxc.keepassxc_browser.json
#mkfile ${HOME}/.config/google-chrome/NativeMessagingHosts/org.keepassxc.keepassxc_browser.json
#whitelist ${HOME}/.config/google-chrome/NativeMessagingHosts/org.keepassxc.keepassxc_browser.json
#mkfile ${HOME}/.config/vivaldi/NativeMessagingHosts/org.keepassxc.keepassxc_browser.json
#whitelist ${HOME}/.config/vivaldi/NativeMessagingHosts/org.keepassxc.keepassxc_browser.json
#mkfile ${HOME}/.local/share/torbrowser/tbb/x86_64/tor-browser_en-US/Browser/TorBrowser/Data/Browser/.mozilla/native-messaging-hosts/org.keepassxc.keepassxc_browser.json
#whitelist ${HOME}/.local/share/torbrowser/tbb/x86_64/tor-browser_en-US/Browser/TorBrowser/Data/Browser/.mozilla/native-messaging-hosts/org.keepassxc.keepassxc_browser.json
#mkfile ${HOME}/.mozilla/native-messaging-hosts/org.keepassxc.keepassxc_browser.json
#whitelist ${HOME}/.mozilla/native-messaging-hosts/org.keepassxc.keepassxc_browser.json
#mkdir ${HOME}/.cache/keepassxc
#mkdir ${HOME}/.config/keepassxc
#whitelist ${HOME}/.cache/keepassxc
#whitelist ${HOME}/.config/keepassxc
#include whitelist-common.inc
whitelist /usr/share/keepassxc
include whitelist-usr-share-common.inc
include whitelist-var-common.inc
caps.drop all
machine-id
net none
no3d
nodvd
nogroups
nonewprivs
noroot
nosound
notv
nou2f
novideo
protocol unix,netlink
seccomp !name_to_handle_at
seccomp.block-secondary
shell none
tracelog
private-bin keepassxc,keepassxc-cli,keepassxc-proxy
private-dev
private-etc alternatives,fonts,ld.so.cache,machine-id
private-tmp
dbus-user filter
#dbus-user.own org.keepassxc.KeePassXC
dbus-user.talk com.canonical.Unity.Session
dbus-user.talk org.freedesktop.ScreenSaver
dbus-user.talk org.freedesktop.login1.Manager
dbus-user.talk org.freedesktop.login1.Session
dbus-user.talk org.gnome.ScreenSaver
dbus-user.talk org.gnome.SessionManager
dbus-user.talk org.gnome.SessionManager.Presence
# Uncomment or add to your keepassxc.local to allow Notifications.
#dbus-user.talk org.freedesktop.Notifications
# Uncomment or add to your keepassxc.local to allow Tray.
#dbus-user.talk org.kde.StatusNotifierWatcher
#dbus-user.own org.kde.*
dbus-system none
# Mutex is stored in /tmp by default, which is broken by private-tmp
join-or-start keepassxc