Skip to content

Commit

Permalink
Add label rshim_var_run_t for /run/rshim.pid
Browse files Browse the repository at this point in the history
Add SELinux label into rshim policy so rshim_t process domain can manage
pidfiles stored in /run/rshim.pid

Signed-off-by: Lukas Vrabec <[email protected]>
  • Loading branch information
wrabcak authored and zpytela committed Nov 22, 2024
1 parent a123037 commit 6b64dd0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions policy/modules/contrib/rshim.fc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/usr/bin/rshim -- gen_context(system_u:object_r:rshim_exec_t,s0)

/run/rshim\.pid -- gen_context(system_u:object_r:rshim_var_run_t,s0)

/usr/lib/systemd/system/rshim.* -- gen_context(system_u:object_r:rshim_unit_file_t,s0)
6 changes: 6 additions & 0 deletions policy/modules/contrib/rshim.te
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ type rshim_t;
type rshim_exec_t;
init_daemon_domain(rshim_t, rshim_exec_t)

type rshim_var_run_t;
files_pid_file(rshim_var_run_t)

type rshim_unit_file_t;
systemd_unit_file(rshim_unit_file_t)

Expand All @@ -24,6 +27,9 @@ allow rshim_t self:system module_load;
allow rshim_t self:unix_stream_socket create_stream_socket_perms;
allow rshim_t self:netlink_kobject_uevent_socket getopt;

manage_files_pattern(rshim_t, rshim_var_run_t, rshim_var_run_t)
files_pid_filetrans(rshim_t, rshim_var_run_t, file)

kernel_read_proc_files(rshim_t)

corecmd_exec_shell(rshim_t)
Expand Down

0 comments on commit 6b64dd0

Please sign in to comment.