update apparmor profiles
Adpated to the apparmor.d structure. Signed-off-by: Mikhail Morfikov <mmorfikov@gmail.com>
This commit is contained in:
parent
c1e2b1d15e
commit
0573b2d996
29 changed files with 534 additions and 23 deletions
81
apparmor.d/groups/systemd/coredumpctl
Normal file
81
apparmor.d/groups/systemd/coredumpctl
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
# vim:syntax=apparmor
|
||||
# ------------------------------------------------------------------
|
||||
#
|
||||
# Copyright (C) 2021 Mikhail Morfikov
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
abi <abi/3.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = /{usr/,}bin/coredumpctl
|
||||
profile coredumpctl @{exec_path} flags=(complain) {
|
||||
include <abstractions/base>
|
||||
include <abstractions/nameservice-strict>
|
||||
|
||||
signal (send) peer=child-pager,
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
/{usr/,}bin/gdb rCx -> gdb,
|
||||
|
||||
/{usr/,}bin/pager rPx -> child-pager,
|
||||
/{usr/,}bin/less rPx -> child-pager,
|
||||
/{usr/,}bin/more rPx -> child-pager,
|
||||
|
||||
owner /tmp/*.coredump w,
|
||||
owner /tmp/core.* w,
|
||||
|
||||
owner /var/tmp/coredump-* rw,
|
||||
|
||||
/var/lib/systemd/coredump/core.*.[0-9]*.[0-9a-f]*.[0-9]*.[0-9]*.zst r,
|
||||
|
||||
/{run,var}/log/journal/ r,
|
||||
/{run,var}/log/journal/[0-9a-f]*/ r,
|
||||
/{run,var}/log/journal/[0-9a-f]*/user-[0-9a-f]*.journal* r,
|
||||
/{run,var}/log/journal/[0-9a-f]*/system.journal* r,
|
||||
/{run,var}/log/journal/[0-9a-f]*/system@[0-9a-f]*.journal* r,
|
||||
|
||||
owner @{PROC}/@{pid}/cgroup r,
|
||||
@{PROC}/1/cgroup r,
|
||||
|
||||
/var/lib/dbus/machine-id r,
|
||||
/etc/machine-id r,
|
||||
|
||||
|
||||
profile gdb {
|
||||
include <abstractions/base>
|
||||
include <abstractions/python>
|
||||
|
||||
ptrace (trace),
|
||||
|
||||
/{usr/,}bin/gdb mr,
|
||||
|
||||
/{usr/,}bin/iconv rix,
|
||||
/{usr/,}bin/* r,
|
||||
/{usr/,}sbin/* r,
|
||||
|
||||
@{PROC}/@{pids}/fd/ r,
|
||||
|
||||
/etc/inputrc r,
|
||||
|
||||
/etc/gdb/** r,
|
||||
/usr/share/gdb/{,**} r,
|
||||
/usr/share/glib-2.0/gdb/{,**} r,
|
||||
/usr/share/gcc-[0-9]*/python/{,**} r,
|
||||
/usr/share/gcc/** r,
|
||||
|
||||
owner /var/tmp/coredump-* rw,
|
||||
|
||||
# Silencer
|
||||
deny /usr/share/** w,
|
||||
|
||||
}
|
||||
|
||||
include if exists <local/coredumpctl>
|
||||
}
|
||||
52
apparmor.d/groups/systemd/systemd-coredump
Normal file
52
apparmor.d/groups/systemd/systemd-coredump
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
# vim:syntax=apparmor
|
||||
# ------------------------------------------------------------------
|
||||
#
|
||||
# Copyright (C) 2021 Mikhail Morfikov
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
abi <abi/3.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = /{usr/,}lib/systemd/systemd-coredump
|
||||
profile systemd-coredump @{exec_path} flags=(complain) {
|
||||
include <abstractions/base>
|
||||
include <abstractions/systemd-common>
|
||||
|
||||
capability setpcap,
|
||||
capability setuid,
|
||||
capability setgid,
|
||||
capability dac_read_search,
|
||||
capability sys_ptrace,
|
||||
# Needed?
|
||||
deny capability net_admin,
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
/{usr/,}bin/* r,
|
||||
/{usr/,}sbin/* r,
|
||||
/usr/libexec/** r,
|
||||
|
||||
/etc/systemd/coredump.conf r,
|
||||
|
||||
/var/lib/systemd/coredump/ r,
|
||||
owner /var/lib/systemd/coredump/#[0-9]* rw,
|
||||
owner /var/lib/systemd/coredump/core.*.[0-9]*.[0-9a-f]*.[0-9]*.[0-9]*.zst rwl -> /var/lib/systemd/coredump/#[0-9]*,
|
||||
|
||||
owner @{PROC}/@{pid}/setgroups r,
|
||||
@{PROC}/@{pids}/comm r,
|
||||
@{PROC}/@{pids}/cgroup r,
|
||||
@{PROC}/@{pids}/cmdline r,
|
||||
@{PROC}/@{pids}/limits r,
|
||||
@{PROC}/@{pids}/mountinfo r,
|
||||
@{PROC}/@{pids}/environ r,
|
||||
@{PROC}/@{pids}/fd/ r,
|
||||
@{PROC}/@{pids}/fdinfo/[0-9]* r,
|
||||
|
||||
include if exists <local/systemd-coredump>
|
||||
}
|
||||
|
|
@ -17,6 +17,14 @@ profile systemd-journald @{exec_path} {
|
|||
capability sys_ptrace,
|
||||
capability dac_read_search,
|
||||
capability kill,
|
||||
capability sys_admin,
|
||||
capability setuid,
|
||||
capability setgid,
|
||||
|
||||
# For audit logs
|
||||
capability audit_control,
|
||||
|
||||
network netlink raw,
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ include <tunables/global>
|
|||
@{exec_path} = /{usr/,}lib/systemd/systemd-sysctl
|
||||
profile systemd-sysctl @{exec_path} {
|
||||
include <abstractions/base>
|
||||
include <abstractions/consoles>
|
||||
include <abstractions/systemd-common>
|
||||
|
||||
# Are these needed?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue