feat: profiles and integration tests improvments.

Add the udbus variable to be used in `unix bind` rule for dbus.
This commit is contained in:
Alexandre Pujol 2024-11-19 19:04:27 +00:00
parent b4bcb2f16e
commit 4e5f4cb06a
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
43 changed files with 81 additions and 47 deletions

View file

@ -22,7 +22,7 @@ profile busctl @{exec_path} {
ptrace (read),
unix (bind) type=stream addr=@@{hex16}/bus/busctl/busctl,
unix (bind) type=stream addr=@@{udbus}/bus/busctl/busctl,
signal (send) set=(cont) peer=child-pager,

View file

@ -10,6 +10,7 @@ include <tunables/global>
profile hostnamectl @{exec_path} {
include <abstractions/base>
include <abstractions/bus-system>
include <abstractions/bus/org.freedesktop.systemd1>
include <abstractions/consoles>
capability net_admin,

View file

@ -24,7 +24,7 @@ profile networkctl @{exec_path} flags=(attach_disconnected) {
ptrace (read) peer=@{p_systemd},
unix (bind) type=stream addr=@@{hex16}/bus/networkctl/system,
unix (bind) type=stream addr=@@{udbus}/bus/networkctl/system,
#aa:dbus talk bus=system name=org.freedesktop.network1 label=systemd-networkd
# No label available

View file

@ -22,7 +22,7 @@ profile systemd-analyze @{exec_path} {
signal (send) peer=child-pager,
unix bind type=stream addr=@@{hex16}/bus/systemd-analyze/system,
unix bind type=stream addr=@@{udbus}/bus/systemd-analyze/system,
#aa:dbus talk bus=system name=org.freedesktop.systemd1 label="@{p_systemd}"

View file

@ -19,7 +19,7 @@ profile systemd-cgls @{exec_path} {
signal send set=cont peer=child-pager,
unix bind type=stream addr=@@{hex16}/bus/systemd-cgls/system,
unix bind type=stream addr=@@{udbus}/bus/systemd-cgls/system,
@{exec_path} mr,

View file

@ -35,6 +35,8 @@ profile systemd-homed @{exec_path} flags=(attach_disconnected) {
mount options=(rw, rslave) -> @{run}/,
mount /dev/dm-@{int} -> @{run}/systemd/user-home-mount/,
unix bind type=stream addr=@@{udbus}/bus/systemd-homed/system,
#aa:dbus own bus=system name=org.freedesktop.home1
@{exec_path} mr,
@ -61,6 +63,7 @@ profile systemd-homed @{exec_path} flags=(attach_disconnected) {
@{run}/systemd/home/{,**} rw,
@{run}/systemd/userdb/io.systemd.home r,
@{run}/systemd/user-home-mount/{,**} rw,
@{run}/systemd/notify w,
@{sys}/bus/ r,
@{sys}/fs/ r,

View file

@ -18,7 +18,7 @@ profile systemd-hostnamed @{exec_path} flags=(attach_disconnected) {
network unix stream,
unix (bind) type=stream addr=@@{hex16}/bus/systemd-hostnam/system,
unix (bind) type=stream addr=@@{udbus}/bus/systemd-hostnam/system,
#aa:dbus own bus=system name=org.freedesktop.hostname1

View file

@ -14,7 +14,7 @@ profile systemd-localed @{exec_path} flags=(attach_disconnected) {
include <abstractions/consoles>
include <abstractions/common/systemd>
unix (bind) type=stream addr=@@{hex16}/bus/systemd-localed/system,
unix (bind) type=stream addr=@@{udbus}/bus/systemd-localed/system,
#aa:dbus own bus=system name=org.freedesktop.locale1

View file

@ -29,7 +29,7 @@ profile systemd-logind @{exec_path} flags=(attach_disconnected) {
mqueue r type=posix /,
unix (bind) type=stream addr=@@{hex16}/bus/systemd-logind/system,
unix (bind) type=stream addr=@@{udbus}/bus/systemd-logind/system,
#aa:dbus own bus=system name=org.freedesktop.login1

View file

@ -27,7 +27,7 @@ profile systemd-networkd @{exec_path} flags=(attach_disconnected) {
network packet dgram,
network packet raw,
unix (bind) type=stream addr=@@{hex16}/bus/systemd-network/bus-api-network,
unix (bind) type=stream addr=@@{udbus}/bus/systemd-network/bus-api-network,
#aa:dbus own bus=system name=org.freedesktop.network1

View file

@ -15,7 +15,7 @@ profile systemd-oomd @{exec_path} flags=(attach_disconnected) {
capability dac_override,
capability kill,
unix (bind) type=stream addr=@@{hex16}/bus/systemd-oomd/bus-api-oom,
unix (bind) type=stream addr=@@{udbus}/bus/systemd-oomd/bus-api-oom,
#aa:dbus own bus=system name=org.freedesktop.oom1

View file

@ -15,7 +15,7 @@ profile systemd-timedated @{exec_path} flags=(attach_disconnected) {
capability sys_time,
unix (bind) type=stream addr=@@{hex16}/bus/systemd-timedat/system,
unix (bind) type=stream addr=@@{udbus}/bus/systemd-timedat/system,
#aa:dbus own bus=system name=org.freedesktop.timedate1

View file

@ -21,7 +21,7 @@ profile systemd-timesyncd @{exec_path} flags=(attach_disconnected) {
network inet stream,
network inet6 stream,
unix (bind) type=stream addr=@@{hex16}/bus/systemd-timesyn/bus-api-timesync,
unix (bind) type=stream addr=@@{udbus}/bus/systemd-timesyn/bus-api-timesync,
unix (send, receive) type=dgram addr=none peer=(label=@{p_systemd}, addr=none),
#aa:dbus own bus=system name=org.freedesktop.timesync1

View file

@ -17,7 +17,7 @@ profile systemd-update-utmp @{exec_path} {
network netlink raw,
unix (bind) type=stream addr=@@{hex16}/bus/systemd-update-/,
unix (bind) type=stream addr=@@{udbus}/bus/systemd-update-/,
@{exec_path} mr,

View file

@ -25,7 +25,7 @@ profile systemd-user-runtime-dir @{exec_path} {
mount fstype=tmpfs options=(rw,nosuid,nodev) -> @{run}/user/@{uid}/,
umount @{run}/user/@{uid}/,
unix (bind) type=stream addr=@@{hex16}/bus/systemd-user-ru/system,
unix (bind) type=stream addr=@@{udbus}/bus/systemd-user-ru/system,
@{exec_path} mr,