2021-04-01 17:17:47 +02:00
|
|
|
# apparmor.d - Full set of apparmor profiles
|
|
|
|
# Copyright (C) 2020-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/newgrp
|
|
|
|
profile newgrp @{exec_path} {
|
2020-12-10 22:33:39 +01:00
|
|
|
include <abstractions/base>
|
|
|
|
include <abstractions/nameservice-strict>
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
# 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,
|
|
|
|
|
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,
|
|
|
|
|
|
|
|
/etc/{passwd,group,shadow,gshadow} r,
|
|
|
|
|
|
|
|
/etc/login.defs r,
|
|
|
|
|
|
|
|
owner @{PROC}/@{pid}/loginuid r,
|
|
|
|
|
2020-12-10 22:33:39 +01:00
|
|
|
include if exists <local/newgrp>
|
2020-09-12 17:19:23 +02:00
|
|
|
}
|