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/su
|
|
|
|
profile su @{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:
|
|
|
|
# su: cannot set groups: Operation not permitted
|
|
|
|
capability setgid,
|
|
|
|
|
|
|
|
# To remove the following errors:
|
|
|
|
# su: cannot set user id: Operation not permitted
|
|
|
|
capability setuid,
|
|
|
|
|
|
|
|
# To write records to the kernel auditing log.
|
|
|
|
capability audit_write,
|
|
|
|
|
|
|
|
# Needed?
|
|
|
|
audit deny capability net_bind_service,
|
|
|
|
|
|
|
|
signal (send) set=(term,kill),
|
|
|
|
signal (receive) set=(int,quit,term),
|
|
|
|
|
2020-12-10 22:33:39 +01:00
|
|
|
network netlink raw,
|
|
|
|
|
2020-09-12 17:19:23 +02:00
|
|
|
@{exec_path} mr,
|
|
|
|
|
|
|
|
# Shells to use
|
|
|
|
/{usr/,}bin/{,b,d,rb}ash rpux,
|
|
|
|
/{usr/,}bin/{c,k,tc,z}sh rpux,
|
|
|
|
|
|
|
|
# Fake shells to politely refuse a login
|
|
|
|
#/{usr/,}sbin/nologin rpux,
|
|
|
|
|
|
|
|
/etc/environment r,
|
|
|
|
|
|
|
|
@{PROC}/1/limits r,
|
|
|
|
owner @{PROC}/@{pid}/loginuid r,
|
|
|
|
|
|
|
|
/etc/default/locale r,
|
|
|
|
/etc/security/limits.d/ r,
|
|
|
|
|
|
|
|
/etc/shells r,
|
|
|
|
|
|
|
|
# For pam_securetty
|
|
|
|
@{PROC}/cmdline r,
|
|
|
|
@{sys}/devices/virtual/tty/console/active r,
|
|
|
|
|
2020-12-10 22:33:39 +01:00
|
|
|
include if exists <local/su>
|
2020-09-12 17:19:23 +02:00
|
|
|
}
|