apparmor.d/apparmor.d/profiles-s-z/sudo

101 lines
2.6 KiB
Plaintext
Raw Normal View History

# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2019-2022 Mikhail Morfikov
2022-02-20 00:21:48 +01:00
# Copyright (C) 2022 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
2020-12-10 22:33:39 +01:00
abi <abi/3.0>,
2020-12-10 22:33:39 +01:00
include <tunables/global>
@{exec_path} = /{usr/,}bin/sudo
profile sudo @{exec_path} {
2020-12-10 22:33:39 +01:00
include <abstractions/base>
include <abstractions/app-launcher-root>
2020-12-10 22:33:39 +01:00
include <abstractions/authentication>
2021-10-22 16:01:43 +02:00
include <abstractions/consoles>
2022-06-14 23:54:26 +02:00
include <abstractions/dbus-strict>
2020-12-10 22:33:39 +01:00
include <abstractions/nameservice-strict>
2021-10-22 16:01:43 +02:00
include <abstractions/wutmp>
2020-12-10 22:33:39 +01:00
# include <pam/mappings>
capability audit_write,
2021-04-18 16:03:30 +02:00
capability chown,
2021-10-22 16:01:43 +02:00
capability dac_override,
capability dac_read_search,
2021-11-04 19:33:25 +01:00
capability mknod,
capability net_admin,
2021-10-22 16:01:43 +02:00
capability setgid,
capability setuid,
capability sys_ptrace,
2021-10-22 16:01:43 +02:00
capability sys_resource,
2022-07-15 22:55:59 +02:00
network inet dgram,
network inet6 dgram,
2022-02-21 19:46:55 +01:00
network netlink raw, # PAM
2020-12-24 13:55:12 +01:00
2021-10-22 16:01:43 +02:00
ptrace (read),
2022-07-10 15:28:44 +02:00
signal (send) peer=unconfined,
signal (send) set=(cont,hup) peer=su,
2022-08-01 18:31:32 +02:00
signal (send) set=winch peer={apt,zsysd,zsys-system-autosnapshot},
2022-06-14 23:54:26 +02:00
dbus send bus=system path=/org/freedesktop/login[0-9]
interface=org.freedesktop.login[0-9].Manager
member=CreateSession
peer=(name=org.freedesktop.login[0-9]),
dbus (send receive) bus=session path=/org/freedesktop/systemd1
interface=org.freedesktop.systemd.Manager
member={JobRemoved,StartTransientUnit},
@{exec_path} mr,
@{libexec}/sudo/** mr,
2022-06-13 23:13:17 +02:00
/snap/snapd/[0-9]*/usr/bin/snap rPx,
/{usr/,}bin/{,b,d,rb}ash rUx,
/{usr/,}bin/{c,k,tc,z}sh rUx,
/{usr/,}lib/cockpit/cockpit-askpass rPx,
/{usr/,}lib/molly-guard/molly-guard rPx,
@{etc_ro}/environment r,
@{etc_ro}/security/limits.d/{,*} r,
/etc/default/locale r,
2022-02-20 00:21:48 +01:00
/etc/machine-id r,
2021-10-22 16:01:43 +02:00
/etc/sudo.conf r,
/etc/sudoers r,
/etc/sudoers.d/{,*} r,
2022-11-20 12:42:08 +01:00
/var/db/sudo/lectured/ r,
/var/lib/extrausers/shadow r,
2022-11-03 22:40:01 +01:00
/var/lib/sudo/lectured/ r,
2023-02-05 01:03:20 +01:00
/var/lib/sudo/ts/ rw,
/var/lib/sudo/ts/* rwk,
2022-11-20 12:42:08 +01:00
/var/log/sudo.log wk,
owner /var/lib/sudo/lectured/* rw,
owner @{HOME}/.sudo_as_admin_successful rw,
owner @{HOME}/.xsession-errors w,
@{run}/ r,
2023-02-05 01:03:20 +01:00
@{run}/faillock/{,*} rwk,
@{run}/resolvconf/resolv.conf r,
2020-10-25 10:23:34 +01:00
owner @{run}/sudo/ rw,
owner @{run}/sudo/ts/ rw,
owner @{run}/sudo/ts/* rwk,
2022-07-15 22:55:59 +02:00
@{PROC}/@{pids}/cgroup r,
@{PROC}/@{pids}/fd/ r,
@{PROC}/@{pids}/stat r,
2022-02-20 00:21:48 +01:00
@{PROC}/1/limits r,
@{PROC}/sys/kernel/seccomp/actions_avail r,
/dev/ r, # interactive login
/dev/ptmx rw,
2023-02-05 01:03:20 +01:00
owner /dev/tty[0-9]* rw,
2021-10-22 16:01:43 +02:00
2022-03-26 21:43:47 +01:00
deny @{user_share_dirs}/gvfs-metadata/* r,
2020-12-10 22:33:39 +01:00
include if exists <local/sudo>
}