feat(profile): add profile for yacreader.

This commit is contained in:
Alexandre Pujol 2024-03-12 16:06:24 +00:00
parent 467c38724a
commit 3bb5ea72df
No known key found for this signature in database
GPG Key ID: C5469996F0DF68EC
2 changed files with 101 additions and 0 deletions

View File

@ -0,0 +1,51 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = @{bin}/YACReader
profile YACReader @{exec_path} flags=(attach_disconnected,mediate_deleted) {
include <abstractions/base>
include <abstractions/dconf-write>
include <abstractions/desktop>
include <abstractions/graphics>
include <abstractions/nameservice-strict>
include <abstractions/qt5-settings-write>
include <abstractions/qt5-shader-cache>
include <abstractions/ssl_certs>
network inet dgram,
network inet6 dgram,
network inet stream,
network inet6 stream,
network netlink raw,
@{exec_path} mr,
/usr/share/yacreader/{,**} r,
/etc/machine-id r,
owner @{user_books_dirs}/{,**} r,
owner @{user_share_dirs}/YACReader/ rw,
owner @{user_share_dirs}/YACReader/* r,
owner @{user_share_dirs}/YACReader/YACReader/ rw,
owner @{user_share_dirs}/YACReader/YACReader/** rwlk,
owner @{user_config_dirs}/pulse/client.conf r,
owner @{user_config_dirs}/pulse/cookie rk,
owner @{run}/user/@{uid}/pulse/ r,
/dev/shm/ r,
@{PROC}/sys/kernel/random/boot_id r,
owner @{PROC}/@{pid}/cmdline r,
owner @{PROC}/@{pid}/mountinfo r,
include if exists <local/YACReader>
}

View File

@ -0,0 +1,50 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = @{bin}/YACReaderLibrary
profile YACReaderLibrary @{exec_path} flags=(attach_disconnected,mediate_deleted) {
include <abstractions/base>
include <abstractions/bus-accessibility>
include <abstractions/dconf-write>
include <abstractions/desktop>
include <abstractions/graphics>
include <abstractions/nameservice-strict>
include <abstractions/qt5-shader-cache>
network inet stream,
network inet6 stream,
network netlink dgram,
@{exec_path} mr,
@{bin}/YACReader rPx,
@{open_path} rPx -> child-open,
/usr/share/yacreader/{,**} r,
/etc/machine-id r,
owner @{user_books_dirs}/{,**} r,
owner @{user_books_dirs}/**/.yacreaderlibrary/{,**} rwk,
owner @{user_cache_dirs}/YACReader/ rw,
owner @{user_cache_dirs}/YACReader/YACReaderLibrary/ rw,
owner @{user_cache_dirs}/YACReader/YACReaderLibrary/** rwlk,
owner @{user_share_dirs}/YACReader/ rw,
owner @{user_share_dirs}/YACReader/* r,
owner @{user_share_dirs}/YACReader/YACReaderLibrary/ rw,
owner @{user_share_dirs}/YACReader/YACReaderLibrary/** rwlk,
owner /tmp/@{uuid} w,
@{PROC}/sys/kernel/random/boot_id r,
owner @{PROC}/@{pid}/cmdline r,
include if exists <local/YACReaderLibrary>
}