feat(profiles): improve opensuse integration.

See:  #208
This commit is contained in:
Alexandre Pujol 2023-09-05 16:53:50 +01:00
parent 155ef6bef1
commit 9a614a3502
Failed to generate hash of commit
7 changed files with 33 additions and 23 deletions

View file

@ -7,7 +7,7 @@ abi <abi/3.0>,
include <tunables/global> include <tunables/global>
@{exec_path} = @{bin}/gpg @{exec_path} = @{bin}/gpg{,2}
profile gpg @{exec_path} { profile gpg @{exec_path} {
include <abstractions/base> include <abstractions/base>
include <abstractions/consoles> include <abstractions/consoles>

View file

@ -16,6 +16,8 @@ profile gpgsm @{exec_path} {
@{exec_path} mr, @{exec_path} mr,
@{bin}/dirmngr rPx,
/usr/share/gnupg/* r, /usr/share/gnupg/* r,
/etc/gcrypt/hwf.deny r, /etc/gcrypt/hwf.deny r,

View file

@ -13,6 +13,7 @@ profile kactivitymanagerd @{exec_path} {
include <abstractions/nameservice-strict> include <abstractions/nameservice-strict>
include <abstractions/qt5> include <abstractions/qt5>
include <abstractions/recent-documents-write> include <abstractions/recent-documents-write>
include <abstractions/user-read>
include <abstractions/wayland> include <abstractions/wayland>
include <abstractions/X-strict> include <abstractions/X-strict>

View file

@ -54,6 +54,9 @@ profile kalendarac @{exec_path} {
owner @{run}/user/@{uid}/pulse/ r, owner @{run}/user/@{uid}/pulse/ r,
owner @{run}/user/@{uid}/xauth_@{rand6} rl, owner @{run}/user/@{uid}/xauth_@{rand6} rl,
@{sys}/devices/system/node/ r,
@{sys}/devices/system/node/node@{int}/meminfo r,
@{PROC}/sys/kernel/core_pattern r, @{PROC}/sys/kernel/core_pattern r,
/dev/tty r, /dev/tty r,

View file

@ -119,8 +119,8 @@ profile kded5 @{exec_path} {
@{run}/mount/utab r, @{run}/mount/utab r,
@{run}/udev/data/c189:@{int} r, # for /dev/bus/usb/** @{run}/udev/data/c189:@{int} r, # for /dev/bus/usb/**
@{run}/user/@{uid}/gvfs/ r,
owner @{run}/user/@{uid}/#@{int} rw, owner @{run}/user/@{uid}/#@{int} rw,
owner @{run}/user/@{uid}/gvfs/ r,
owner @{run}/user/@{uid}/kded5*kioworker.socket rwl, owner @{run}/user/@{uid}/kded5*kioworker.socket rwl,
owner /tmp/plasma-csd-generator.@{rand6}/{,**} rw, owner /tmp/plasma-csd-generator.@{rand6}/{,**} rw,

View file

@ -2,6 +2,8 @@
# Copyright (C) 2021 Alexandre Pujol <alexandre@pujol.io> # Copyright (C) 2021 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only # SPDX-License-Identifier: GPL-2.0-only
# TODO: rethink how the scripts should be managed
abi <abi/3.0>, abi <abi/3.0>,
include <tunables/global> include <tunables/global>
@ -12,7 +14,9 @@ profile nm-dispatcher @{exec_path} flags=(attach_disconnected) {
include <abstractions/dbus-strict> include <abstractions/dbus-strict>
include <abstractions/nameservice-strict> include <abstractions/nameservice-strict>
capability net_admin,
capability sys_nice, capability sys_nice,
capability sys_ptrace,
dbus send bus=system path=/org/freedesktop/DBus dbus send bus=system path=/org/freedesktop/DBus
interface=org.freedesktop.DBus interface=org.freedesktop.DBus
@ -41,13 +45,13 @@ profile nm-dispatcher @{exec_path} flags=(attach_disconnected) {
@{bin}/rm rix, @{bin}/rm rix,
@{bin}/run-parts rCx -> run-parts, @{bin}/run-parts rCx -> run-parts,
@{bin}/sed rix, @{bin}/sed rix,
@{bin}/systemctl rPx -> child-systemctl, @{bin}/systemctl rix,
@{bin}/systemd-cat rPx, @{bin}/systemd-cat rPx,
@{bin}/tr rix, @{bin}/tr rix,
/usr/share/tlp/tlp-readconfs rPUx, /usr/share/tlp/tlp-readconfs rPUx,
@{lib}/NetworkManager/dispatcher.d/ r, @{lib}/NetworkManager/dispatcher.d/ r,
@{lib}/NetworkManager/dispatcher.d/* rix, @{lib}/NetworkManager/dispatcher.d/** rix,
/etc/NetworkManager/dispatcher.d/ r, /etc/NetworkManager/dispatcher.d/ r,
/etc/NetworkManager/dispatcher.d/** rix, /etc/NetworkManager/dispatcher.d/** rix,
@ -71,7 +75,10 @@ profile nm-dispatcher @{exec_path} flags=(attach_disconnected) {
/{usr/,}bin/run-parts mr, /{usr/,}bin/run-parts mr,
include if exists <local/anacron_run_parts> /etc/network/if-*.d/ r,
/etc/network/if-*.d/* rPUx,
include if exists <local/anacron_run_parts>
} }
include if exists <local/nm-dispatcher> include if exists <local/nm-dispatcher>

View file

@ -1,6 +1,7 @@
# apparmor.d - Full set of apparmor profiles # apparmor.d - Full set of apparmor profiles
# Copyright (C) 2018-2021 Mikhail Morfikov # Copyright (C) 2018-2021 Mikhail Morfikov
# Copyright (C) 2022 Jeroen Rijken # Copyright (C) 2022 Jeroen Rijken
# Copyright (C) 2021-2023 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only # SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>, abi <abi/3.0>,
@ -13,46 +14,42 @@ profile smartd @{exec_path} {
include <abstractions/disks-read> include <abstractions/disks-read>
include <abstractions/nameservice-strict> include <abstractions/nameservice-strict>
# To remove the following errors:
# Device: /dev/disk/by-id/ata-*, IE (SMART) not enabled, skip device
# Try 'smartctl -s on /dev/disk/by-id/ata-*' to turn on SMART features
# Unable to register SCSI device /dev/disk/by-id/ata-* at line * of file /etc/smartd.conf
# Device: /dev/disk/by-id/ata-*, not available
capability sys_rawio, capability sys_rawio,
capability sys_admin, capability sys_admin,
# Needed? # Needed?
deny capability net_admin, audit capability net_admin,
@{exec_path} mr, @{exec_path} mr,
@{bin}/{,ba,da}sh rix, @{bin}/{,ba,da}sh rix,
@{bin}/cat rix, @{bin}/cat rix,
@{bin}/hostname rix, @{bin}/hostname rix,
@{bin}/mail rix, @{bin}/mail rix,
@{bin}/mktemp rix, @{bin}/mktemp rix,
@{bin}/run-parts rix, @{bin}/run-parts rix,
/usr/share/smartmontools/{smartd-runner,smartd_warning.sh} rix,
/etc/smartmontools/run.d/* rix,
/etc/smartmontools/run.d/* rix,
/usr/share/smartmontools/{smartd-runner,smartd_warning.sh} rix,
/etc/smart_drivedb.h r,
/etc/smartd.conf r, /etc/smartd.conf r,
/etc/smartmontools/smartd_warning.d/{,*} r,
/usr/share/smartmontools/drivedb.h r,
/var/lib/smartmontools/drivedb/drivedb.h r,
/var/lib/smartmontools/smartd.*.state{,~} rw, /var/lib/smartmontools/smartd.*.state{,~} rw,
/var/lib/smartmontools/attrlog.*.csv rw, /var/lib/smartmontools/attrlog.*.csv rw,
# Plugin directory for smartd warning script /tmp/tmp.* rw,
/etc/smartmontools/smartd_warning.d/ r,
# Drive database location @{run}/systemd/notify rw,
/usr/share/smartmontools/drivedb.h r,
/var/lib/smartmontools/drivedb/drivedb.h r, @{sys}/class/scsi_host/ r,
/etc/smart_drivedb.h r,
# Needed when smartd-runner scans for drives
/dev/ r,
@{PROC}/devices r, @{PROC}/devices r,
/run/systemd/notify rw, /dev/ r,
/tmp/tmp.* rw,
include if exists <local/smartd> include if exists <local/smartd>
} }