feat(profile): update profile with dbus-send.
This commit is contained in:
parent
64c2ee5fe9
commit
0fdf514418
5 changed files with 96 additions and 219 deletions
|
|
@ -10,43 +10,31 @@ include <tunables/global>
|
|||
@{exec_path} = @{bin}/gsmartcontrol
|
||||
profile gsmartcontrol @{exec_path} {
|
||||
include <abstractions/base>
|
||||
include <abstractions/gtk>
|
||||
include <abstractions/fonts>
|
||||
include <abstractions/fontconfig-cache-read>
|
||||
include <abstractions/freedesktop.org>
|
||||
include <abstractions/desktop>
|
||||
include <abstractions/nameservice-strict>
|
||||
|
||||
capability dac_read_search,
|
||||
|
||||
# Needed?
|
||||
deny capability sys_nice,
|
||||
capability sys_nice,
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
@{bin}/smartctl rPx,
|
||||
@{bin}/xterm rCx -> terminal,
|
||||
@{bin}/dbus-launch Cx -> bus,
|
||||
@{bin}/dbus-send Cx -> bus,
|
||||
@{bin}/smartctl Px,
|
||||
@{bin}/xterm Cx -> terminal,
|
||||
|
||||
# When gsmartcontrol is run as root, it wants to exec dbus-launch, and hence it creates the two
|
||||
# following root processes:
|
||||
# dbus-launch --autolaunch e0a30ad97cd6421c85247839ccef9db2 --binary-syntax --close-stderr
|
||||
# /usr/bin/dbus-daemon --syslog-only --fork --print-pid 5 --print-address 7 --session
|
||||
#
|
||||
# Should this be allowed? Gsmartcontrol works fine without this.
|
||||
#@{bin}/dbus-launch rCx -> dbus,
|
||||
#@{bin}/dbus-send rCx -> dbus,
|
||||
deny @{bin}/dbus-launch rx,
|
||||
deny @{bin}/dbus-send rx,
|
||||
/etc/fstab r,
|
||||
|
||||
owner @{user_config_dirs}/gsmartcontrol/ rw,
|
||||
owner @{user_config_dirs}/gsmartcontrol/gsmartcontrol.conf rw,
|
||||
|
||||
# As it's started as root
|
||||
@{HOME}/.Xauthority r,
|
||||
/var/lib/dbus/machine-id r,
|
||||
/etc/machine-id r,
|
||||
|
||||
# For saving SMART raport
|
||||
owner /root/ r,
|
||||
owner /root/**.txt w,
|
||||
|
||||
owner @{user_config_dirs}/gsmartcontrol/ rw,
|
||||
owner @{user_config_dirs}/gsmartcontrol/** rw,
|
||||
|
||||
owner @{PROC}/@{pid}/fd/ r,
|
||||
owner @{PROC}/@{pid}/mountinfo r,
|
||||
owner @{PROC}/@{pid}/mounts r,
|
||||
|
|
@ -55,57 +43,37 @@ profile gsmartcontrol @{exec_path} {
|
|||
owner @{PROC}/scsi/scsi r,
|
||||
owner @{PROC}/scsi/sg/devices r,
|
||||
|
||||
/etc/fstab r,
|
||||
|
||||
/var/lib/dbus/machine-id r,
|
||||
/etc/machine-id r,
|
||||
|
||||
# The Help menu (and links in it) requires access to a web browser. Since gsmartcontrol is run as
|
||||
# root (even when used sudo or gsmartcontrol-root), the web browser will also be run as root and
|
||||
# hence this behavior should be blocked.
|
||||
deny @{lib}/@{multiarch}/glib-@{version}/gio-launch-desktop rx,
|
||||
deny @{open_path} rx,
|
||||
|
||||
|
||||
profile dbus {
|
||||
profile bus flags=(complain) {
|
||||
include <abstractions/base>
|
||||
include <abstractions/nameservice-strict>
|
||||
include <abstractions/app/bus>
|
||||
|
||||
@{bin}/dbus-launch mr,
|
||||
@{bin}/dbus-send mr,
|
||||
@{bin}/dbus-daemon rPUx,
|
||||
|
||||
# for dbus-launch
|
||||
owner @{HOME}/.dbus/session-bus/@{hex}-[0-9] w,
|
||||
|
||||
@{HOME}/.Xauthority r,
|
||||
include if exists <local/gsmartcontrol_bus>
|
||||
}
|
||||
|
||||
profile terminal {
|
||||
include <abstractions/base>
|
||||
include <abstractions/consoles>
|
||||
include <abstractions/desktop>
|
||||
include <abstractions/nameservice-strict>
|
||||
include <abstractions/freedesktop.org>
|
||||
include <abstractions/shells>
|
||||
|
||||
capability setuid,
|
||||
capability setgid,
|
||||
capability fsetid,
|
||||
capability setgid,
|
||||
capability setuid,
|
||||
|
||||
@{bin}/xterm mr,
|
||||
|
||||
/usr/sbin/update-smart-drivedb rPx,
|
||||
|
||||
owner @{HOME}/.Xauthority r,
|
||||
|
||||
/etc/shells r,
|
||||
|
||||
/etc/X11/app-defaults/XTerm-color r,
|
||||
/etc/X11/app-defaults/XTerm r,
|
||||
/etc/X11/cursors/*.theme r,
|
||||
@{bin}/update-smart-drivedb rPx,
|
||||
|
||||
/usr/include/X11/bitmaps/vlines2 r,
|
||||
|
||||
/dev/ptmx rw,
|
||||
|
||||
include if exists <local/gsmartcontrol_terminal>
|
||||
}
|
||||
|
||||
include if exists <local/gsmartcontrol>
|
||||
|
|
|
|||
|
|
@ -10,59 +10,31 @@ include <tunables/global>
|
|||
@{exec_path} = @{bin}/lxappearance
|
||||
profile lxappearance @{exec_path} {
|
||||
include <abstractions/base>
|
||||
include <abstractions/gtk>
|
||||
include <abstractions/fonts>
|
||||
include <abstractions/fontconfig-cache-read>
|
||||
include <abstractions/freedesktop.org>
|
||||
include <abstractions/desktop>
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
# When lxappearance is run as root, it wants to exec dbus-launch, and hence it creates the two
|
||||
# following root processes:
|
||||
# dbus-launch --autolaunch e0a30ad97cd6421c85247839ccef9db2 --binary-syntax --close-stderr
|
||||
# /usr/bin/dbus-daemon --syslog-only --fork --print-pid 5 --print-address 7 --session
|
||||
#
|
||||
# Should this be allowed? Lxappearance works fine without this.
|
||||
#@{bin}/dbus-launch rCx -> dbus,
|
||||
#@{bin}/dbus-send rCx -> dbus,
|
||||
deny @{bin}/dbus-launch rx,
|
||||
deny @{bin}/dbus-send rx,
|
||||
@{bin}/dbus-launch Cx -> bus,
|
||||
@{bin}/dbus-send Cx -> bus,
|
||||
|
||||
/usr/share/lxappearance/{,**} r,
|
||||
|
||||
owner @{HOME}/.themes/{,**} r,
|
||||
owner @{HOME}/.icons/{,**} rw,
|
||||
|
||||
owner @{HOME}/.gtkrc-2.0{,.*} rw,
|
||||
owner @{user_config_dirs}/gtk-3.0/settings.ini{,.*} rw,
|
||||
|
||||
/etc/X11/cursors/*.theme r,
|
||||
|
||||
owner @{PROC}/@{pid}/fd/ r,
|
||||
owner @{PROC}/@{pid}/mountinfo r,
|
||||
owner @{PROC}/@{pid}/mounts r,
|
||||
|
||||
/etc/fstab r,
|
||||
|
||||
/etc/machine-id r,
|
||||
/var/lib/dbus/machine-id r,
|
||||
|
||||
# file_inherit
|
||||
owner @{PROC}/@{pid}/fd/ r,
|
||||
owner @{PROC}/@{pid}/mountinfo r,
|
||||
owner @{PROC}/@{pid}/mounts r,
|
||||
|
||||
owner /dev/tty@{int} rw,
|
||||
|
||||
|
||||
profile dbus {
|
||||
profile bus {
|
||||
include <abstractions/base>
|
||||
include <abstractions/nameservice-strict>
|
||||
include <abstractions/app/bus>
|
||||
|
||||
@{bin}/dbus-launch mr,
|
||||
@{bin}/dbus-send mr,
|
||||
@{bin}/dbus-daemon rPUx,
|
||||
|
||||
# for dbus-launch
|
||||
owner @{HOME}/.dbus/session-bus/@{hex}-[0-9] w,
|
||||
|
||||
@{HOME}/.Xauthority r,
|
||||
include if exists <local/lxappearance_bus>
|
||||
}
|
||||
|
||||
include if exists <local/lxappearance>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue