diff --git a/policy/modules/contrib/insights_client.if b/policy/modules/contrib/insights_client.if index 3028e79eff..9e9ed678f7 100644 --- a/policy/modules/contrib/insights_client.if +++ b/policy/modules/contrib/insights_client.if @@ -320,3 +320,24 @@ interface(`insights_client_write_tmp',` files_search_tmp($1) write_files_pattern($1, insights_client_tmp_t, insights_client_tmp_t) ') + +######################################## +## +## Allow explicit transition to insights_core_t domain. +## +## +## +## Domain allowed to transition. +## +## +# +interface(`insights_domtrans_core',` + gen_require(` + type insights_core_t; + ') + + allow $1 insights_core_t: process transition; + allow insights_core_t $1:fd use; + allow insights_core_t $1:fifo_file rw_file_perms; + allow insights_core_t $1:process sigchld; +') diff --git a/policy/modules/contrib/insights_client.te b/policy/modules/contrib/insights_client.te index 1c7f2040dd..58e0896b3d 100644 --- a/policy/modules/contrib/insights_client.te +++ b/policy/modules/contrib/insights_client.te @@ -43,6 +43,13 @@ files_tmpfs_file(insights_client_tmpfs_t) type insights_client_unit_file_t; systemd_unit_file(insights_client_unit_file_t) +type insights_core_t; +role system_r types insights_core_t; +domain_type(insights_core_t) + +type insights_core_tmp_t; +files_tmp_file(insights_core_tmp_t) + ######################################## # # insights_client local policy @@ -417,3 +424,84 @@ optional_policy(` optional_policy(` virt_stream_connect(insights_client_t) ') + +######################################## +# +# insights_core local policy +# + +# an explicit transition using setexecfilecon() +insights_domtrans_core(insights_client_t) + +allow insights_core_t self:tcp_socket create_stream_socket_perms; +allow insights_core_t self:netlink_route_socket r_netlink_socket_perms; +allow insights_core_t self:udp_socket create_socket_perms; + +manage_dirs_pattern(insights_core_t, insights_core_tmp_t, insights_core_tmp_t) +manage_files_pattern(insights_core_t, insights_core_tmp_t, insights_core_tmp_t) +files_tmp_filetrans(insights_core_t, insights_core_tmp_t, { dir file }) + +read_files_pattern(insights_core_t, insights_client_cache_t, insights_client_cache_t) +create_files_pattern(insights_core_t, insights_client_cache_t, insights_client_cache_t) +allow insights_core_t insights_client_cache_t:file { write }; + +read_files_pattern(insights_core_t, insights_client_etc_t, insights_client_etc_t) +create_files_pattern(insights_core_t, insights_client_etc_t, insights_client_etc_t) +#allow insights_core_t insights_client_etc_t:file { write }; +allow insights_core_t insights_client_etc_rw_t:file { getattr ioctl open read write }; + +rw_files_pattern(insights_core_t, insights_client_var_lib_t, insights_client_var_lib_t) +create_files_pattern(insights_core_t, insights_client_var_lib_t, insights_client_var_lib_t) + +append_files_pattern(insights_core_t, insights_client_var_log_t, insights_client_var_log_t) +create_files_pattern(insights_core_t, insights_client_var_log_t, insights_client_var_log_t) +allow insights_core_t insights_client_tmp_t:file { open }; +# temporary +allow insights_core_t user_tmp_t:dir search; + +kernel_read_proc_files(insights_core_t) + +corecmd_bin_entry_type(insights_core_t) +corecmd_exec_bin(insights_core_t) + +corenet_tcp_bind_generic_node(insights_core_t) +corenet_tcp_connect_http_port(insights_core_t) + +dev_read_sysfs(insights_core_t) + +optional_policy(` + auth_read_passwd_file(insights_core_t) +') + +optional_policy(` + gnome_search_gconf(insights_core_t) +') + +optional_policy(` + gpg_entry_type(insights_core_t) + gpg_exec(insights_core_t) +') + +optional_policy(` + init_rw_stream_sockets(insights_core_t) +') + +optional_policy(` + libs_exec_ldconfig(insights_core_t) +') + +optional_policy(` + miscfiles_read_generic_certs(insights_core_t) +') + +optional_policy(` + rhsmcertd_read_config_files(insights_core_t) +') + +optional_policy(` + sysnet_read_config(insights_core_t) +') + +optional_policy(` + userdom_search_user_tmp_dirs(insights_core_t) +')