apparmor.d/apparmor.d/profiles-a-f/adduser
Mikhail Morfikov 3430e3df90
update apparmor profiles
Signed-off-by: Alexandre Pujol <alexandre@pujol.io>
2021-12-12 13:18:41 +00:00

59 lines
1.5 KiB
Text

# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2019-2021 Mikhail Morfikov
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = /{usr/,}{s,}bin/add{user,group}
profile adduser @{exec_path} {
include <abstractions/base>
include <abstractions/consoles>
include <abstractions/perl>
include <abstractions/nameservice-strict>
# To create a user home dir and give it proper permissions:
# mkdir("/home/user", 0755) = 0
# chown("/home/user", 1001, 1001) = 0
# chmod("/home/user", 0755) = 0
capability chown,
capability fowner,
# To set the set-group-ID bit for the user home dir (SETGID_HOME=yes).
capability fsetid,
# To copy files from the /etc/skel/ dir to the newly created user dir, which now has a different
# owner.
capability dac_read_search,
capability dac_override,
@{exec_path} r,
/{usr/,}bin/perl r,
/{usr/,}bin/{,ba,da}sh rix,
/{usr/,}bin/find rix,
/{usr/,}bin/rm rix,
/{usr/,}{s,}bin/useradd rPx,
/{usr/,}{s,}bin/userdel rPx,
/{usr/,}{s,}bin/groupdel rPx,
/{usr/,}{s,}bin/groupadd rPx,
/{usr/,}{s,}bin/usermod rPx,
/{usr/,}bin/passwd rPx,
/{usr/,}bin/gpasswd rPx,
/{usr/,}bin/chfn rPx,
/{usr/,}bin/chage rPx,
/etc/{group,passwd,shadow} r,
/etc/adduser.conf r,
# To create user dirs and copy files from /etc/skel/ to them
@{HOME}/ rw,
@{HOME}/.* w,
/var/lib/*/{,*} rw,
/etc/skel/{,.*} r,
include if exists <local/adduser>
}