## policy for prosody ######################################## ## ## Execute TEMPLATE in the prosody domin. ## ## ## ## Domain allowed to transition. ## ## # interface(`prosody_domtrans',` gen_require(` type prosody_t, prosody_exec_t; ') corecmd_search_bin($1) domtrans_pattern($1, prosody_exec_t, prosody_t) ') ######################################## ## ## Search prosody lib directories. ## ## ## ## Domain allowed access. ## ## # interface(`prosody_search_lib',` gen_require(` type prosody_var_lib_t; ') allow $1 prosody_var_lib_t:dir search_dir_perms; files_search_var_lib($1) ') ######################################## ## ## Read prosody lib files. ## ## ## ## Domain allowed access. ## ## # interface(`prosody_read_lib_files',` gen_require(` type prosody_var_lib_t; ') files_search_var_lib($1) read_files_pattern($1, prosody_var_lib_t, prosody_var_lib_t) ') ######################################## ## ## Manage prosody lib files. ## ## ## ## Domain allowed access. ## ## # interface(`prosody_manage_lib_files',` gen_require(` type prosody_var_lib_t; ') files_search_var_lib($1) manage_files_pattern($1, prosody_var_lib_t, prosody_var_lib_t) ') ######################################## ## ## Manage prosody lib directories. ## ## ## ## Domain allowed access. ## ## # interface(`prosody_manage_lib_dirs',` gen_require(` type prosody_var_lib_t; ') files_search_var_lib($1) manage_dirs_pattern($1, prosody_var_lib_t, prosody_var_lib_t) ') ######################################## ## ## Read prosody PID files. ## ## ## ## Domain allowed access. ## ## # interface(`prosody_read_pid_files',` gen_require(` type prosody_var_run_t; ') files_search_pids($1) read_files_pattern($1, prosody_var_run_t, prosody_var_run_t) ') ######################################## ## ## Execute prosody server in the prosody domain. ## ## ## ## Domain allowed to transition. ## ## # interface(`prosody_systemctl',` gen_require(` type prosody_t; type prosody_unit_file_t; ') systemd_exec_systemctl($1) init_reload_services($1) systemd_read_fifo_file_passwd_run($1) allow $1 prosody_unit_file_t:file read_file_perms; allow $1 prosody_unit_file_t:service manage_service_perms; ps_process_pattern($1, prosody_t) ') ######################################## ## ## Execute prosody in the prosody domain, and ## allow the specified role the prosody domain. ## ## ## ## Domain allowed to transition ## ## ## ## ## The role to be allowed the prosody domain. ## ## # interface(`prosody_run',` gen_require(` type prosody_t; attribute_role prosody_roles; ') prosody_domtrans($1) roleattribute $2 prosody_roles; ') ###################################### ## ## Connect to prosody with a unix ## domain stream socket. ## ## ## ## Domain allowed access. ## ## # interface(`prosody_stream_connect',` gen_require(` type prosody_t, prosody_var_run_t; ') files_search_pids($1) stream_connect_pattern($1, prosody_var_run_t, prosody_var_run_t, prosody_t) ') ######################################## ## ## Role access for prosody ## ## ## ## Role allowed access ## ## ## ## ## User domain for the role ## ## # interface(`prosody_role',` gen_require(` type prosody_t; attribute_role prosody_roles; ') roleattribute $1 prosody_roles; prosody_domtrans($2) ps_process_pattern($2, prosody_t) allow $2 prosody_t:process { signull signal sigkill }; ') ######################################## ## ## All of the rules required to administrate ## an prosody environment ## ## ## ## Domain allowed access. ## ## ## # interface(`prosody_admin',` gen_require(` type prosody_t; type prosody_var_lib_t; type prosody_var_run_t; type prosody_unit_file_t; ') allow $1 prosody_t:process { ptrace signal_perms }; ps_process_pattern($1, prosody_t) files_search_var_lib($1) admin_pattern($1, prosody_var_lib_t) files_search_pids($1) admin_pattern($1, prosody_var_run_t) prosody_systemctl($1) admin_pattern($1, prosody_unit_file_t) allow $1 prosody_unit_file_t:service all_service_perms; optional_policy(` systemd_passwd_agent_exec($1) systemd_read_fifo_file_passwd_run($1) ') ')