2021-04-01 17:17:47 +02:00
|
|
|
# apparmor.d - Full set of apparmor profiles
|
|
|
|
# Copyright (C) 2019-2021 Mikhail Morfikov
|
|
|
|
# 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>
|
|
|
|
include <abstractions/consoles>
|
|
|
|
include <abstractions/authentication>
|
|
|
|
include <abstractions/wutmp>
|
|
|
|
include <abstractions/nameservice-strict>
|
|
|
|
# include <pam/mappings>
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
# To remove the following errors:
|
|
|
|
# sudo: unable to change to root gid: Operation not permitted
|
|
|
|
capability setgid,
|
|
|
|
|
|
|
|
# To remove the following errors:
|
|
|
|
# sudo: PERM_SUDOERS: setresuid(-1, 1, -1): Operation not permitted
|
|
|
|
# sudo: no valid sudoers sources found, quitting
|
|
|
|
# sudo: setresuid() [0, 0, 0] -> [1000, -1, -1]: Operation not permitted
|
|
|
|
capability setuid,
|
|
|
|
|
|
|
|
# To write records to the kernel auditing log.
|
|
|
|
capability audit_write,
|
|
|
|
|
|
|
|
# Needed? (#FIXME#)
|
|
|
|
capability sys_resource,
|
|
|
|
|
2020-12-24 13:55:12 +01:00
|
|
|
# To remove the following error:
|
|
|
|
# sudo: PAM account management error: Permission denied
|
|
|
|
# sudo: unable to open audit system: Permission denied
|
|
|
|
# sudo: a password is required
|
|
|
|
network netlink raw,
|
|
|
|
|
2020-09-12 17:19:23 +02:00
|
|
|
signal,
|
|
|
|
|
|
|
|
@{exec_path} mr,
|
|
|
|
|
|
|
|
# Shells to use
|
|
|
|
/{usr/,}bin/{,b,d,rb}ash rpux,
|
|
|
|
/{usr/,}bin/{c,k,tc,z}sh rpux,
|
|
|
|
|
|
|
|
/{usr/,}bin/[a-z0-9]* rPUx,
|
2021-04-02 00:15:47 +02:00
|
|
|
/{usr/,}{s,}bin/[a-z0-9]* rPUx,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
/dev/ r,
|
|
|
|
|
|
|
|
# For timestampdir
|
2020-10-25 10:23:34 +01:00
|
|
|
owner @{run}/sudo/ rw,
|
|
|
|
owner @{run}/sudo/ts/ rw,
|
|
|
|
owner @{run}/sudo/ts/* rwk,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
@{PROC}/@{pid}/fd/ r,
|
|
|
|
@{PROC}/@{pids}/stat r,
|
|
|
|
|
|
|
|
/etc/sudo.conf r,
|
|
|
|
|
|
|
|
/etc/sudoers r,
|
|
|
|
/etc/sudoers.d/{,*} r,
|
|
|
|
|
|
|
|
# file_inherit
|
|
|
|
owner /dev/tty[0-9]* rw,
|
|
|
|
owner @{HOME}/.xsession-errors w,
|
|
|
|
|
2020-12-10 22:33:39 +01:00
|
|
|
include if exists <local/sudo>
|
2020-09-12 17:19:23 +02:00
|
|
|
}
|