apparmor.d/apparmor.d/profiles-m-r/newgrp

40 lines
824 B
Text

# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2020-2021 Mikhail Morfikov
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = @{bin}/newgrp
profile newgrp @{exec_path} {
include <abstractions/base>
include <abstractions/nameservice-strict>
# To write records to the kernel auditing log.
capability audit_write,
# To remove the following errors:
# setgroups: Operation not permitted
# setgid: Operation not permitted
capability setgid,
# newgrp is a SETUID binary
capability setuid,
network netlink raw,
@{exec_path} mr,
# Shells to use
@{bin}/{,b,d,rb}ash rPUx,
@{bin}/{c,k,tc,z}sh rPUx,
/etc/{passwd,group,shadow,gshadow} r,
/etc/login.defs r,
owner @{PROC}/@{pid}/loginuid r,
include if exists <local/newgrp>
}