Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add policy for importctl #2460

Open
wants to merge 1 commit into
base: rawhide
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions policy/modules/system/systemd.fc
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ HOME_DIR/\.config/systemd/user(/.*)? gen_context(system_u:object_r:systemd_unit

/var/cache/systemd(//.*)? gen_context(system_u:object_r:systemd_cache_t,s0)

/var/lib/confexts(/.*)? gen_context(system_u:object_r:systemd_importd_var_lib_t,s0)
/var/lib/extensions(/.*)? gen_context(system_u:object_r:systemd_importd_var_lib_t,s0)
/var/lib/portables(/.*)? gen_context(system_u:object_r:systemd_importd_var_lib_t,s0)
/var/lib/machines(/.*)? gen_context(system_u:object_r:systemd_machined_var_lib_t,s0)
/var/lib/systemd/coredump(/.*)? gen_context(system_u:object_r:systemd_coredump_var_lib_t,s0)
/var/lib/systemd/network(/.*)? gen_context(system_u:object_r:systemd_networkd_var_lib_t,s0)
Expand Down
9 changes: 9 additions & 0 deletions policy/modules/system/systemd.te
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,9 @@ files_type(systemd_machined_var_lib_t)
systemd_domain_template(systemd_importd)
init_nnp_daemon_domain(systemd_importd_t)

type systemd_importd_var_lib_t;
files_type(systemd_importd_var_lib_t)

type systemd_importd_var_run_t;
files_pid_file(systemd_importd_var_run_t)

Expand Down Expand Up @@ -1660,6 +1663,12 @@ allow systemd_importd_t self:udp_socket create_socket_perms;
allow systemd_importd_t self:unix_dgram_socket sendto;
allow systemd_importd_t systemd_importd_exec_t:file execute_no_trans;

manage_dirs_pattern(systemd_importd_t, systemd_importd_var_lib_t, systemd_importd_var_lib_t)
manage_files_pattern(systemd_importd_t, systemd_importd_var_lib_t, systemd_importd_var_lib_t)
files_var_lib_filetrans(systemd_importd_t, systemd_importd_var_lib_t, dir, "confexts")
files_var_lib_filetrans(systemd_importd_t, systemd_importd_var_lib_t, dir, "extensions")
files_var_lib_filetrans(systemd_importd_t, systemd_importd_var_lib_t, dir, "portables")

manage_dirs_pattern(systemd_importd_t, systemd_importd_var_run_t, systemd_importd_var_run_t)
manage_files_pattern(systemd_importd_t, systemd_importd_var_run_t, systemd_importd_var_run_t)
manage_sock_files_pattern(systemd_importd_t, systemd_importd_var_run_t, systemd_importd_var_run_t)
Expand Down