Chris PeBenito eac818
Chris PeBenito 42c5c5
policy_module(setroubleshoot,1.2.0)
Chris PeBenito eac818
Chris PeBenito eac818
########################################
Chris PeBenito eac818
#
Chris PeBenito eac818
# Declarations 
Chris PeBenito eac818
#
Chris PeBenito eac818
Chris PeBenito eac818
type setroubleshootd_t alias setroubleshoot_t;
Chris PeBenito eac818
type setroubleshootd_exec_t;
Chris PeBenito eac818
domain_type(setroubleshootd_t)
Chris PeBenito eac818
init_daemon_domain(setroubleshootd_t, setroubleshootd_exec_t)
Chris PeBenito eac818
Chris PeBenito eac818
type setroubleshoot_var_lib_t;
Chris PeBenito eac818
files_type(setroubleshoot_var_lib_t)
Chris PeBenito eac818
Chris PeBenito eac818
# log files
Chris PeBenito eac818
type setroubleshoot_var_log_t;
Chris PeBenito eac818
logging_log_file(setroubleshoot_var_log_t)
Chris PeBenito eac818
Chris PeBenito eac818
# pid files
Chris PeBenito eac818
type setroubleshoot_var_run_t;
Chris PeBenito eac818
files_pid_file(setroubleshoot_var_run_t)
Chris PeBenito eac818
Chris PeBenito eac818
########################################
Chris PeBenito eac818
#
Chris PeBenito eac818
# setroubleshootd local policy
Chris PeBenito eac818
#
Chris PeBenito eac818
Chris PeBenito eac818
allow setroubleshootd_t self:capability { dac_override sys_tty_config };
Chris PeBenito d9845a
allow setroubleshootd_t self:process { signal getattr getsched };
Chris PeBenito c0868a
allow setroubleshootd_t self:fifo_file rw_fifo_file_perms;
Chris PeBenito eac818
allow setroubleshootd_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito eac818
allow setroubleshootd_t self:unix_stream_socket { create_stream_socket_perms connectto };
Chris PeBenito eac818
allow setroubleshootd_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito eac818
allow setroubleshootd_t self:netlink_route_socket r_netlink_socket_perms;
Chris PeBenito eac818
Chris PeBenito eac818
# database files
Chris PeBenito c0868a
allow setroubleshootd_t setroubleshoot_var_lib_t:dir setattr;
Chris PeBenito c0868a
manage_files_pattern(setroubleshootd_t,setroubleshoot_var_lib_t,setroubleshoot_var_lib_t)
Chris PeBenito eac818
files_var_lib_filetrans(setroubleshootd_t,setroubleshoot_var_lib_t,{ file dir })
Chris PeBenito eac818
Chris PeBenito eac818
# log files
Chris PeBenito c0868a
allow setroubleshootd_t setroubleshoot_var_log_t:dir setattr;
Chris PeBenito c0868a
manage_files_pattern(setroubleshootd_t,setroubleshoot_var_log_t,setroubleshoot_var_log_t)
Chris PeBenito c0868a
manage_sock_files_pattern(setroubleshootd_t,setroubleshoot_var_log_t,setroubleshoot_var_log_t)
Chris PeBenito eac818
logging_log_filetrans(setroubleshootd_t,setroubleshoot_var_log_t,{ file dir })
Chris PeBenito eac818
Chris PeBenito eac818
# pid file
Chris PeBenito c0868a
manage_files_pattern(setroubleshootd_t,setroubleshoot_var_run_t,setroubleshoot_var_run_t)
Chris PeBenito c0868a
manage_sock_files_pattern(setroubleshootd_t,setroubleshoot_var_run_t,setroubleshoot_var_run_t)
Chris PeBenito eac818
files_pid_filetrans(setroubleshootd_t,setroubleshoot_var_run_t, { file sock_file })
Chris PeBenito eac818
Chris PeBenito eac818
kernel_read_kernel_sysctls(setroubleshootd_t)
Chris PeBenito eac818
kernel_read_system_state(setroubleshootd_t)
Chris PeBenito eac818
Chris PeBenito eac818
corecmd_exec_sbin(setroubleshootd_t)
Chris PeBenito eac818
corecmd_exec_bin(setroubleshootd_t)
Chris PeBenito eac818
corecmd_exec_shell(setroubleshootd_t)
Chris PeBenito eac818
Chris PeBenito eac818
corenet_non_ipsec_sendrecv(setroubleshootd_t)
Chris PeBenito eac818
corenet_tcp_sendrecv_generic_if(setroubleshootd_t)
Chris PeBenito eac818
corenet_tcp_sendrecv_all_nodes(setroubleshootd_t)
Chris PeBenito eac818
corenet_tcp_sendrecv_all_ports(setroubleshootd_t)
Chris PeBenito eac818
corenet_tcp_bind_all_nodes(setroubleshootd_t)
Chris PeBenito eac818
corenet_tcp_connect_smtp_port(setroubleshootd_t)
Chris PeBenito eac818
corenet_sendrecv_smtp_client_packets(setroubleshootd_t)
Chris PeBenito eac818
Chris PeBenito eac818
dev_read_urand(setroubleshootd_t)
Chris PeBenito eac818
Chris PeBenito 8708d9
domain_dontaudit_search_all_domains_state(setroubleshootd_t)
Chris PeBenito 8708d9
Chris PeBenito eac818
files_read_usr_files(setroubleshootd_t)
Chris PeBenito eac818
files_read_etc_files(setroubleshootd_t)
Chris PeBenito eac818
files_getattr_all_dirs(setroubleshootd_t)
Chris PeBenito eac818
Chris PeBenito eac818
selinux_get_enforce_mode(setroubleshootd_t)
Chris PeBenito eac818
Chris PeBenito eac818
term_dontaudit_use_console(setroubleshootd_t)
Chris PeBenito eac818
term_dontaudit_use_all_user_ptys(setroubleshootd_t)
Chris PeBenito eac818
term_dontaudit_use_all_user_ttys(setroubleshootd_t)
Chris PeBenito eac818
Chris PeBenito eac818
init_read_utmp(setroubleshootd_t)
Chris PeBenito eac818
init_dontaudit_write_utmp(setroubleshootd_t)
Chris PeBenito eac818
init_use_fds(setroubleshootd_t)
Chris PeBenito 8708d9
init_use_script_ptys(setroubleshootd_t)
Chris PeBenito eac818
Chris PeBenito eac818
libs_use_ld_so(setroubleshootd_t)
Chris PeBenito eac818
libs_use_shared_libs(setroubleshootd_t)
Chris PeBenito eac818
Chris PeBenito eac818
miscfiles_read_localization(setroubleshootd_t)
Chris PeBenito eac818
Chris PeBenito eac818
locallogin_dontaudit_use_fds(setroubleshootd_t)
Chris PeBenito eac818
Chris PeBenito eac818
logging_send_syslog_msg(setroubleshootd_t)
Chris PeBenito eac818
logging_stream_connect_auditd(setroubleshootd_t)
Chris PeBenito eac818
Chris PeBenito eac818
seutil_read_config(setroubleshootd_t)
Chris PeBenito eac818
Chris PeBenito eac818
sysnet_read_config(setroubleshootd_t)
Chris PeBenito eac818
Chris PeBenito eac818
ifdef(`targeted_policy',`
Chris PeBenito eac818
	term_dontaudit_use_generic_ptys(setroubleshootd_t)
Chris PeBenito eac818
	term_dontaudit_use_unallocated_ttys(setroubleshootd_t)
Chris PeBenito eac818
')
Chris PeBenito eac818
Chris PeBenito eac818
optional_policy(`
Chris PeBenito eac818
	rpm_read_db(setroubleshootd_t)
Chris PeBenito eac818
	rpm_dontaudit_manage_db(setroubleshootd_t)
Chris PeBenito eac818
        rpm_use_script_fds(setroubleshootd_t)
Chris PeBenito eac818
')
Chris PeBenito 8708d9
Chris PeBenito 8708d9
optional_policy(`
Chris PeBenito 8708d9
	nis_use_ypbind(setroubleshootd_t)
Chris PeBenito 8708d9
')