feat(profiles): general update.

This commit is contained in:
Alexandre Pujol 2023-09-01 22:50:43 +01:00
parent 0c151259d2
commit b2fa7bacb8
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
19 changed files with 108 additions and 72 deletions

View file

@ -12,5 +12,14 @@ profile snap-failure @{exec_path} {
@{exec_path} mr,
@{bin}/systemctl rCx -> child-systemctl,
/snap/snapd/@{int}@{lib}/snapd/snapd rPx,
/var/lib/snapd/sequence/snapd.json r,
@{sys}/kernel/mm/transparent_hugepage/hpage_pmd_size r,
@{PROC}/cmdline r,
include if exists <local/snap-failure>
}

View file

@ -20,6 +20,9 @@ profile w @{exec_path} {
@{exec_path} mr,
@{sys}/devices/system/node/ r,
@{sys}/devices/system/node/node@{int}/meminfo r,
@{PROC}/ r,
@{PROC}/uptime r,
@{PROC}/sys/kernel/osrelease r,

View file

@ -8,36 +8,35 @@ abi <abi/3.0>,
include <tunables/global>
@{exec_path} = @{bin}/whereis
profile whereis @{exec_path} flags=(complain) {
profile whereis @{exec_path} {
include <abstractions/base>
include <abstractions/consoles>
@{exec_path} mr,
/{usr/,}{local/,}{s,}bin/{,*/} r,
/{usr/,}{local/,}games/ r,
@{lib}/go-*/bin/ r,
@{bin}/{,*/} r,
@{lib}/ r,
/usr/{local/,}{,etc/,lib/} r,
@{lib}/go-*/bin/ r,
/usr/{local/,}games/ r,
/usr/include/ r,
/usr/local/{,etc/,lib/} r,
/usr/local/{s,}bin/{,*/} r,
/usr/share/ r,
/usr/share/info/{**,} r,
/usr/share/man/{**,} r,
/usr/src/{**,} r,
/etc/ r,
/opt/ r,
/opt/cni/bin/ r,
/opt/containerd/bin/ r,
/etc/ r,
/snap/bin/ r,
/var/lib/flatpak/exports/bin/ r,
owner @{HOME}/.krew/bin/ r,
owner @{HOME}/{.,}go/bin/ r,
owner @{HOME}/{.local/,}{.,}bin/ r,
owner @{user_bin_dirs}/ r,
include if exists <local/whereis>
}

View file

@ -1,5 +1,6 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2022 Jeroen Rijken
# Copyright (C) 2023 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
@ -15,18 +16,22 @@ profile which @{exec_path} {
@{bin}/{,ba,da}sh rix,
/{usr/,}{local/,}{s,}bin/ r,
@{bin}/{,*/} r,
@{lib}/ r,
@{lib}/go-*/bin/ r,
/{usr/,}{local/,}games/ r,
/usr/{local/,}games/ r,
/usr/include/ r,
/usr/local/{,etc/,lib/} r,
/usr/local/{s,}bin/{,*/} r,
/opt/cni/bin/ r,
/opt/containerd/bin/ r,
/snap/bin/ r,
/var/lib/flatpak/exports/bin/ r,
owner @{HOME}/{.local/,}/{.,}bin/ r,
owner @{HOME}/.krew/bin/ r,
owner @{HOME}/go/bin/ r,
owner @{HOME}/{.,}go/bin/ r,
owner @{user_bin_dirs}/ r,
deny @{user_share_dirs}/gvfs-metadata/* r,

View file

@ -16,7 +16,7 @@ profile whiptail @{exec_path} flags=(complain) {
@{exec_path} mr,
/etc/newt/palette.ubuntu r,
/etc/newt/palette.* r,
owner /tmp/gpm* w,

View file

@ -1,5 +1,6 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2017-2021 Mikhail Morfikov
# Copyright (C) 2023 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
@ -10,23 +11,24 @@ include <tunables/global>
profile x11-xsession @{exec_path} {
include <abstractions/base>
include <abstractions/nameservice-strict>
include <abstractions/X-strict>
@{exec_path} r,
@{bin}/{,ba,da}sh rix,
@{bin}/rm rix,
@{bin}/touch rix,
@{bin}/{,ba,da}sh rix,
@{bin}/{,e}grep rix,
@{bin}/{m,g,}awk rix,
@{bin}/cat rix,
@{bin}/which{,.debianutils} rix,
@{bin}/id rix,
@{bin}/chmod rix,
@{bin}/date rix,
@{bin}/{m,g,}awk rix,
@{bin}/tempfile rix,
@{bin}/sed rix,
@{bin}/head rix,
@{bin}/fold rix,
@{bin}/head rix,
@{bin}/id rix,
@{bin}/rm rix,
@{bin}/sed rix,
@{bin}/tempfile rix,
@{bin}/touch rix,
@{bin}/which{,.debianutils} rix,
@{bin}/dbus-update-activation-environment rCx -> dbus,
@ -41,36 +43,29 @@ profile x11-xsession @{exec_path} {
@{bin}/glxinfo rPx,
# Allowed GUI sessions to start
@{bin}/openbox-session rPx,
@{bin}/enlightenment_start rPUx,
@{bin}/sway rPUx,
@{bin}/ssh-agent rPx,
owner /tmp/file* rw,
@{bin}/openbox-session rPx,
@{bin}/enlightenment_start rPUx,
@{bin}/sway rPUx,
@{bin}/ssh-agent rPx,
/etc/default/{,*} r,
/etc/X11/{,**} r,
owner @{HOME}/.Xauthority r,
# Xsession logs
owner @{HOME}/.xsession-errors w,
owner /tmp/file* rw,
profile run-parts {
include <abstractions/base>
@{bin}/run-parts mr,
/etc/X11/Xsession.d/ r,
/etc/X11/Xresources/ r,
/etc/X11/Xsession.d/{,*} r,
/etc/X11/Xresources/{,*} r,
/etc/default/kexec.d/ r,
# file_inherit
owner @{HOME}/.xsession-errors w,
include if exists <local/x11-xsession_run-parts>
}
profile dbus {
@ -81,6 +76,7 @@ profile x11-xsession @{exec_path} {
# file_inherit
owner @{HOME}/.xsession-errors w,
include if exists <local/x11-xsession_dbus>
}
profile gpg {
@ -95,23 +91,17 @@ profile x11-xsession @{exec_path} {
@{PROC}/@{pid}/fd/ r,
include if exists <local/x11-xsession_gpg>
}
profile udevadm {
include <abstractions/base>
include <abstractions/systemd-common>
@{bin}/udevadm mr,
/etc/udev/udev.conf r,
owner @{PROC}/@{pid}/stat r,
@{PROC}/cmdline r,
@{PROC}/1/sched r,
@{PROC}/1/environ r,
@{PROC}/sys/kernel/osrelease r,
@{sys}/firmware/efi/efivars/SecureBoot-@{uuid} r,
@{sys}/bus/ r,
@{sys}/bus/*/devices/ r,
@{sys}/class/ r,
@ -119,6 +109,7 @@ profile x11-xsession @{exec_path} {
@{sys}/devices/**/uevent r,
@{run}/udev/data/* r,
include if exists <local/x11-xsession_udevadm>
}
include if exists <local/x11-xsession>