2020-09-12 17:19:23 +02:00
|
|
|
# vim:syntax=apparmor
|
|
|
|
# ------------------------------------------------------------------
|
|
|
|
#
|
2021-01-10 16:35:07 +01:00
|
|
|
# Copyright (C) 2019-2021 Mikhail Morfikov
|
2020-09-12 17:19:23 +02:00
|
|
|
#
|
|
|
|
# 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-09-12 17:19:23 +02:00
|
|
|
|
2020-12-10 22:33:39 +01:00
|
|
|
include <tunables/global>
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
@{exec_path} = /{usr/,}sbin/parted
|
|
|
|
profile parted @{exec_path} {
|
2020-12-10 22:33:39 +01:00
|
|
|
include <abstractions/base>
|
|
|
|
include <abstractions/disks-write>
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
# Needed to inform the system of newly created/removed partitions
|
|
|
|
# ioctl(3, BLKRRPART) = -1 EACCES (Permission denied)
|
|
|
|
#
|
|
|
|
# Error: Partition(s) * on /dev/sd* have been written, but we have been unable to inform the
|
|
|
|
# kernel of the change, probably because it/they are in use. As a result, the old partition(s)
|
|
|
|
# will remain in use. You should reboot now before making further changes.
|
|
|
|
capability sys_admin,
|
|
|
|
|
|
|
|
# Needed? (#FIXME#)
|
|
|
|
capability sys_rawio,
|
|
|
|
|
|
|
|
# Needed?
|
|
|
|
ptrace (read),
|
|
|
|
|
|
|
|
@{exec_path} mr,
|
|
|
|
|
2020-12-09 10:30:52 +01:00
|
|
|
/{usr/,}bin/{,ba,da}sh rix,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
/{usr/,}bin/udevadm rCx -> udevadm,
|
|
|
|
|
|
|
|
/{usr/,}sbin/dmidecode rPx,
|
|
|
|
|
|
|
|
owner @{PROC}/@{pid}/mounts r,
|
|
|
|
@{PROC}/swaps r,
|
|
|
|
@{PROC}/devices r,
|
|
|
|
|
|
|
|
/dev/mapper/ r,
|
|
|
|
/dev/mapper/control rw,
|
|
|
|
|
|
|
|
/etc/inputrc r,
|
|
|
|
|
|
|
|
# Image files
|
|
|
|
owner @{HOME}/**.{iso,img,bin,mdf,nrg} rwk,
|
|
|
|
owner /media/*/**.{iso,img,bin,mdf,nrg} rwk,
|
|
|
|
owner @{HOME}/**.{ISO,IMG,BIN,MDF,NRG} rwk,
|
|
|
|
owner /media/*/**.{ISO,IMG,BIN,MDF,NRG} rwk,
|
|
|
|
|
|
|
|
|
|
|
|
profile udevadm {
|
2020-12-10 22:33:39 +01:00
|
|
|
include <abstractions/base>
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
ptrace (read),
|
|
|
|
|
|
|
|
/{usr/,}bin/udevadm mr,
|
|
|
|
|
|
|
|
/etc/udev/udev.conf r,
|
|
|
|
|
|
|
|
owner @{PROC}/@{pid}/stat r,
|
|
|
|
owner @{PROC}/@{pid}/cgroup r,
|
|
|
|
@{PROC}/cmdline r,
|
|
|
|
@{PROC}/1/sched r,
|
|
|
|
@{PROC}/1/environ r,
|
|
|
|
@{PROC}/1/cgroup r,
|
|
|
|
@{PROC}/sys/kernel/osrelease r,
|
|
|
|
@{PROC}/sys/kernel/random/boot_id r,
|
|
|
|
|
|
|
|
# file_inherit
|
2020-12-10 22:33:39 +01:00
|
|
|
include <abstractions/disks-write> # lots of files in this abstraction get inherited
|
2020-09-12 17:19:23 +02:00
|
|
|
owner @{HOME}/**.{iso,img,bin,mdf,nrg} rwk,
|
|
|
|
owner /media/*/**.{iso,img,bin,mdf,nrg} rwk,
|
|
|
|
owner @{HOME}/**.{ISO,IMG,BIN,MDF,NRG} rwk,
|
|
|
|
owner /media/*/**.{ISO,IMG,BIN,MDF,NRG} rwk,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2020-12-10 22:33:39 +01:00
|
|
|
include if exists <local/parted>
|
2020-09-12 17:19:23 +02:00
|
|
|
}
|