diff --git a/policy/modules/services/abrt.fc b/policy/modules/services/abrt.fc
index d2b692d..1efe354 100644
--- a/policy/modules/services/abrt.fc
+++ b/policy/modules/services/abrt.fc
@@ -1,11 +1,18 @@
-/etc/abrt(/.*)? gen_context(system_u:object_r:abrt_etc_t,s0)
+/etc/abrt(/.*)? gen_context(system_u:object_r:abrt_etc_t,s0)
/etc/rc\.d/init\.d/abrt -- gen_context(system_u:object_r:abrt_initrc_exec_t,s0)
-/usr/sbin/abrt -- gen_context(system_u:object_r:abrt_exec_t,s0)
+/usr/bin/abrt-pyhook-helper -- gen_context(system_u:object_r:abrt_helper_exec_t,s0)
+
+/usr/libexec/abrt-pyhook-helper -- gen_context(system_u:object_r:abrt_helper_exec_t,s0)
+/usr/libexec/abrt-hook-python -- gen_context(system_u:object_r:abrt_helper_exec_t,s0)
+
+/usr/sbin/abrtd -- gen_context(system_u:object_r:abrt_exec_t,s0)
/var/cache/abrt(/.*)? gen_context(system_u:object_r:abrt_var_cache_t,s0)
+/var/cache/abrt-di(/.*)? gen_context(system_u:object_r:abrt_var_cache_t,s0)
/var/log/abrt-logger -- gen_context(system_u:object_r:abrt_var_log_t,s0)
-/var/run/abrt\.pid -- gen_context(system_u:object_r:abrt_var_run_t,s0)
+/var/run/abrt\.pid -- gen_context(system_u:object_r:abrt_var_run_t,s0)
/var/run/abrt\.lock -- gen_context(system_u:object_r:abrt_var_run_t,s0)
+/var/run/abrt(/.*)? gen_context(system_u:object_r:abrt_var_run_t,s0)
diff --git a/policy/modules/services/abrt.if b/policy/modules/services/abrt.if
index b2b1657..4b8a868 100644
--- a/policy/modules/services/abrt.if
+++ b/policy/modules/services/abrt.if
@@ -21,7 +21,7 @@ interface(`abrt_domtrans',`
######################################
##
-## Execute abrt
+## Execute abrt in the caller domain.
##
##
##
@@ -38,6 +38,126 @@ interface(`abrt_exec',`
can_exec($1, abrt_exec_t)
')
+########################################
+##
+## Send a null signal to abrt.
+##
+##
+##
+## Domain allowed access.
+##
+##
+#
+interface(`abrt_signull',`
+ gen_require(`
+ type abrt_t;
+ ')
+
+ allow $1 abrt_t:process signull;
+')
+
+########################################
+##
+## Allow the domain to read abrt state files in /proc.
+##
+##
+##
+## Domain to allow access.
+##
+##
+#
+interface(`abrt_read_state',`
+ gen_require(`
+ type abrt_t;
+ ')
+
+ ps_process_pattern($1, abrt_t)
+')
+
+########################################
+##
+## Send and receive messages from
+## abrt over dbus.
+##
+##
+##
+## Domain allowed access.
+##
+##
+#
+interface(`abrt_dbus_chat',`
+ gen_require(`
+ type abrt_t;
+ class dbus send_msg;
+ ')
+
+ allow $1 abrt_t:dbus send_msg;
+ allow abrt_t $1:dbus send_msg;
+')
+
+#####################################
+##
+## Execute abrt-helper in the abrt-helper domain.
+##
+##
+##
+## Domain allowed access.
+##
+##
+#
+interface(`abrt_domtrans_helper',`
+ gen_require(`
+ type abrt_helper_t, abrt_helper_exec_t;
+ ')
+
+ domtrans_pattern($1, abrt_helper_exec_t, abrt_helper_t)
+')
+
+########################################
+##
+## Execute abrt helper in the abrt_helper domain, and
+## allow the specified role the abrt_helper domain.
+##
+##
+##
+## Domain allowed access.
+##
+##
+##
+##
+## Role allowed access.
+##
+##
+##
+#
+interface(`abrt_run_helper',`
+ gen_require(`
+ type abrt_helper_t;
+ ')
+
+ abrt_domtrans_helper($1)
+ role $2 types abrt_helper_t;
+')
+
+########################################
+##
+## Send and receive messages from
+## abrt over dbus.
+##
+##
+##
+## Domain allowed access.
+##
+##
+#
+interface(`abrt_cache_manage',`
+ gen_require(`
+ type abrt_var_cache_t;
+ ')
+
+ manage_files_pattern($1, abrt_var_cache_t, abrt_var_cache_t)
+')
+
####################################
##
## Read abrt configuration file.
@@ -76,9 +196,28 @@ interface(`abrt_read_log',`
read_files_pattern($1, abrt_var_log_t, abrt_var_log_t)
')
+######################################
+##
+## Read abrt PID files.
+##
+##
+##
+## Domain allowed access.
+##
+##
+#
+interface(`abrt_read_pid_files',`
+ gen_require(`
+ type abrt_var_run_t;
+ ')
+
+ files_search_pids($1)
+ read_files_pattern($1, abrt_var_run_t, abrt_var_run_t)
+')
+
#####################################
##
-## All of the rules required to administrate
+## All of the rules required to administrate
## an abrt environment
##
##
@@ -95,7 +234,7 @@ interface(`abrt_read_log',`
#
interface(`abrt_admin',`
gen_require(`
- type abrt_t, abrt_etc_t;
+ type abrt_t, abrt_etc_t;
type abrt_var_cache_t, abrt_var_log_t;
type abrt_var_run_t, abrt_tmp_t;
type abrt_initrc_exec_t;
@@ -113,7 +252,7 @@ interface(`abrt_admin',`
admin_pattern($1, abrt_etc_t)
logging_search_logs($1)
- admin_pattern($1, abrt_var_log_t)
+ admin_pattern($1, abrt_var_log_t)
files_search_var($1)
admin_pattern($1, abrt_var_cache_t)
diff --git a/policy/modules/services/abrt.te b/policy/modules/services/abrt.te
index 0f48874..34ed371 100644
--- a/policy/modules/services/abrt.te
+++ b/policy/modules/services/abrt.te
@@ -1,5 +1,5 @@
-policy_module(abrt, 1.0.1)
+policy_module(abrt, 1.0.2)
########################################
#
@@ -33,12 +33,24 @@ files_type(abrt_var_cache_t)
type abrt_var_run_t;
files_pid_file(abrt_var_run_t)
+# type needed to allow all domains
+# to handle /var/cache/abrt
+type abrt_helper_t;
+type abrt_helper_exec_t;
+application_domain(abrt_helper_t, abrt_helper_exec_t)
+role system_r types abrt_helper_t;
+
+ifdef(`enable_mcs',`
+ init_ranged_daemon_domain(abrt_t, abrt_exec_t, s0 - mcs_systemhigh)
+')
+
########################################
#
# abrt local policy
#
-allow abrt_t self:capability { setuid setgid sys_nice dac_override };
+allow abrt_t self:capability { chown kill setuid setgid sys_nice dac_override };
+dontaudit abrt_t self:capability sys_rawio;
allow abrt_t self:process { signal signull setsched getsched };
allow abrt_t self:fifo_file rw_fifo_file_perms;
@@ -54,7 +66,7 @@ rw_files_pattern(abrt_t, abrt_etc_t, abrt_etc_t)
manage_files_pattern(abrt_t, abrt_var_log_t, abrt_var_log_t)
logging_log_filetrans(abrt_t, abrt_var_log_t, file)
-# abrt tmp files
+# abrt tmp files
manage_dirs_pattern(abrt_t, abrt_tmp_t, abrt_tmp_t)
manage_files_pattern(abrt_t, abrt_tmp_t, abrt_tmp_t)
files_tmp_filetrans(abrt_t, abrt_tmp_t, { file dir })
@@ -62,11 +74,13 @@ files_tmp_filetrans(abrt_t, abrt_tmp_t, { file dir })
# abrt var/cache files
manage_files_pattern(abrt_t, abrt_var_cache_t, abrt_var_cache_t)
manage_dirs_pattern(abrt_t, abrt_var_cache_t, abrt_var_cache_t)
+manage_lnk_files_pattern(abrt_t, abrt_var_cache_t, abrt_var_cache_t)
files_var_filetrans(abrt_t, abrt_var_cache_t, { file dir })
# abrt pid files
manage_files_pattern(abrt_t, abrt_var_run_t, abrt_var_run_t)
manage_dirs_pattern(abrt_t, abrt_var_run_t, abrt_var_run_t)
+manage_lnk_files_pattern(abrt_t, abrt_var_run_t, abrt_var_run_t)
files_pid_filetrans(abrt_t, abrt_var_run_t, { file dir })
kernel_read_ring_buffer(abrt_t)
@@ -75,25 +89,47 @@ kernel_rw_kernel_sysctl(abrt_t)
corecmd_exec_bin(abrt_t)
corecmd_exec_shell(abrt_t)
+corecmd_read_all_executables(abrt_t)
corenet_all_recvfrom_netlabel(abrt_t)
corenet_all_recvfrom_unlabeled(abrt_t)
-corenet_sendrecv_http_client_packets(abrt_t)
-corenet_tcp_bind_generic_node(abrt_t)
-corenet_tcp_connect_http_port(abrt_t)
corenet_tcp_sendrecv_generic_if(abrt_t)
corenet_tcp_sendrecv_generic_node(abrt_t)
corenet_tcp_sendrecv_generic_port(abrt_t)
+corenet_tcp_bind_generic_node(abrt_t)
+corenet_tcp_connect_http_port(abrt_t)
+corenet_tcp_connect_ftp_port(abrt_t)
+corenet_tcp_connect_all_ports(abrt_t)
+corenet_sendrecv_http_client_packets(abrt_t)
+
+dev_getattr_all_chr_files(abrt_t)
dev_read_urand(abrt_t)
+dev_rw_sysfs(abrt_t)
+dev_dontaudit_read_raw_memory(abrt_t)
+
+domain_getattr_all_domains(abrt_t)
+domain_read_all_domains_state(abrt_t)
+domain_signull_all_domains(abrt_t)
files_getattr_all_files(abrt_t)
files_read_etc_files(abrt_t)
+files_read_var_symlinks(abrt_t)
+files_read_var_lib_files(abrt_t)
files_read_usr_files(abrt_t)
+files_read_generic_tmp_files(abrt_t)
+files_read_kernel_modules(abrt_t)
+files_dontaudit_list_default(abrt_t)
+files_dontaudit_read_default_files(abrt_t)
fs_list_inotifyfs(abrt_t)
fs_getattr_all_fs(abrt_t)
fs_getattr_all_dirs(abrt_t)
+fs_read_fusefs_files(abrt_t)
+fs_read_noxattr_fs_files(abrt_t)
+fs_read_nfs_files(abrt_t)
+fs_read_nfs_symlinks(abrt_t)
+fs_search_all(abrt_t)
sysnet_read_config(abrt_t)
@@ -103,22 +139,82 @@ logging_send_syslog_msg(abrt_t)
miscfiles_read_certs(abrt_t)
miscfiles_read_localization(abrt_t)
-# to run bugzilla plugin
-# read ~/.abrt/Bugzilla.conf
-userdom_read_user_home_content_files(abrt_t)
+userdom_dontaudit_read_user_home_content_files(abrt_t)
optional_policy(`
- dbus_connect_system_bus(abrt_t)
- dbus_system_bus_client(abrt_t)
+ dbus_system_domain(abrt_t, abrt_exec_t)
')
-# to install debuginfo packages
optional_policy(`
- rpm_manage_db(abrt_t)
- rpm_domtrans(abrt_t)
+ nis_use_ypbind(abrt_t)
+')
+
+optional_policy(`
+ policykit_dbus_chat(abrt_t)
+ policykit_domtrans_auth(abrt_t)
+ policykit_read_lib(abrt_t)
+ policykit_read_reload(abrt_t)
+')
+
+# to install debuginfo packages
+optional_policy(`
+ rpm_exec(abrt_t)
+ rpm_dontaudit_manage_db(abrt_t)
+ rpm_manage_cache(abrt_t)
+ rpm_manage_pid_files(abrt_t)
+ rpm_read_db(abrt_t)
+ rpm_signull(abrt_t)
')
# to run mailx plugin
optional_policy(`
sendmail_domtrans(abrt_t)
')
+
+optional_policy(`
+ sssd_stream_connect(abrt_t)
+')
+
+########################################
+#
+# abrt--helper local policy
+#
+
+allow abrt_helper_t self:capability { chown setgid };
+allow abrt_helper_t self:process signal;
+
+read_files_pattern(abrt_helper_t, abrt_etc_t, abrt_etc_t)
+
+manage_dirs_pattern(abrt_helper_t, abrt_var_cache_t, abrt_var_cache_t)
+manage_files_pattern(abrt_helper_t, abrt_var_cache_t, abrt_var_cache_t)
+manage_lnk_files_pattern(abrt_helper_t, abrt_var_cache_t, abrt_var_cache_t)
+files_var_filetrans(abrt_helper_t, abrt_var_cache_t, { file dir })
+
+read_files_pattern(abrt_helper_t, abrt_var_run_t, abrt_var_run_t)
+read_lnk_files_pattern(abrt_helper_t, abrt_var_run_t, abrt_var_run_t)
+
+domain_read_all_domains_state(abrt_helper_t)
+
+files_read_etc_files(abrt_helper_t)
+
+fs_list_inotifyfs(abrt_helper_t)
+fs_getattr_all_fs(abrt_helper_t)
+
+auth_use_nsswitch(abrt_helper_t)
+
+logging_send_syslog_msg(abrt_helper_t)
+
+miscfiles_read_localization(abrt_helper_t)
+
+term_dontaudit_use_all_ttys(abrt_helper_t)
+term_dontaudit_use_all_ptys(abrt_helper_t)
+
+ifdef(`hide_broken_symptoms', `
+ userdom_dontaudit_read_user_home_content_files(abrt_helper_t)
+ userdom_dontaudit_read_user_tmp_files(abrt_helper_t)
+ dev_dontaudit_read_all_blk_files(abrt_helper_t)
+ dev_dontaudit_read_all_chr_files(abrt_helper_t)
+ dev_dontaudit_write_all_chr_files(abrt_helper_t)
+ dev_dontaudit_write_all_blk_files(abrt_helper_t)
+ fs_dontaudit_rw_anon_inodefs_files(abrt_helper_t)
+')