88 lines
2.6 KiB
Text
88 lines
2.6 KiB
Text
# apparmor.d - Full set of apparmor profiles
|
|
# Copyright (C) 2018-2021 Mikhail Morfikov
|
|
# Copyright (C) 2021 Alexandre Pujol <alexandre@pujol.io>
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
|
|
|
abi <abi/3.0>,
|
|
|
|
include <tunables/global>
|
|
|
|
@{exec_path} = /{usr/,}lib/polkit-1/polkitd
|
|
@{exec_path} += @{libexec}/polkitd
|
|
profile polkitd @{exec_path} {
|
|
include <abstractions/base>
|
|
include <abstractions/dbus-strict>
|
|
include <abstractions/nameservice-strict>
|
|
|
|
capability setgid,
|
|
capability setuid,
|
|
capability sys_nice,
|
|
capability sys_ptrace,
|
|
audit deny capability net_admin,
|
|
|
|
ptrace (read),
|
|
|
|
dbus (send) bus=system path=/org/freedesktop/DBus
|
|
interface=org.freedesktop.DBus
|
|
member={GetConnectionUnixProcessID,GetConnectionUnixUser,RequestName}
|
|
peer=(name=org.freedesktop.DBus),
|
|
|
|
dbus (send) bus=system path=/org/freedesktop/PolicyKit[0-9]{,/**}
|
|
interface=org.freedesktop.PolicyKit[0-9]{,.**}
|
|
peer=(name="{org.freedesktop.DBus,:*}"), # all members
|
|
|
|
dbus (receive) bus=system path=/org/freedesktop/PolicyKit[0-9]/Authority
|
|
interface=org.freedesktop.DBus.Properties
|
|
member=GetAll
|
|
peer=(name=:*),
|
|
|
|
dbus (send) bus=system path=/org/gnome/PolicyKit[0-9]/AuthenticationAgent
|
|
interface=org.freedesktop.PolicyKit[0-9].AuthenticationAgent
|
|
peer=(name=:*), # all members
|
|
|
|
dbus (receive) bus=system path=/org/freedesktop/PolicyKit[0-9]/Authority
|
|
interface=org.freedesktop.PolicyKit[0-9].Authority
|
|
member={EnumerateActions,CheckAuthorization,CancelCheckAuthorization,RegisterAuthenticationAgent,UnregisterAuthenticationAgent,AuthenticationAgentResponse2}
|
|
peer=(name=:*),
|
|
|
|
dbus (bind) bus=system
|
|
name=org.freedesktop.PolicyKit[0-9],
|
|
|
|
@{exec_path} mr,
|
|
|
|
/etc/machine-id r,
|
|
|
|
# System rules
|
|
/etc/polkit-1/rules.d/ r,
|
|
/etc/polkit-1/rules.d/[0-9][0-9]-*.rules r,
|
|
/etc/polkit-1/localauthority/{,**} r,
|
|
/etc/polkit-1/localauthority.conf.d/{,**} r,
|
|
|
|
# Vendor rules
|
|
/usr/share/polkit-1/rules.d/ r,
|
|
/usr/share/polkit-1/rules.d/*.rules r,
|
|
|
|
# Vendor policies
|
|
/usr/share/polkit-1/actions/ r,
|
|
/usr/share/polkit-1/actions/*.policy r,
|
|
/usr/share/polkit-1/actions/*.policy.choice r,
|
|
|
|
owner /var/lib/polkit-1/.cache/ rw,
|
|
/var/lib/polkit-1/localauthority/{,**} r,
|
|
|
|
@{run}/systemd/sessions/* r,
|
|
@{run}/systemd/users/@{uid} r,
|
|
|
|
@{PROC}/@{pids}/cgroup r,
|
|
@{PROC}/@{pids}/cmdline r,
|
|
@{PROC}/@{pids}/stat r,
|
|
@{PROC}/@{pids}/task/@{tid}/stat r,
|
|
@{PROC}/1/environ r,
|
|
@{PROC}/cmdline r,
|
|
@{PROC}/sys/kernel/osrelease r,
|
|
|
|
# Silencer
|
|
deny /.cache/ rw,
|
|
|
|
include if exists <local/polkitd>
|
|
}
|