systemd_homed_runtime_work_dir_t: new type for systemd-homed workdir

As systemd-homed's workdir is an internal one, and external domains may
be (reasonably) expected to connect to systemd_homed_runtime_t in the
future, let's create a new domain for systemd-homed's internal work to
differentiate between the two.

Signed-off-by: Rahul Sandhu <rahul@sandhuservices.dev>
This commit is contained in:
Rahul Sandhu 2024-11-28 02:56:31 +00:00
parent 5b382a470d
commit b1babb9212
2 changed files with 6 additions and 1 deletions

View File

@ -109,6 +109,7 @@ HOME_ROOT/(.+)\.home -- gen_context(system_u:object_r:systemd_homed_storage_t,s0
/run/systemd/ask-password(/.*)? gen_context(system_u:object_r:systemd_passwd_runtime_t,s0)
/run/systemd/ask-password-block(/.*)? gen_context(system_u:object_r:systemd_passwd_runtime_t,s0)
/run/systemd/home(/.*)? gen_context(system_u:object_r:systemd_homed_runtime_t,s0)
/run/systemd/user-home-mount -d gen_context(system_u:object_r:systemd_homed_runtime_work_dir_t,s0)
/run/systemd/network(/.*)? gen_context(system_u:object_r:systemd_networkd_runtime_t,s0)
/run/systemd/notify -s gen_context(system_u:object_r:systemd_runtime_notify_t,s0)
/run/systemd/resolve(/.*)? gen_context(system_u:object_r:systemd_resolved_runtime_t,s0)

View File

@ -129,6 +129,10 @@ role system_r types systemd_homework_t;
type systemd_homed_runtime_t;
files_runtime_file(systemd_homed_runtime_t)
type systemd_homed_runtime_work_dir_t;
files_runtime_file(systemd_homed_runtime_work_dir_t)
files_mountpoint(systemd_homed_runtime_work_dir_t)
type systemd_homed_storage_t;
files_type(systemd_homed_storage_t)
@ -732,7 +736,7 @@ init_runtime_filetrans(systemd_homework_t, systemd_homed_runtime_t, dir)
files_read_etc_runtime(systemd_homework_t)
# mount on /run/systemd/user-home-mount
allow systemd_homework_t systemd_homed_runtime_t:dir mounton;
allow systemd_homework_t systemd_homed_runtime_work_dir_t:dir mounton;
allow systemd_homework_t systemd_homed_storage_t:file manage_file_perms;
files_home_filetrans(systemd_homework_t, systemd_homed_storage_t, file)