## fwupd is a daemon to allow session software to update device firmware ######################################## ## ## Execute fwupd_exec_t in the fwupd domain. ## ## ## ## Domain allowed to transition. ## ## # interface(`fwupd_domtrans',` gen_require(` type fwupd_t, fwupd_exec_t; ') corecmd_search_bin($1) domtrans_pattern($1, fwupd_exec_t, fwupd_t) ') ###################################### ## ## Execute fwupd in the caller domain. ## ## ## ## Domain allowed access. ## ## # interface(`fwupd_exec',` gen_require(` type fwupd_exec_t; ') corecmd_search_bin($1) can_exec($1, fwupd_exec_t) ') ######################################## ## ## Read fwupd process state files. ## ## ## ## Domain allowed access. ## ## # interface(`fwupd_read_state',` gen_require(` type fwupd_t; ') ps_process_pattern($1, fwupd_t) ') ######################################## ## ## Search fwupd cache directories. ## ## ## ## Domain allowed access. ## ## # interface(`fwupd_search_cache',` gen_require(` type fwupd_cache_t; ') allow $1 fwupd_cache_t:dir search_dir_perms; files_search_var($1) ') ######################################## ## ## Allow the specified domain to delete ## fwupd cache. ## ## ## ## Domain allowed access. ## ## # interface(`fwupd_delete_cache_files',` gen_require(` type fwupd_cache_t; ') allow $1 fwupd_cache_t:dir rmdir; delete_files_pattern($1, fwupd_cache_t, fwupd_cache_t) ') ######################################## ## ## Read fwupd cache files. ## ## ## ## Domain allowed access. ## ## # interface(`fwupd_read_cache_files',` gen_require(` type fwupd_cache_t; ') files_search_var($1) read_files_pattern($1, fwupd_cache_t, fwupd_cache_t) ') ######################################## ## ## Create, read, write, and delete ## fwupd cache files. ## ## ## ## Domain allowed access. ## ## # interface(`fwupd_manage_cache_files',` gen_require(` type fwupd_cache_t; ') files_search_var($1) manage_files_pattern($1, fwupd_cache_t, fwupd_cache_t) ') ######################################## ## ## Manage fwupd cache dirs. ## ## ## ## Domain allowed access. ## ## # interface(`fwupd_manage_cache_dirs',` gen_require(` type fwupd_cache_t; ') files_search_var($1) manage_dirs_pattern($1, fwupd_cache_t, fwupd_cache_t) ') ######################################## ## ## Search fwupd lib directories. ## ## ## ## Domain allowed access. ## ## # interface(`fwupd_search_lib',` gen_require(` type fwupd_var_lib_t; ') allow $1 fwupd_var_lib_t:dir search_dir_perms; files_search_var_lib($1) ') ######################################## ## ## Read fwupd lib files. ## ## ## ## Domain allowed access. ## ## # interface(`fwupd_read_lib_files',` gen_require(` type fwupd_var_lib_t; ') files_search_var_lib($1) read_files_pattern($1, fwupd_var_lib_t, fwupd_var_lib_t) ') ######################################## ## ## Manage fwupd lib files. ## ## ## ## Domain allowed access. ## ## # interface(`fwupd_manage_lib_files',` gen_require(` type fwupd_var_lib_t; ') files_search_var_lib($1) manage_files_pattern($1, fwupd_var_lib_t, fwupd_var_lib_t) ') ######################################## ## ## Manage fwupd lib directories. ## ## ## ## Domain allowed access. ## ## # interface(`fwupd_manage_lib_dirs',` gen_require(` type fwupd_var_lib_t; ') files_search_var_lib($1) manage_dirs_pattern($1, fwupd_var_lib_t, fwupd_var_lib_t) ') ######################################## ## ## Execute fwupd server in the fwupd domain. ## ## ## ## Domain allowed to transition. ## ## # interface(`fwupd_systemctl',` gen_require(` type fwupd_t; type fwupd_unit_file_t; ') systemd_exec_systemctl($1) systemd_read_fifo_file_passwd_run($1) allow $1 fwupd_unit_file_t:file read_file_perms; allow $1 fwupd_unit_file_t:service manage_service_perms; ps_process_pattern($1, fwupd_t) ') ######################################## ## ## All of the rules required to administrate ## an fwupd environment ## ## ## ## Domain allowed access. ## ## # interface(`fwupd_admin',` gen_require(` type fwupd_t; type fwupd_cache_t; type fwupd_var_lib_t; type fwupd_unit_file_t; ') allow $1 fwupd_t:process { signal_perms }; ps_process_pattern($1, fwupd_t) tunable_policy(`deny_ptrace',`',` allow $1 fwupd_t:process ptrace; ') files_search_var($1) admin_pattern($1, fwupd_cache_t) files_search_var_lib($1) admin_pattern($1, fwupd_var_lib_t) fwupd_systemctl($1) admin_pattern($1, fwupd_unit_file_t) allow $1 fwupd_unit_file_t:service all_service_perms; optional_policy(` systemd_passwd_agent_exec($1) systemd_read_fifo_file_passwd_run($1) ') ') ######################################## ## ## Send and receive messages from ## fwupd over dbus. ## ## ## ## Domain allowed access. ## ## # interface(`fwupd_dbus_chat',` gen_require(` type fwupd_t; class dbus send_msg; ') allow $1 fwupd_t:dbus send_msg; allow fwupd_t $1:dbus send_msg; ')