feat(profile): improve sudo abstraction.
This commit is contained in:
parent
7ae05eb397
commit
cbd0b61491
3 changed files with 13 additions and 58 deletions
|
|
@ -8,56 +8,26 @@ include <tunables/global>
|
|||
|
||||
profile default-sudo @{exec_path} {
|
||||
include <abstractions/base>
|
||||
include <abstractions/authentication>
|
||||
include <abstractions/bus-system>
|
||||
include <abstractions/consoles>
|
||||
include <abstractions/nameservice-strict>
|
||||
include <abstractions/wutmp>
|
||||
include <abstractions/sudo>
|
||||
|
||||
capability audit_write,
|
||||
capability chown,
|
||||
capability dac_override,
|
||||
capability dac_read_search,
|
||||
capability mknod,
|
||||
capability net_admin,
|
||||
capability setgid,
|
||||
capability setuid,
|
||||
capability sys_ptrace,
|
||||
capability sys_resource,
|
||||
|
||||
network inet dgram,
|
||||
network inet6 dgram,
|
||||
network netlink raw,
|
||||
|
||||
ptrace (read),
|
||||
|
||||
dbus send bus=system path=/org/freedesktop/login1
|
||||
interface=org.freedesktop.logi1.Manager
|
||||
member=CreateSession
|
||||
peer=(name=org.freedesktop.login1, label=systemd-logind),
|
||||
|
||||
dbus (send receive) bus=session path=/org/freedesktop/systemd1
|
||||
interface=org.freedesktop.systemd.Manager
|
||||
member={JobRemoved,StartTransientUnit},
|
||||
|
||||
@{bin}/sudo mr,
|
||||
@{bin}/su mr,
|
||||
@{lib}/sudo/** mr,
|
||||
|
||||
@{bin}/** Px,
|
||||
@{lib}/** Px,
|
||||
/opt/*/** Px,
|
||||
|
||||
@{etc_ro}/environment r,
|
||||
@{etc_ro}/security/limits.d/{,*} r,
|
||||
/etc/default/locale r,
|
||||
/etc/machine-id r,
|
||||
/etc/sudo.conf r,
|
||||
/etc/sudoers r,
|
||||
/etc/sudoers.d/{,*} r,
|
||||
|
||||
/ r,
|
||||
|
||||
/var/db/sudo/lectured/ r,
|
||||
/var/lib/extrausers/shadow r,
|
||||
/var/lib/sudo/lectured/ r,
|
||||
|
|
@ -68,7 +38,6 @@ profile default-sudo @{exec_path} {
|
|||
owner /var/lib/sudo/lectured/* rw,
|
||||
|
||||
owner @{HOME}/.sudo_as_admin_successful rw,
|
||||
owner @{HOME}/.xsession-errors w,
|
||||
|
||||
@{run}/ r,
|
||||
@{run}/faillock/{,*} rwk,
|
||||
|
|
@ -77,19 +46,5 @@ profile default-sudo @{exec_path} {
|
|||
owner @{run}/sudo/ts/ rw,
|
||||
owner @{run}/sudo/ts/* rwk,
|
||||
|
||||
@{PROC}/@{pids}/cgroup r,
|
||||
@{PROC}/@{pids}/fd/ r,
|
||||
@{PROC}/@{pids}/loginuid r,
|
||||
@{PROC}/@{pids}/stat r,
|
||||
@{PROC}/1/limits r,
|
||||
@{PROC}/sys/kernel/seccomp/actions_avail r,
|
||||
|
||||
/dev/ r, # interactive login
|
||||
/dev/ptmx rwk,
|
||||
/dev/tty rwk,
|
||||
owner /dev/tty@{int} rw,
|
||||
|
||||
deny @{user_share_dirs}/gvfs-metadata/* r,
|
||||
|
||||
include if exists <local/default-sudo>
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue