apparmor.d/apparmor.d/gparted

103 lines
2.3 KiB
Text
Raw Normal View History

# vim:syntax=apparmor
# ------------------------------------------------------------------
#
# Copyright (C) 2019-2020 Mikhail Morfikov
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 of the GNU General Public
# License published by the Free Software Foundation.
#
# ------------------------------------------------------------------
2020-12-10 22:33:39 +01:00
abi <abi/3.0>,
2020-12-10 22:33:39 +01:00
include <tunables/global>
@{exec_path} = /{usr/,}sbin/gparted
profile gparted @{exec_path} {
2020-12-10 22:33:39 +01:00
include <abstractions/base>
@{exec_path} r,
2020-12-09 10:30:52 +01:00
/{usr/,}bin/{,ba,da}sh rix,
2020-12-10 22:33:39 +01:00
/{usr/,}sbin/ r,
/{usr/,}sbin/gpartedbin rPx,
/{usr/,}bin/ r,
2020-12-09 10:30:52 +01:00
/{usr/,}bin/{,e}grep rix,
/{usr/,}bin/cut rix,
/{usr/,}bin/id rix,
/{usr/,}bin/sed rix,
/{usr/,}bin/mkdir rix,
/{usr/,}bin/rm rix,
/{usr/,}lib/udisks2/udisks2-inhibit rix,
/usr/libexec/udisks2/udisks2-inhibit rix,
2020-10-25 10:23:34 +01:00
@{run}/udev/rules.d/ rw,
@{run}/udev/rules.d/90-udisks-inhibit.rules rw,
/{usr/,}bin/udevadm rCx -> udevadm,
2020-12-10 22:33:39 +01:00
/{usr/,}sbin/killall5 rCx -> killall,
/{usr/,}bin/ps rPx,
/{usr/,}bin/xhost rPx,
/{usr/,}bin/pkexec rPx,
/{usr/,}bin/systemctl rPx -> child-systemctl,
2020-12-10 22:33:39 +01:00
# For shell pwd
/ r,
/root/ r,
/usr/local/bin/ r,
/usr/local/sbin/ r,
# file_inherit
owner /dev/tty[0-9]* rw,
profile udevadm {
2020-12-10 22:33:39 +01:00
include <abstractions/base>
ptrace (read),
/{usr/,}bin/udevadm mr,
/etc/udev/udev.conf r,
owner @{PROC}/@{pid}/stat r,
@{PROC}/cmdline r,
@{PROC}/1/sched r,
@{PROC}/1/environ r,
@{PROC}/sys/kernel/osrelease r,
@{PROC}/sys/kernel/random/boot_id r,
@{sys}/** r,
@{sys}/devices/virtual/block/**/uevent rw,
@{sys}/devices/pci[0-9]*/**/block/**/uevent rw,
2020-10-25 10:23:34 +01:00
@{run}/udev/data/* r,
}
2020-12-10 22:33:39 +01:00
profile killall flags=(attach_disconnected) {
include <abstractions/base>
include <abstractions/consoles>
capability sys_ptrace,
signal (send) set=(int, term, kill),
ptrace (read),
/{usr/,}sbin/killall5 mr,
# The /proc/ dir is needed to avoid the following error:
# /proc: Permission denied
@{PROC}/ r,
@{PROC}/@{pids}/stat r,
@{PROC}/@{pids}/cmdline r,
}
include if exists <local/gparted>
}