update apparmor profiles

This commit is contained in:
Mikhail Morfikov 2021-02-13 15:00:16 +01:00
parent 8e075d25fa
commit 0f64093e46
No known key found for this signature in database
GPG key ID: 32D9CB634796CCA1
96 changed files with 645 additions and 240 deletions

View file

@ -0,0 +1,30 @@
# vim:syntax=apparmor
# ------------------------------------------------------------------
#
# Copyright (C) 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>,
/dev/ r,
/dev/bus/usb/ r,
/dev/bus/usb/[0-9]*/ r,
/dev/bus/usb/[0-9]*/[0-9]* rw,
@{sys}/class/ r,
@{sys}/bus/ r,
@{sys}/bus/usb/ r,
@{sys}/bus/usb/devices/{,**} r,
@{sys}/devices/**/usb[0-9]/{,**} rw,
# Udev data about usb devices (~equal to content of lsusb -v)
@{run}/udev/data/+usb:* r,
@{run}/udev/data/c16[6,7]* r,
@{run}/udev/data/c18[0,8,9]* r,

View file

@ -20,7 +20,7 @@
/dev/sd[a-z][0-9]* rk,
@{sys}/devices/pci[0-9]*/**/block/sd[a-z]/ r,
@{sys}/devices/pci[0-9]*/**/block/sd[a-z]/** r,
@{sys}/devices/pci[0-9]*/**/{usb,ata}[1-9]/** r,
@{sys}/devices/pci[0-9]*/**/{usb,ata}[0-9]/** r,
# SD card devices
/dev/mmcblk[0-9]* rk,

View file

@ -20,7 +20,7 @@
/dev/sd[a-z][0-9]* rwk,
@{sys}/devices/pci[0-9]*/**/block/sd[a-z]/ r,
@{sys}/devices/pci[0-9]*/**/block/sd[a-z]/** r,
@{sys}/devices/pci[0-9]*/**/{usb,ata}[1-9]/** r,
@{sys}/devices/pci[0-9]*/**/{usb,ata}[0-9]/** r,
# SD card devices
/dev/mmcblk[0-9]* rwk,

View file

@ -1,4 +1,8 @@
include <abstractions/base>
#include <abstractions/base>
# Allow receiving signals from libvirtd
signal (receive) peer=libvirtd,
signal (receive) peer=/usr/sbin/libvirtd,
umount,
@ -112,3 +116,6 @@
deny /sys/fs/cgrou[^p]*{,/**} wklx,
deny /sys/fs/cgroup?*{,/**} wklx,
deny /sys/fs?*{,/**} wklx,
# Site-specific additions and overrides. See local/README for details.
#include <local/abstractions/libvirt-lxc>

View file

@ -1,6 +1,6 @@
include <abstractions/base>
include <abstractions/consoles>
include <abstractions/nameservice>
#include <abstractions/base>
#include <abstractions/consoles>
#include <abstractions/nameservice>
# required for reading disk images
capability dac_override,
@ -102,6 +102,7 @@
# the various binaries
/usr/bin/kvm rmix,
/usr/bin/kvm-spice rmix,
/usr/bin/qemu rmix,
/usr/bin/qemu-aarch64 rmix,
/usr/bin/qemu-alpha rmix,
@ -242,3 +243,6 @@
# /sys/bus/nd/devices
/ r, # harmless on any lsb compliant system
/sys/bus/nd/devices/{,**/} r,
# Site-specific additions and overrides. See local/README for details.
#include <local/abstractions/libvirt-qemu>