Skip to content

Commit

Permalink
Merge pull request netblue30#5763 from kmk3/profiles-mv-readonly
Browse files Browse the repository at this point in the history
profiles: move read-only config entries to disable-common.inc
  • Loading branch information
netblue30 committed Apr 6, 2023
2 parents a94d35c + 24f2a89 commit 92a7ad7
Show file tree
Hide file tree
Showing 24 changed files with 20 additions and 29 deletions.
15 changes: 15 additions & 0 deletions etc/inc/disable-common.inc
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ blacklist ${HOME}/.xsessionrc
blacklist /etc/X11/Xsession.d
blacklist /etc/xdg/autostart
read-only ${HOME}/.Xauthority
read-only ${HOME}/.config/awesome/autorun.sh
read-only ${HOME}/.config/openbox/autostart
read-only ${HOME}/.config/openbox/environment

# Session manager
# see #3358
Expand Down Expand Up @@ -329,6 +332,7 @@ read-only ${HOME}/.ssh/config.d
# Initialization files that allow arbitrary command execution
read-only ${HOME}/.caffrc
read-only ${HOME}/.cargo/env
read-only ${HOME}/.config/mpv
read-only ${HOME}/.config/nano
read-only ${HOME}/.config/nvim
read-only ${HOME}/.config/pkcs11
Expand All @@ -337,6 +341,7 @@ read-only ${HOME}/.elinks
read-only ${HOME}/.emacs
read-only ${HOME}/.emacs.d
read-only ${HOME}/.exrc
read-only ${HOME}/.gnupg/gpg.conf
read-only ${HOME}/.gvimrc
read-only ${HOME}/.homesick
read-only ${HOME}/.iscreenrc
Expand All @@ -345,6 +350,7 @@ read-only ${HOME}/.local/share/cool-retro-term
read-only ${HOME}/.local/share/nvim
read-only ${HOME}/.local/state/nvim
read-only ${HOME}/.mailcap
read-only ${HOME}/.mozilla/firefox/profiles.ini
read-only ${HOME}/.msmtprc
read-only ${HOME}/.mutt/muttrc
read-only ${HOME}/.muttrc
Expand All @@ -366,6 +372,10 @@ read-only ${HOME}/_gvimrc
read-only ${HOME}/_vimrc
read-only ${HOME}/dotfiles

# System package managers and AUR helpers
blacklist ${HOME}/.config/cower
read-only ${HOME}/.config/cower/config

# Make directories commonly found in $PATH read-only
read-only ${HOME}/.bin
read-only ${HOME}/.cargo/bin
Expand All @@ -391,6 +401,11 @@ read-only ${HOME}/.config/user-dirs.dirs
read-only ${HOME}/.config/user-dirs.locale
read-only ${HOME}/.local/share/mime

# Configuration files that do not allow arbitrary command execution but that
# are intended to be modified manually (in a text editor and/or by a program
# dedicated to managing them)
read-only ${HOME}/.config/MangoHud

# Write-protection for thumbnailer dir
read-only ${HOME}/.local/share/thumbnailers

Expand Down
1 change: 0 additions & 1 deletion etc/inc/disable-programs.inc
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,6 @@ blacklist ${HOME}/.config/cmus
blacklist ${HOME}/.config/cointop
blacklist ${HOME}/.config/com.github.bleakgrey.tootle
blacklist ${HOME}/.config/corebird
blacklist ${HOME}/.config/cower
blacklist ${HOME}/.config/coyim
blacklist ${HOME}/.config/d-feet
blacklist ${HOME}/.config/darktable
Expand Down
4 changes: 0 additions & 4 deletions etc/inc/whitelist-common.inc
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,12 @@ whitelist ${HOME}/.asoundrc
whitelist ${HOME}/.config/ibus
whitelist ${HOME}/.config/mimeapps.list
whitelist ${HOME}/.config/pkcs11
read-only ${HOME}/.config/pkcs11
whitelist ${HOME}/.config/user-dirs.dirs
read-only ${HOME}/.config/user-dirs.dirs
whitelist ${HOME}/.config/user-dirs.locale
read-only ${HOME}/.config/user-dirs.locale
whitelist ${HOME}/.drirc
whitelist ${HOME}/.icons
?HAS_APPIMAGE: whitelist ${HOME}/.local/share/appimagekit
whitelist ${HOME}/.local/share/applications
read-only ${HOME}/.local/share/applications
whitelist ${HOME}/.local/share/icons
whitelist ${HOME}/.local/share/mime
whitelist ${HOME}/.mime.types
Expand Down
2 changes: 0 additions & 2 deletions etc/profile-a-l/ani-cli.profile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,5 @@ private-bin ani-cli,aria2c,cat,cp,curl,cut,ffmpeg,fzf,grep,head,mkdir,mv,nl,nohu
private-etc alsa,alternatives,asound.conf,ca-certificates,crypto-policies,fonts,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,machine-id,mime.types,nsswitch.conf,pango,pki,protocols,pulse,resolv.conf,rpc,services,ssl,X11,xdg
private-tmp

read-only ${HOME}/.config/mpv

# Redirect
include mpv.profile
1 change: 0 additions & 1 deletion etc/profile-a-l/awesome.profile
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ noroot
protocol unix,inet,inet6
seccomp !chroot

read-only ${HOME}/.config/awesome/autorun.sh
#restrict-namespaces
1 change: 0 additions & 1 deletion etc/profile-a-l/cower.profile
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,4 @@ private-dev
private-tmp

memory-deny-write-execute
read-only ${HOME}/.config/cower/config
restrict-namespaces
1 change: 0 additions & 1 deletion etc/profile-a-l/electron-mail.profile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ whitelist ${HOME}/.config/electron-mail
# there isn't a Firefox instance running with the default profile; see #5352)
noblacklist ${HOME}/.mozilla
whitelist ${HOME}/.mozilla/firefox/profiles.ini
read-only ${HOME}/.mozilla/firefox/profiles.ini

machine-id
nosound
Expand Down
1 change: 0 additions & 1 deletion etc/profile-a-l/email-common.profile
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,5 @@ dbus-user.talk org.gnome.seahorse.*
dbus-user.talk org.mozilla.*
dbus-system none

read-only ${HOME}/.mozilla/firefox/profiles.ini
read-only ${HOME}/.signature
restrict-namespaces
3 changes: 3 additions & 0 deletions etc/profile-a-l/firefox.profile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ include globals.local
# https://github.com/netblue30/firejail/wiki/Frequently-Asked-Questions#how-do-i-run-two-instances-of-firefox
# https://github.com/netblue30/firejail/issues/4206#issuecomment-824806968

# (Ignore entry from disable-common.inc)
ignore read-only ${HOME}/.mozilla/firefox/profiles.ini

noblacklist ${HOME}/.cache/mozilla
noblacklist ${HOME}/.mozilla
noblacklist ${RUNUSER}/*firefox*
Expand Down
1 change: 0 additions & 1 deletion etc/profile-a-l/geary.profile
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,4 @@ dbus-user.talk org.gnome.evolution.dataserver.Sources5
dbus-user.talk org.mozilla.*
dbus-system none

read-only ${HOME}/.mozilla/firefox/profiles.ini
restrict-namespaces
1 change: 0 additions & 1 deletion etc/profile-a-l/kube.profile
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,4 @@ dbus-user.talk org.freedesktop.secrets
dbus-user.talk org.freedesktop.Notifications
dbus-system none

read-only ${HOME}/.mozilla/firefox/profiles.ini
restrict-namespaces
2 changes: 0 additions & 2 deletions etc/profile-a-l/linuxqq.profile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,5 @@ dbus-user.talk org.gnome.Mutter.IdleMonitor
dbus-user.talk org.mozilla.*
ignore dbus-user none

read-only ${HOME}/.mozilla/firefox/profiles.ini

# Redirect
include electron-common.profile
2 changes: 0 additions & 2 deletions etc/profile-a-l/lobster.profile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,5 @@ private-bin curl,cut,fzf,grep,head,lobster,mv,patch,rm,sed,sh,tail,tput,tr,uname
private-etc alsa,alternatives,asound.conf,ca-certificates,crypto-policies,fonts,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,machine-id,mime.types,nsswitch.conf,pango,pki,protocols,pulse,resolv.conf,rpc,services,ssl,X11,xdg
private-tmp

read-only ${HOME}/.config/mpv

# Redirect
include mpv.profile
1 change: 0 additions & 1 deletion etc/profile-m-z/makepkg.profile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ blacklist ${RUNUSER}/wayland-*

# Enable severely restricted access to ${HOME}/.gnupg
noblacklist ${HOME}/.gnupg
read-only ${HOME}/.gnupg/gpg.conf
read-only ${HOME}/.gnupg/trustdb.gpg
read-only ${HOME}/.gnupg/pubring.kbx
blacklist ${HOME}/.gnupg/random_seed
Expand Down
2 changes: 0 additions & 2 deletions etc/profile-m-z/mov-cli.profile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,5 @@ private-bin ffmpeg,fzf,mov-cli
private-etc alsa,alternatives,asound.conf,ca-certificates,crypto-policies,fonts,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,machine-id,mime.types,nsswitch.conf,pango,pki,protocols,pulse,resolv.conf,rpc,services,ssl,X11,xdg
private-tmp

read-only ${HOME}/.config/mpv

# Redirect
include mpv.profile
2 changes: 0 additions & 2 deletions etc/profile-m-z/openbox.profile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,4 @@ noroot
protocol unix,inet,inet6
seccomp !chroot

read-only ${HOME}/.config/openbox/autostart
read-only ${HOME}/.config/openbox/environment
#restrict-namespaces
1 change: 0 additions & 1 deletion etc/profile-m-z/signal-desktop.profile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ noblacklist ${HOME}/.config/Signal
# These lines are needed to allow Firefox to open links
noblacklist ${HOME}/.mozilla
whitelist ${HOME}/.mozilla/firefox/profiles.ini
read-only ${HOME}/.mozilla/firefox/profiles.ini

mkdir ${HOME}/.config/Signal
whitelist ${HOME}/.config/Signal
Expand Down
1 change: 0 additions & 1 deletion etc/profile-m-z/steam.profile
Original file line number Diff line number Diff line change
Expand Up @@ -181,5 +181,4 @@ private-tmp
#dbus-user none
#dbus-system none

read-only ${HOME}/.config/MangoHud
#restrict-namespaces
1 change: 0 additions & 1 deletion etc/profile-m-z/thunderbird.profile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ writable-run-user
# These lines are needed to allow Firefox to load your profile when clicking a link in an email
noblacklist ${HOME}/.mozilla
whitelist ${HOME}/.mozilla/firefox/profiles.ini
read-only ${HOME}/.mozilla/firefox/profiles.ini

noblacklist ${HOME}/.cache/thunderbird
noblacklist ${HOME}/.gnupg
Expand Down
1 change: 0 additions & 1 deletion etc/profile-m-z/trojita.profile
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,4 @@ dbus-user filter
dbus-user.talk org.freedesktop.secrets
dbus-system none

read-only ${HOME}/.mozilla/firefox/profiles.ini
restrict-namespaces
1 change: 0 additions & 1 deletion etc/profile-m-z/tutanota-desktop.profile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ whitelist ${HOME}/.config/tutanota-desktop
# there isn't a Firefox instance running with the default profile; see #5352)
noblacklist ${HOME}/.mozilla
whitelist ${HOME}/.mozilla/firefox/profiles.ini
read-only ${HOME}/.mozilla/firefox/profiles.ini

machine-id
nosound
Expand Down
1 change: 0 additions & 1 deletion etc/profile-m-z/youtube-viewers-common.profile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ include allow-python3.inc
# there isn't a Firefox instance running with the default profile; see #5352)
noblacklist ${HOME}/.mozilla
whitelist ${HOME}/.mozilla/firefox/profiles.ini
read-only ${HOME}/.mozilla/firefox/profiles.ini

include disable-common.inc
include disable-devel.inc
Expand Down
1 change: 0 additions & 1 deletion etc/profile-m-z/zeal.profile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ include disable-xdg.inc
# This also requires dbus-user filtering (see below).
noblacklist ${HOME}/.mozilla
whitelist ${HOME}/.mozilla/firefox/profiles.ini
read-only ${HOME}/.mozilla/firefox/profiles.ini

mkdir ${HOME}/.cache/Zeal
mkdir ${HOME}/.config/Zeal
Expand Down
2 changes: 2 additions & 0 deletions etc/templates/profile.template
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ include globals.local
#dbus-user.talk org.freedesktop.Notifications
#dbus-system none

# Note: read-only entries should usually go in disable-common.inc (especially
# entries for configuration files that allow arbitrary command execution).
##deterministic-shutdown
##env VAR=VALUE
##join-or-start NAME
Expand Down

0 comments on commit 92a7ad7

Please sign in to comment.