## policy for cockpit ######################################## ## ## Execute TEMPLATE in the cockpit domin. ## ## ## ## Domain allowed to transition. ## ## # ifndef(`cockpit_ws_domtrans',` interface(`cockpit_ws_domtrans',` gen_require(` type cockpit_ws_t, cockpit_ws_exec_t; ') corecmd_search_bin($1) domtrans_pattern($1, cockpit_ws_exec_t, cockpit_ws_t) ') ') ######################################## ## ## Execute TEMPLATE in the cockpit domin. ## ## ## ## Domain allowed to transition. ## ## # ifndef(`cockpit_session_domtrans',` interface(`cockpit_session_domtrans',` gen_require(` type cockpit_session_t, cockpit_session_exec_t; ') corecmd_search_bin($1) domtrans_pattern($1, cockpit_session_exec_t, cockpit_session_t) ') ') ######################################## ## ## Read and write cockpit_session_t unnamed pipes. ## ## ## ## Domain allowed access. ## ## # ifndef(`cockpit_rw_pipes',` interface(`cockpit_rw_pipes',` gen_require(` type cockpit_session_t; ') allow $1 cockpit_session_t:fifo_file rw_fifo_file_perms; ') ') ######################################## ## ## Create cockpit unix_stream_sockets. ## ## ## ## Domain allowed access. ## ## # ifndef(`cockpit_manage_unix_stream_sockets',` interface(`cockpit_manage_unix_stream_sockets',` gen_require(` type cockpit_ws_t; ') allow $1 cockpit_ws_t:unix_stream_socket { create_stream_socket_perms connectto }; ') ') ######################################## ## ## Search cockpit lib directories. ## ## ## ## Domain allowed access. ## ## # ifndef(`cockpit_search_lib',` interface(`cockpit_search_lib',` gen_require(` type cockpit_var_lib_t; ') allow $1 cockpit_var_lib_t:dir search_dir_perms; files_search_var_lib($1) ') ') ######################################## ## ## Read cockpit lib files. ## ## ## ## Domain allowed access. ## ## # ifndef(`cockpit_read_lib_files',` interface(`cockpit_read_lib_files',` gen_require(` type cockpit_var_lib_t; ') files_search_var_lib($1) read_files_pattern($1, cockpit_var_lib_t, cockpit_var_lib_t) ') ') ######################################## ## ## Manage cockpit lib files. ## ## ## ## Domain allowed access. ## ## # ifndef(`cockpit_manage_lib_files',` interface(`cockpit_manage_lib_files',` gen_require(` type cockpit_var_lib_t; ') files_search_var_lib($1) manage_files_pattern($1, cockpit_var_lib_t, cockpit_var_lib_t) ') ') ######################################## ## ## Manage cockpit lib directories. ## ## ## ## Domain allowed access. ## ## # ifndef(`cockpit_manage_lib_dirs',` interface(`cockpit_manage_lib_dirs',` gen_require(` type cockpit_var_lib_t; ') files_search_var_lib($1) manage_dirs_pattern($1, cockpit_var_lib_t, cockpit_var_lib_t) ') ') ######################################## ## ## Read cockpit pid files. ## ## ## ## Domain allowed access. ## ## # ifndef(`cockpit_read_pid_files',` interface(`cockpit_read_pid_files',` gen_require(` type cockpit_var_run_t; ') read_files_pattern($1, cockpit_var_run_t, cockpit_var_run_t) read_lnk_files_pattern($1, cockpit_var_run_t, cockpit_var_run_t) ') ') ######################################## ## ## Manage cockpit pid dirs. ## ## ## ## Domain allowed access. ## ## # ifndef(`cockpit_manage_pid_dirs',` interface(`cockpit_manage_pid_dirs',` gen_require(` type cockpit_var_run_t; ') manage_dirs_pattern($1, cockpit_var_run_t, cockpit_var_run_t) ') ') ######################################## ## ## Manage cockpit pid dirs. ## ## ## ## Domain allowed access. ## ## # ifndef(`cockpit_manage_pid_files',` interface(`cockpit_manage_pid_files',` gen_require(` type cockpit_var_run_t; ') manage_files_pattern($1, cockpit_var_run_t, cockpit_var_run_t) ') ') ######################################## ## ## Execute cockpit server in the cockpit domain. ## ## ## ## Domain allowed to transition. ## ## # ifndef(`cockpit_systemctl',` interface(`cockpit_systemctl',` gen_require(` type cockpit_ws_t; type cockpit_unit_file_t; ') systemd_exec_systemctl($1) init_reload_services($1) systemd_read_fifo_file_passwd_run($1) allow $1 cockpit_unit_file_t:file read_file_perms; allow $1 cockpit_unit_file_t:service manage_service_perms; ps_process_pattern($1, cockpit_ws_t) ') ') ######################################## ## ## All of the rules required to administrate ## an cockpit environment ## ## ## ## Domain allowed access. ## ## ## # ifndef(`cockpit_admin',` interface(`cockpit_admin',` gen_require(` type cockpit_ws_t; type cockpit_session_t; type cockpit_var_lib_t; type cockpit_var_run_t; type cockpit_unit_file_t; ') allow $1 cockpit_ws_t:process { signal_perms }; ps_process_pattern($1, cockpit_ws_t) allow $1 cockpit_session_t:process { signal_perms }; ps_process_pattern($1, cockpit_session_t) tunable_policy(`deny_ptrace',`',` allow $1 cockpit_ws_t:process ptrace; allow $1 cockpit_session_t:process ptrace; ') files_search_var_lib($1) admin_pattern($1, cockpit_var_lib_t) files_search_pids($1) admin_pattern($1, cockpit_var_run_t) cockpit_systemctl($1) admin_pattern($1, cockpit_unit_file_t) allow $1 cockpit_unit_file_t:service all_service_perms; optional_policy(` systemd_passwd_agent_exec($1) systemd_read_fifo_file_passwd_run($1) ') ') ')