2020-09-12 17:19:23 +02:00
|
|
|
# vim:syntax=apparmor
|
|
|
|
# ------------------------------------------------------------------
|
|
|
|
#
|
2021-01-10 16:35:07 +01:00
|
|
|
# Copyright (C) 2019-2021 Mikhail Morfikov
|
2020-09-12 17:19:23 +02:00
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of version 2 of the GNU General Public
|
|
|
|
# License published by the Free Software Foundation.
|
|
|
|
#
|
|
|
|
# ------------------------------------------------------------------
|
|
|
|
|
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/chsh
|
|
|
|
profile chsh @{exec_path} {
|
2020-12-10 22:33:39 +01:00
|
|
|
include <abstractions/base>
|
|
|
|
include <abstractions/wutmp>
|
|
|
|
include <abstractions/authentication>
|
|
|
|
include <abstractions/nameservice-strict>
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
# To write records to the kernel auditing log.
|
|
|
|
capability audit_write,
|
|
|
|
|
|
|
|
# To set the right permission to the files in the /etc/ dir.
|
|
|
|
capability chown,
|
|
|
|
capability fsetid,
|
|
|
|
|
|
|
|
# gpasswd 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,
|
|
|
|
|
|
|
|
owner @{PROC}/@{pid}/loginuid r,
|
|
|
|
|
|
|
|
/etc/shells r,
|
|
|
|
|
|
|
|
/etc/passwd rw,
|
|
|
|
/etc/passwd- w,
|
|
|
|
/etc/passwd+ rw,
|
|
|
|
/etc/passwd.@{pid} w,
|
|
|
|
/etc/passwd.lock wl -> /etc/passwd.@{pid},
|
|
|
|
|
|
|
|
/etc/shadow r,
|
|
|
|
|
|
|
|
# A process first uses lckpwdf() to lock the lock file, thereby gaining exclusive rights to
|
|
|
|
# modify the /etc/passwd or /etc/shadow password database.
|
|
|
|
/etc/.pwd.lock rwk,
|
|
|
|
|
2020-12-10 22:33:39 +01:00
|
|
|
include if exists <local/chsh>
|
2020-09-12 17:19:23 +02:00
|
|
|
}
|