Chris PeBenito fee486
policy_module(icecast, 1.0.1)
Jeremy Solt 584dfa
Jeremy Solt 584dfa
########################################
Jeremy Solt 584dfa
#
Jeremy Solt 584dfa
# Declarations
Jeremy Solt 584dfa
#
Jeremy Solt 584dfa
Dan Walsh f5b49a
## <desc>
Dan Walsh f5b49a
## 

Dan Walsh f5b49a
## Allow icecast to connect to all ports, not just
Dan Walsh f5b49a
## sound ports.
Dan Walsh f5b49a
## 

Dan Walsh f5b49a
## </desc>
Dan Walsh f5b49a
gen_tunable(icecast_connect_any, false)
Dan Walsh f5b49a
Jeremy Solt 584dfa
type icecast_t;
Jeremy Solt 584dfa
type icecast_exec_t;
Jeremy Solt 584dfa
init_daemon_domain(icecast_t, icecast_exec_t)
Jeremy Solt 584dfa
Jeremy Solt 584dfa
type icecast_initrc_exec_t;
Jeremy Solt 584dfa
init_script_file(icecast_initrc_exec_t)
Jeremy Solt 584dfa
Jeremy Solt 584dfa
type icecast_var_run_t;
Jeremy Solt 584dfa
files_pid_file(icecast_var_run_t)
Jeremy Solt 584dfa
Jeremy Solt 584dfa
type icecast_log_t;
Jeremy Solt 584dfa
logging_log_file(icecast_log_t)
Jeremy Solt 584dfa
Jeremy Solt 584dfa
########################################
Jeremy Solt 584dfa
#
Jeremy Solt 584dfa
# icecast local policy
Jeremy Solt 584dfa
#
Jeremy Solt 584dfa
Jeremy Solt 584dfa
allow icecast_t self:capability { dac_override setgid setuid sys_nice };
Jeremy Solt 584dfa
allow icecast_t self:process { getsched fork setsched signal };
Jeremy Solt 584dfa
allow icecast_t self:fifo_file rw_fifo_file_perms;
Jeremy Solt 584dfa
allow icecast_t self:unix_stream_socket create_stream_socket_perms;
Jeremy Solt 584dfa
allow icecast_t self:tcp_socket create_stream_socket_perms;
Jeremy Solt 584dfa
Chris PeBenito 340af1
manage_dirs_pattern(icecast_t, icecast_log_t, icecast_log_t)
Chris PeBenito 340af1
manage_files_pattern(icecast_t, icecast_log_t, icecast_log_t)
Jeremy Solt 584dfa
logging_log_filetrans(icecast_t, icecast_log_t, { file dir } )
Jeremy Solt 584dfa
Chris PeBenito 340af1
manage_dirs_pattern(icecast_t, icecast_var_run_t, icecast_var_run_t)
Chris PeBenito 340af1
manage_files_pattern(icecast_t, icecast_var_run_t, icecast_var_run_t)
Jeremy Solt 584dfa
files_pid_filetrans(icecast_t, icecast_var_run_t, { file dir })
Jeremy Solt 584dfa
Dan Walsh 3eaa99
kernel_read_system_state(icecast_t)
Dan Walsh 3eaa99
Jeremy Solt 584dfa
corenet_tcp_bind_soundd_port(icecast_t)
Dan Walsh 2d4a79
corenet_tcp_connect_soundd_port(icecast_t)
Jeremy Solt 584dfa
Dan Walsh f5b49a
tunable_policy(`icecast_connect_any',`
Dan Walsh f5b49a
	corenet_tcp_connect_all_ports(icecast_t)
Dan Walsh f5b49a
	corenet_tcp_bind_all_ports(icecast_t)
Dan Walsh f5b49a
	corenet_sendrecv_all_packets(icecast_t)
Dan Walsh f5b49a
')
Dan Walsh f5b49a
Jeremy Solt 584dfa
# Init script handling
Jeremy Solt 584dfa
domain_use_interactive_fds(icecast_t)
Jeremy Solt 584dfa
Jeremy Solt 584dfa
files_read_etc_files(icecast_t)
Jeremy Solt 584dfa
Jeremy Solt 584dfa
auth_use_nsswitch(icecast_t)
Jeremy Solt 584dfa
Jeremy Solt 584dfa
miscfiles_read_localization(icecast_t)
Jeremy Solt 584dfa
Jeremy Solt 584dfa
sysnet_dns_name_resolve(icecast_t)
Jeremy Solt 584dfa
Jeremy Solt 584dfa
optional_policy(`
Dan Walsh 3eaa99
	apache_read_sys_content(icecast_t)
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
optional_policy(`
Chris PeBenito 064d1b
	rtkit_scheduled(icecast_t)
Jeremy Solt 584dfa
')