Chris PeBenito fee486
policy_module(stunnel, 1.9.1)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Declarations
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type stunnel_t;
Chris PeBenito 17de1b
type stunnel_exec_t;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type stunnel_etc_t;
Chris PeBenito 8a948c
files_config_file(stunnel_etc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type stunnel_tmp_t;
Chris PeBenito 17de1b
files_tmp_file(stunnel_tmp_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type stunnel_var_run_t;
Chris PeBenito 17de1b
files_pid_file(stunnel_var_run_t)
Chris PeBenito 17de1b
Dominick Grift 478149
ifdef(`distro_gentoo',`
Dominick Grift 478149
	init_daemon_domain(stunnel_t, stunnel_exec_t)
Dominick Grift 478149
',`
Dominick Grift 478149
	inetd_tcp_service_domain(stunnel_t, stunnel_exec_t)
Dominick Grift 478149
')
Dominick Grift 478149
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow stunnel_t self:capability { setgid setuid sys_chroot };
Chris PeBenito 17de1b
allow stunnel_t self:process signal_perms;
Chris PeBenito c0868a
allow stunnel_t self:fifo_file rw_fifo_file_perms;
Chris PeBenito 17de1b
allow stunnel_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito 17de1b
allow stunnel_t self:udp_socket create_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito 0b36a2
allow stunnel_t stunnel_etc_t:dir list_dir_perms;
Chris PeBenito 0b36a2
allow stunnel_t stunnel_etc_t:file read_file_perms;
Dominick Grift 7d1f56
allow stunnel_t stunnel_etc_t:lnk_file read_lnk_file_perms;
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
manage_dirs_pattern(stunnel_t, stunnel_tmp_t, stunnel_tmp_t)
Chris PeBenito 0bfccd
manage_files_pattern(stunnel_t, stunnel_tmp_t, stunnel_tmp_t)
Chris PeBenito 17de1b
files_tmp_filetrans(stunnel_t, stunnel_tmp_t, { file dir })
Chris PeBenito 17de1b
Jeremy Solt c20842
manage_dirs_pattern(stunnel_t, stunnel_var_run_t, stunnel_var_run_t)
Chris PeBenito 0bfccd
manage_files_pattern(stunnel_t, stunnel_var_run_t, stunnel_var_run_t)
Jeremy Solt c20842
files_pid_filetrans(stunnel_t, stunnel_var_run_t, { dir file })
Chris PeBenito 17de1b
Chris PeBenito 17de1b
kernel_read_kernel_sysctls(stunnel_t)
Chris PeBenito 17de1b
kernel_read_system_state(stunnel_t)
Chris PeBenito 17de1b
kernel_read_network_state(stunnel_t)
Chris PeBenito 17de1b
Chris PeBenito 8f800d
corecmd_exec_bin(stunnel_t)
Chris PeBenito 8f800d
Chris PeBenito 190066
corenet_all_recvfrom_unlabeled(stunnel_t)
Chris PeBenito 190066
corenet_all_recvfrom_netlabel(stunnel_t)
Chris PeBenito 668b30
corenet_tcp_sendrecv_generic_if(stunnel_t)
Chris PeBenito 668b30
corenet_udp_sendrecv_generic_if(stunnel_t)
Chris PeBenito c12621
corenet_tcp_sendrecv_generic_node(stunnel_t)
Chris PeBenito c12621
corenet_udp_sendrecv_generic_node(stunnel_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_ports(stunnel_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_all_ports(stunnel_t)
Chris PeBenito c12621
corenet_tcp_bind_generic_node(stunnel_t)
Chris PeBenito 5dbda5
corenet_tcp_connect_all_ports(stunnel_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
fs_getattr_all_fs(stunnel_t)
Chris PeBenito 17de1b
Chris PeBenito c0cf6e
auth_use_nsswitch(stunnel_t)
Chris PeBenito c0cf6e
Chris PeBenito 17de1b
logging_send_syslog_msg(stunnel_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
miscfiles_read_localization(stunnel_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
sysnet_read_config(stunnel_t)
Chris PeBenito 17de1b
Dominick Grift 1e2abe
ifdef(`distro_gentoo',`
Chris PeBenito 17de1b
	dontaudit stunnel_t self:capability sys_tty_config;
Chris PeBenito 17de1b
	allow stunnel_t self:udp_socket create_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	dev_read_sysfs(stunnel_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	fs_search_auto_mountpoints(stunnel_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	domain_use_interactive_fds(stunnel_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	userdom_dontaudit_use_unpriv_user_fds(stunnel_t)
Chris PeBenito 296273
	userdom_dontaudit_search_user_home_dirs(stunnel_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		daemontools_service_domain(stunnel_t, stunnel_exec_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 6073ea
		seutil_sigchld_newrole(stunnel_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 6073ea
		udev_read_db(stunnel_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
',`
Chris PeBenito 17de1b
	allow stunnel_t self:netlink_tcpdiag_socket r_netlink_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	dev_read_urand(stunnel_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_read_etc_files(stunnel_t)
Chris PeBenito 8f800d
	files_read_etc_runtime_files(stunnel_t)
Chris PeBenito 17de1b
	files_search_home(stunnel_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 6073ea
		kerberos_use(stunnel_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 56e1b3
# hack since this port has no interfaces since it doesnt
Chris PeBenito 56e1b3
# have net_contexts
Chris PeBenito 56e1b3
gen_require(`
Chris PeBenito 56e1b3
	type stunnel_port_t;
Chris PeBenito 17de1b
')
Dominick Grift 1e2abe
Chris PeBenito 56e1b3
allow stunnel_t stunnel_port_t:tcp_socket name_bind;