mirror of
https://github.com/roddhjav/apparmor.d.git
synced 2024-12-25 14:36:33 +01:00
feat(abs): add the devices-usb-read abstraction.
This commit is contained in:
parent
8f904132e1
commit
d2f7ee0bb4
3 changed files with 33 additions and 17 deletions
|
@ -5,24 +5,11 @@
|
|||
|
||||
abi <abi/4.0>,
|
||||
|
||||
/dev/ r,
|
||||
/dev/bus/usb/ r,
|
||||
/dev/bus/usb/@{int}/ r,
|
||||
/dev/bus/usb/@{int}/@{int} rwk,
|
||||
include <abstractions/devices-usb-read>
|
||||
|
||||
@{sys}/class/ r,
|
||||
@{sys}/class/usbmisc/ r,
|
||||
/dev/bus/usb/@{int}/@{int} wk,
|
||||
|
||||
@{sys}/bus/ r,
|
||||
@{sys}/bus/usb/ r,
|
||||
@{sys}/bus/usb/devices/{,**} r,
|
||||
|
||||
@{sys}/devices/**/usb@{int}/{,**} rw,
|
||||
|
||||
# Udev data about usb devices (~equal to content of lsusb -v)
|
||||
@{run}/udev/data/+usb:* r,
|
||||
@{run}/udev/data/c16[6,7]:@{int} r, # USB modems
|
||||
@{run}/udev/data/c18[0,8,9]:@{int} r, # USB devices & USB serial converters
|
||||
@{sys}/devices/**/usb@{int}/{,**} w,
|
||||
|
||||
include if exists <abstractions/devices-usb.d>
|
||||
|
||||
|
|
29
apparmor.d/abstractions/devices-usb-read
Normal file
29
apparmor.d/abstractions/devices-usb-read
Normal file
|
@ -0,0 +1,29 @@
|
|||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2021 Mikhail Morfikov
|
||||
# Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/4.0>,
|
||||
|
||||
/dev/ r,
|
||||
/dev/bus/usb/ r,
|
||||
/dev/bus/usb/@{int}/ r,
|
||||
/dev/bus/usb/@{int}/@{int} r,
|
||||
|
||||
@{sys}/class/ r,
|
||||
@{sys}/class/usbmisc/ r,
|
||||
|
||||
@{sys}/bus/ r,
|
||||
@{sys}/bus/usb/ r,
|
||||
@{sys}/bus/usb/devices/{,**} r,
|
||||
|
||||
@{sys}/devices/**/usb@{int}/{,**} r,
|
||||
|
||||
# Udev data about usb devices (~equal to content of lsusb -v)
|
||||
@{run}/udev/data/+usb:* r,
|
||||
@{run}/udev/data/c16[6,7]:@{int} r, # USB modems
|
||||
@{run}/udev/data/c18[0,8,9]:@{int} r, # USB devices & USB serial converters
|
||||
|
||||
include if exists <abstractions/devices-usb-read.d>
|
||||
|
||||
# vim:syntax=apparmor
|
|
@ -11,7 +11,7 @@ include <tunables/global>
|
|||
profile lsusb @{exec_path} {
|
||||
include <abstractions/base>
|
||||
include <abstractions/consoles>
|
||||
include <abstractions/devices-usb>
|
||||
include <abstractions/devices-usb-read>
|
||||
|
||||
capability net_admin,
|
||||
|
||||
|
|
Loading…
Reference in a new issue