apparmor.d -> profiles
This commit is contained in:
parent
c408a878b7
commit
e9b8e62fcd
726 changed files with 0 additions and 0 deletions
94
profiles/apt-cdrom
Normal file
94
profiles/apt-cdrom
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
# vim:syntax=apparmor
|
||||
# ------------------------------------------------------------------
|
||||
#
|
||||
# Copyright (C) 2019-2021 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.
|
||||
#
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
abi <abi/3.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = /{usr/,}bin/apt-cdrom
|
||||
profile apt-cdrom @{exec_path} flags=(complain) {
|
||||
include <abstractions/base>
|
||||
include <abstractions/nameservice-strict>
|
||||
include <abstractions/apt-common>
|
||||
|
||||
capability dac_read_search,
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
/{usr/,}bin/dpkg rPx -> child-dpkg,
|
||||
|
||||
/{usr/,}bin/mount rCx -> mount,
|
||||
/{usr/,}bin/umount rCx -> umount,
|
||||
|
||||
# Are all of these needed? (#FIXME#)
|
||||
@{sys}/bus/ r,
|
||||
@{sys}/bus/*/devices/ r,
|
||||
@{sys}/class/ r,
|
||||
@{sys}/class/*/ r,
|
||||
@{sys}/devices/**/uevent r,
|
||||
@{run}/udev/data/* r,
|
||||
|
||||
/etc/fstab r,
|
||||
|
||||
# For cd-roms
|
||||
/media/cdrom[0-9]/ r,
|
||||
/media/cdrom[0-9]/**/ r,
|
||||
/media/cdrom[0-9]/.disk/info r,
|
||||
/media/cdrom[0-9]/dists/**/binary-*/Packages{,.gz} r,
|
||||
/media/cdrom[0-9]/dists/**/i18n/Translation-en{,.gz} r,
|
||||
|
||||
# For pendrives
|
||||
/media/*/*/ r,
|
||||
/media/*/*/**/ r,
|
||||
/media/*/*/.disk/info r,
|
||||
/media/*/*/dists/**/binary-*/Packages{,.gz} r,
|
||||
/media/*/*/dists/**/i18n/Translation-en{,.gz} r,
|
||||
|
||||
/var/lib/apt/lists/** rw,
|
||||
|
||||
owner @{PROC}/@{pid}/fd/ r,
|
||||
|
||||
/var/lib/apt/cdroms.list{,.new} rw,
|
||||
/var/lib/apt/cdroms.list~ w,
|
||||
|
||||
/etc/apt/sources.list{,.new} rw,
|
||||
/etc/apt/sources.list~ w,
|
||||
|
||||
profile mount flags=(complain) {
|
||||
include <abstractions/base>
|
||||
|
||||
/{usr/,}bin/mount mr,
|
||||
|
||||
/etc/fstab r,
|
||||
|
||||
/media/cdrom[0-9]/ r,
|
||||
|
||||
}
|
||||
|
||||
profile umount flags=(complain) {
|
||||
include <abstractions/base>
|
||||
|
||||
capability sys_admin,
|
||||
|
||||
/{usr/,}bin/umount mr,
|
||||
|
||||
@{run}/mount/utab{,.*} rw,
|
||||
@{run}/mount/utab.lock rwk,
|
||||
|
||||
owner @{PROC}/@{pid}/mountinfo r,
|
||||
|
||||
umount /media/*/,
|
||||
umount /media/*/*/,
|
||||
|
||||
}
|
||||
|
||||
include if exists <local/apt-cdrom>
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue