Chris PeBenito b52122
policy_module(abrt, 1.1.1)
Chris PeBenito e3a90e
Chris PeBenito e3a90e
########################################
Chris PeBenito e3a90e
#
Chris PeBenito e3a90e
# Declarations
Chris PeBenito e3a90e
#
Chris PeBenito e3a90e
Dan Walsh 3eaa99
## <desc>
Dominick Grift 9a0f79
##	

Dominick Grift 9a0f79
##	Allow ABRT to modify public files
Dominick Grift 9a0f79
##	used for public file transfer services.
Dominick Grift 9a0f79
##	

Dan Walsh 3eaa99
## </desc>
Dan Walsh 3eaa99
gen_tunable(abrt_anon_write, false)
Dan Walsh 3eaa99
Chris PeBenito e3a90e
type abrt_t;
Chris PeBenito e3a90e
type abrt_exec_t;
Chris PeBenito e3a90e
init_daemon_domain(abrt_t, abrt_exec_t)
Chris PeBenito e3a90e
Chris PeBenito e3a90e
type abrt_initrc_exec_t;
Chris PeBenito e3a90e
init_script_file(abrt_initrc_exec_t)
Chris PeBenito e3a90e
Chris PeBenito e3a90e
# etc files
Chris PeBenito e3a90e
type abrt_etc_t;
Chris PeBenito e3a90e
files_config_file(abrt_etc_t)
Chris PeBenito e3a90e
Chris PeBenito e3a90e
# log files
Chris PeBenito e3a90e
type abrt_var_log_t;
Chris PeBenito e3a90e
logging_log_file(abrt_var_log_t)
Chris PeBenito e3a90e
Chris PeBenito e3a90e
# tmp files
Chris PeBenito e3a90e
type abrt_tmp_t;
Chris PeBenito e3a90e
files_tmp_file(abrt_tmp_t)
Chris PeBenito e3a90e
Chris PeBenito e3a90e
# var/cache files
Chris PeBenito e3a90e
type abrt_var_cache_t;
Chris PeBenito e3a90e
files_type(abrt_var_cache_t)
Chris PeBenito e3a90e
Chris PeBenito e3a90e
# pid files
Chris PeBenito e3a90e
type abrt_var_run_t;
Chris PeBenito e3a90e
files_pid_file(abrt_var_run_t)
Chris PeBenito e3a90e
Chris PeBenito 1b2f08
# type needed to allow all domains
Chris PeBenito 1b2f08
# to handle /var/cache/abrt
Chris PeBenito 1b2f08
type abrt_helper_t;
Chris PeBenito 1b2f08
type abrt_helper_exec_t;
Chris PeBenito 1b2f08
application_domain(abrt_helper_t, abrt_helper_exec_t)
Chris PeBenito 1b2f08
role system_r types abrt_helper_t;
Chris PeBenito 1b2f08
Chris PeBenito 1b2f08
ifdef(`enable_mcs',`
Chris PeBenito 1b2f08
	init_ranged_daemon_domain(abrt_t, abrt_exec_t, s0 - mcs_systemhigh)
Chris PeBenito 1b2f08
')
Chris PeBenito 1b2f08
Chris PeBenito e3a90e
########################################
Chris PeBenito e3a90e
#
Chris PeBenito e3a90e
# abrt local policy
Chris PeBenito e3a90e
#
Chris PeBenito e3a90e
Chris PeBenito 1b2f08
allow abrt_t self:capability { chown kill setuid setgid sys_nice dac_override };
Chris PeBenito 1b2f08
dontaudit abrt_t self:capability sys_rawio;
Dan Walsh 3eaa99
allow abrt_t self:process { sigkill signal signull setsched getsched };
Chris PeBenito e3a90e
Chris PeBenito e3a90e
allow abrt_t self:fifo_file rw_fifo_file_perms;
Chris PeBenito e3a90e
allow abrt_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito e3a90e
allow abrt_t self:udp_socket create_socket_perms;
Chris PeBenito e3a90e
allow abrt_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito e3a90e
allow abrt_t self:netlink_route_socket r_netlink_socket_perms;
Chris PeBenito e3a90e
Chris PeBenito e3a90e
# abrt etc files
Chris PeBenito e3a90e
rw_files_pattern(abrt_t, abrt_etc_t, abrt_etc_t)
Chris PeBenito e3a90e
Chris PeBenito e3a90e
# log file
Chris PeBenito e3a90e
manage_files_pattern(abrt_t, abrt_var_log_t, abrt_var_log_t)
Chris PeBenito e3a90e
logging_log_filetrans(abrt_t, abrt_var_log_t, file)
Chris PeBenito e3a90e
Chris PeBenito 1b2f08
# abrt tmp files
Chris PeBenito e3a90e
manage_dirs_pattern(abrt_t, abrt_tmp_t, abrt_tmp_t)
Chris PeBenito e3a90e
manage_files_pattern(abrt_t, abrt_tmp_t, abrt_tmp_t)
Chris PeBenito e3a90e
files_tmp_filetrans(abrt_t, abrt_tmp_t, { file dir })
Dan Walsh 3eaa99
can_exec(abrt_t, abrt_tmp_t)
Chris PeBenito e3a90e
Chris PeBenito e3a90e
# abrt var/cache files
Chris PeBenito e3a90e
manage_files_pattern(abrt_t, abrt_var_cache_t, abrt_var_cache_t)
Chris PeBenito e3a90e
manage_dirs_pattern(abrt_t, abrt_var_cache_t, abrt_var_cache_t)
Chris PeBenito 1b2f08
manage_lnk_files_pattern(abrt_t, abrt_var_cache_t, abrt_var_cache_t)
Chris PeBenito e3a90e
files_var_filetrans(abrt_t, abrt_var_cache_t, { file dir })
Chris PeBenito b52122
files_spool_filetrans(abrt_t, abrt_var_cache_t, dir)
Chris PeBenito e3a90e
Chris PeBenito e3a90e
# abrt pid files
Chris PeBenito e3a90e
manage_files_pattern(abrt_t, abrt_var_run_t, abrt_var_run_t)
Chris PeBenito e3a90e
manage_dirs_pattern(abrt_t, abrt_var_run_t, abrt_var_run_t)
Chris PeBenito b52122
manage_sock_files_pattern(abrt_t, abrt_var_run_t, abrt_var_run_t)
Chris PeBenito 1b2f08
manage_lnk_files_pattern(abrt_t, abrt_var_run_t, abrt_var_run_t)
Dan Walsh 3eaa99
files_pid_filetrans(abrt_t, abrt_var_run_t, { file dir sock_file })
Chris PeBenito e3a90e
Chris PeBenito e3a90e
kernel_read_ring_buffer(abrt_t)
Chris PeBenito e3a90e
kernel_read_system_state(abrt_t)
Chris PeBenito e3a90e
kernel_rw_kernel_sysctl(abrt_t)
Chris PeBenito e3a90e
Chris PeBenito e3a90e
corecmd_exec_bin(abrt_t)
Chris PeBenito e3a90e
corecmd_exec_shell(abrt_t)
Chris PeBenito 1b2f08
corecmd_read_all_executables(abrt_t)
Chris PeBenito e3a90e
Dominick Grift cd1734
corenet_all_recvfrom_netlabel(abrt_t)
Dominick Grift cd1734
corenet_all_recvfrom_unlabeled(abrt_t)
Dominick Grift cd1734
corenet_tcp_sendrecv_generic_if(abrt_t)
Dominick Grift cd1734
corenet_tcp_sendrecv_generic_node(abrt_t)
Dominick Grift cd1734
corenet_tcp_sendrecv_generic_port(abrt_t)
Chris PeBenito 1b2f08
corenet_tcp_bind_generic_node(abrt_t)
Chris PeBenito 1b2f08
corenet_tcp_connect_http_port(abrt_t)
Chris PeBenito 1b2f08
corenet_tcp_connect_ftp_port(abrt_t)
Chris PeBenito 1b2f08
corenet_tcp_connect_all_ports(abrt_t)
Chris PeBenito 1b2f08
corenet_sendrecv_http_client_packets(abrt_t)
Chris PeBenito 1b2f08
Chris PeBenito 1b2f08
dev_getattr_all_chr_files(abrt_t)
Chris PeBenito e3a90e
dev_read_urand(abrt_t)
Chris PeBenito 1b2f08
dev_rw_sysfs(abrt_t)
Chris PeBenito 1b2f08
dev_dontaudit_read_raw_memory(abrt_t)
Chris PeBenito 1b2f08
Chris PeBenito 1b2f08
domain_getattr_all_domains(abrt_t)
Chris PeBenito 1b2f08
domain_read_all_domains_state(abrt_t)
Chris PeBenito 1b2f08
domain_signull_all_domains(abrt_t)
Chris PeBenito e3a90e
Chris PeBenito e3a90e
files_getattr_all_files(abrt_t)
Chris PeBenito e3a90e
files_read_etc_files(abrt_t)
Chris PeBenito 1b2f08
files_read_var_symlinks(abrt_t)
Chris PeBenito 1b2f08
files_read_var_lib_files(abrt_t)
Chris PeBenito e3a90e
files_read_usr_files(abrt_t)
Chris PeBenito 1b2f08
files_read_generic_tmp_files(abrt_t)
Chris PeBenito 1b2f08
files_read_kernel_modules(abrt_t)
Chris PeBenito 1b2f08
files_dontaudit_list_default(abrt_t)
Chris PeBenito 1b2f08
files_dontaudit_read_default_files(abrt_t)
Dan Walsh 3eaa99
files_dontaudit_read_all_symlinks(abrt_t)
Dan Walsh 3eaa99
files_dontaudit_getattr_all_sockets(abrt_t)
Chris PeBenito e3a90e
Chris PeBenito e3a90e
fs_list_inotifyfs(abrt_t)
Chris PeBenito e3a90e
fs_getattr_all_fs(abrt_t)
Chris PeBenito e3a90e
fs_getattr_all_dirs(abrt_t)
Chris PeBenito 1b2f08
fs_read_fusefs_files(abrt_t)
Chris PeBenito 1b2f08
fs_read_noxattr_fs_files(abrt_t)
Chris PeBenito 1b2f08
fs_read_nfs_files(abrt_t)
Chris PeBenito 1b2f08
fs_read_nfs_symlinks(abrt_t)
Chris PeBenito 1b2f08
fs_search_all(abrt_t)
Chris PeBenito e3a90e
Dan Walsh 3eaa99
sysnet_dns_name_resolve(abrt_t)
Chris PeBenito e3a90e
Chris PeBenito e3a90e
logging_read_generic_logs(abrt_t)
Chris PeBenito e3a90e
logging_send_syslog_msg(abrt_t)
Chris PeBenito e3a90e
Dominick Grift 834062
miscfiles_read_generic_certs(abrt_t)
Chris PeBenito e3a90e
miscfiles_read_localization(abrt_t)
Chris PeBenito e3a90e
Chris PeBenito 1b2f08
userdom_dontaudit_read_user_home_content_files(abrt_t)
Dan Walsh 3eaa99
userdom_dontaudit_read_admin_home_files(abrt_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
tunable_policy(`abrt_anon_write',`
Dominick Grift 9a0f79
	miscfiles_manage_public_files(abrt_t)
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
optional_policy(`
Dan Walsh 3eaa99
	apache_read_modules(abrt_t)
Dan Walsh 3eaa99
')
Chris PeBenito e3a90e
Chris PeBenito e3a90e
optional_policy(`
Chris PeBenito 1b2f08
	dbus_system_domain(abrt_t, abrt_exec_t)
Chris PeBenito e3a90e
')
Chris PeBenito e3a90e
Chris PeBenito e3a90e
optional_policy(`
Chris PeBenito 1b2f08
	nis_use_ypbind(abrt_t)
Chris PeBenito 1b2f08
')
Chris PeBenito 1b2f08
Chris PeBenito 1b2f08
optional_policy(`
Dan Walsh 3eaa99
	nsplugin_read_rw_files(abrt_t)
Dan Walsh 3eaa99
	nsplugin_read_home(abrt_t)
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
optional_policy(`
Dominick Grift 9a0f79
	policykit_dbus_chat(abrt_t)
Chris PeBenito 1b2f08
	policykit_domtrans_auth(abrt_t)
Chris PeBenito 1b2f08
	policykit_read_lib(abrt_t)
Chris PeBenito 1b2f08
	policykit_read_reload(abrt_t)
Chris PeBenito 1b2f08
')
Chris PeBenito 1b2f08
Chris PeBenito b52122
optional_policy(`
Chris PeBenito b52122
	prelink_exec(abrt_t)
Chris PeBenito b52122
	libs_exec_ld_so(abrt_t)
Chris PeBenito b52122
	corecmd_exec_all_executables(abrt_t)
Chris PeBenito b52122
')
Chris PeBenito b52122
Chris PeBenito 1b2f08
# to install debuginfo packages
Chris PeBenito 1b2f08
optional_policy(`
Chris PeBenito 1b2f08
	rpm_exec(abrt_t)
Chris PeBenito 1b2f08
	rpm_dontaudit_manage_db(abrt_t)
Chris PeBenito 1b2f08
	rpm_manage_cache(abrt_t)
Chris PeBenito 1b2f08
	rpm_manage_pid_files(abrt_t)
Chris PeBenito 1b2f08
	rpm_read_db(abrt_t)
Chris PeBenito 1b2f08
	rpm_signull(abrt_t)
Chris PeBenito e3a90e
')
Chris PeBenito e3a90e
Chris PeBenito e3a90e
# to run mailx plugin
Chris PeBenito e3a90e
optional_policy(`
Chris PeBenito e3a90e
	sendmail_domtrans(abrt_t)
Chris PeBenito e3a90e
')
Chris PeBenito 1b2f08
Chris PeBenito 1b2f08
optional_policy(`
Dan Walsh 3eaa99
	sosreport_domtrans(abrt_t)
Dan Walsh 3eaa99
	sosreport_read_tmp_files(abrt_t)
Dan Walsh 3eaa99
	sosreport_delete_tmp_files(abrt_t)
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
optional_policy(`
Chris PeBenito 1b2f08
	sssd_stream_connect(abrt_t)
Chris PeBenito 1b2f08
')
Chris PeBenito 1b2f08
Chris PeBenito 1b2f08
########################################
Chris PeBenito 1b2f08
#
Dominick Grift 9a0f79
# abrt-helper local policy
Chris PeBenito 1b2f08
#
Chris PeBenito 1b2f08
Chris PeBenito b52122
allow abrt_helper_t self:capability { chown setgid sys_nice };
Chris PeBenito 1b2f08
allow abrt_helper_t self:process signal;
Chris PeBenito 1b2f08
Chris PeBenito 1b2f08
read_files_pattern(abrt_helper_t, abrt_etc_t, abrt_etc_t)
Chris PeBenito 1b2f08
Chris PeBenito b52122
files_search_spool(abrt_helper_t)
Chris PeBenito 1b2f08
manage_dirs_pattern(abrt_helper_t, abrt_var_cache_t, abrt_var_cache_t)
Chris PeBenito 1b2f08
manage_files_pattern(abrt_helper_t, abrt_var_cache_t, abrt_var_cache_t)
Chris PeBenito 1b2f08
manage_lnk_files_pattern(abrt_helper_t, abrt_var_cache_t, abrt_var_cache_t)
Chris PeBenito 1b2f08
files_var_filetrans(abrt_helper_t, abrt_var_cache_t, { file dir })
Chris PeBenito 1b2f08
Chris PeBenito 1b2f08
read_files_pattern(abrt_helper_t, abrt_var_run_t, abrt_var_run_t)
Chris PeBenito 1b2f08
read_lnk_files_pattern(abrt_helper_t, abrt_var_run_t, abrt_var_run_t)
Chris PeBenito 1b2f08
Chris PeBenito 1b2f08
domain_read_all_domains_state(abrt_helper_t)
Chris PeBenito 1b2f08
Chris PeBenito 1b2f08
files_read_etc_files(abrt_helper_t)
Dan Walsh 3eaa99
files_dontaudit_all_non_security_leaks(abrt_helper_t)
Chris PeBenito 1b2f08
Chris PeBenito 1b2f08
fs_list_inotifyfs(abrt_helper_t)
Chris PeBenito 1b2f08
fs_getattr_all_fs(abrt_helper_t)
Chris PeBenito 1b2f08
Chris PeBenito 1b2f08
auth_use_nsswitch(abrt_helper_t)
Chris PeBenito 1b2f08
Chris PeBenito 1b2f08
logging_send_syslog_msg(abrt_helper_t)
Chris PeBenito 1b2f08
Chris PeBenito 1b2f08
miscfiles_read_localization(abrt_helper_t)
Chris PeBenito 1b2f08
Chris PeBenito 1b2f08
term_dontaudit_use_all_ttys(abrt_helper_t)
Chris PeBenito 1b2f08
term_dontaudit_use_all_ptys(abrt_helper_t)
Chris PeBenito 1b2f08
Dominick Grift 9a0f79
ifdef(`hide_broken_symptoms',`
Dan Walsh 3eaa99
	domain_dontaudit_leaks(abrt_helper_t)
Chris PeBenito 1b2f08
	userdom_dontaudit_read_user_home_content_files(abrt_helper_t)
Chris PeBenito 1b2f08
	userdom_dontaudit_read_user_tmp_files(abrt_helper_t)
Chris PeBenito 1b2f08
	dev_dontaudit_read_all_blk_files(abrt_helper_t)
Chris PeBenito 1b2f08
	dev_dontaudit_read_all_chr_files(abrt_helper_t)
Chris PeBenito 1b2f08
	dev_dontaudit_write_all_chr_files(abrt_helper_t)
Chris PeBenito 1b2f08
	dev_dontaudit_write_all_blk_files(abrt_helper_t)
Chris PeBenito 1b2f08
	fs_dontaudit_rw_anon_inodefs_files(abrt_helper_t)
Dominick Grift ef521e
Dominick Grift ef521e
	optional_policy(`
Dominick Grift ef521e
		rpm_dontaudit_leaks(abrt_helper_t)
Dominick Grift ef521e
	')
Chris PeBenito 1b2f08
')
Dan Walsh 3eaa99
Dominick Grift 9a0f79
ifdef(`hide_broken_symptoms',`
Dan Walsh 3eaa99
	gen_require(`
Dominick Grift 9a0f79
		attribute domain;
Dan Walsh 3eaa99
	')
Dan Walsh 3eaa99
Dominick Grift 9a0f79
	allow abrt_t self:capability sys_resource;
Dan Walsh 3eaa99
	allow abrt_t domain:file write;
Dan Walsh 3eaa99
	allow abrt_t domain:process setrlimit;
Dan Walsh 3eaa99
')