2021-04-01 17:17:47 +02:00
|
|
|
# apparmor.d - Full set of apparmor profiles
|
2022-06-12 23:19:13 +02:00
|
|
|
# Copyright (C) 2019-2022 Mikhail Morfikov
|
2022-02-20 00:21:48 +01:00
|
|
|
# Copyright (C) 2022 Alexandre Pujol <alexandre@pujol.io>
|
2021-04-01 17:17:47 +02:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
2020-09-12 17:19:23 +02:00
|
|
|
|
2020-12-10 22:33:39 +01:00
|
|
|
abi <abi/3.0>,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
2020-12-10 22:33:39 +01:00
|
|
|
include <tunables/global>
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
@{exec_path} = /{usr/,}bin/sudo
|
|
|
|
profile sudo @{exec_path} {
|
2020-12-10 22:33:39 +01:00
|
|
|
include <abstractions/base>
|
2022-06-12 23:19:13 +02:00
|
|
|
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>
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
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,
|
2021-04-04 00:28:16 +02:00
|
|
|
capability net_admin,
|
2021-10-22 16:01:43 +02:00
|
|
|
capability setgid,
|
|
|
|
capability setuid,
|
2021-04-04 00:28:16 +02:00
|
|
|
capability sys_ptrace,
|
2021-10-22 16:01:43 +02:00
|
|
|
capability sys_resource,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
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-06-12 23:19:13 +02:00
|
|
|
|
2022-07-10 15:28:44 +02:00
|
|
|
signal (send) peer=unconfined,
|
2022-02-13 02:32:51 +01:00
|
|
|
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},
|
2020-09-12 17:19:23 +02:00
|
|
|
|
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]),
|
|
|
|
|
2020-09-12 17:19:23 +02:00
|
|
|
@{exec_path} mr,
|
|
|
|
|
2022-06-13 23:13:17 +02:00
|
|
|
/run/ r,
|
|
|
|
|
2022-06-12 23:19:13 +02:00
|
|
|
@{libexec}/sudo/** mr,
|
|
|
|
/{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,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
2022-06-12 23:19:13 +02:00
|
|
|
/etc/default/locale r,
|
2022-02-20 00:21:48 +01:00
|
|
|
/etc/environment r,
|
|
|
|
/etc/machine-id r,
|
|
|
|
/etc/security/limits.d/{,*} 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,
|
2022-11-03 22:40:01 +01:00
|
|
|
/var/lib/sudo/lectured/ r,
|
2022-11-20 12:42:08 +01:00
|
|
|
/var/log/sudo.log wk,
|
2022-06-12 23:19:13 +02:00
|
|
|
owner /var/lib/sudo/lectured/* rw,
|
|
|
|
|
|
|
|
owner @{HOME}/.sudo_as_admin_successful rw,
|
|
|
|
owner @{HOME}/.xsession-errors w,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
# For timestampdir
|
2020-10-25 10:23:34 +01:00
|
|
|
owner @{run}/sudo/ rw,
|
|
|
|
owner @{run}/sudo/ts/ rw,
|
|
|
|
owner @{run}/sudo/ts/* rwk,
|
2021-04-04 00:28:16 +02:00
|
|
|
@{run}/faillock/{,*} rwk,
|
2022-06-12 23:19:13 +02:00
|
|
|
@{run}/resolvconf/resolv.conf r,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
2022-07-15 22:55:59 +02:00
|
|
|
@{PROC}/@{pids}/cgroup r,
|
2022-02-13 02:32:51 +01:00
|
|
|
@{PROC}/@{pids}/fd/ r,
|
2020-09-12 17:19:23 +02:00
|
|
|
@{PROC}/@{pids}/stat r,
|
2022-02-20 00:21:48 +01:00
|
|
|
@{PROC}/1/limits r,
|
2022-06-12 23:19:13 +02:00
|
|
|
@{PROC}/sys/kernel/seccomp/actions_avail r,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
2022-02-20 00:33:32 +01:00
|
|
|
owner /dev/tty[0-9]* rw,
|
2022-06-12 23:19:13 +02:00
|
|
|
/dev/ r, # interactive login
|
|
|
|
/dev/ptmx 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>
|
2020-09-12 17:19:23 +02:00
|
|
|
}
|