2010-09-15 14:42:34 +00:00
|
|
|
policy_module(stunnel, 1.9.1)
|
2005-09-20 13:47:36 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
|
|
|
type stunnel_t;
|
|
|
|
type stunnel_exec_t;
|
|
|
|
|
|
|
|
type stunnel_etc_t;
|
2008-08-07 14:17:50 +00:00
|
|
|
files_config_file(stunnel_etc_t)
|
2005-09-20 13:47:36 +00:00
|
|
|
|
|
|
|
type stunnel_tmp_t;
|
|
|
|
files_tmp_file(stunnel_tmp_t)
|
|
|
|
|
|
|
|
type stunnel_var_run_t;
|
|
|
|
files_pid_file(stunnel_var_run_t)
|
|
|
|
|
2010-09-24 07:38:13 +00:00
|
|
|
ifdef(`distro_gentoo',`
|
|
|
|
init_daemon_domain(stunnel_t, stunnel_exec_t)
|
|
|
|
',`
|
|
|
|
inetd_tcp_service_domain(stunnel_t, stunnel_exec_t)
|
|
|
|
')
|
|
|
|
|
2005-09-20 13:47:36 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Local policy
|
|
|
|
#
|
|
|
|
|
|
|
|
allow stunnel_t self:capability { setgid setuid sys_chroot };
|
|
|
|
allow stunnel_t self:process signal_perms;
|
2006-12-12 20:08:08 +00:00
|
|
|
allow stunnel_t self:fifo_file rw_fifo_file_perms;
|
2005-09-20 13:47:36 +00:00
|
|
|
allow stunnel_t self:tcp_socket create_stream_socket_perms;
|
2005-10-26 21:03:19 +00:00
|
|
|
allow stunnel_t self:udp_socket create_socket_perms;
|
2005-09-20 13:47:36 +00:00
|
|
|
|
2008-10-16 16:09:20 +00:00
|
|
|
allow stunnel_t stunnel_etc_t:dir list_dir_perms;
|
|
|
|
allow stunnel_t stunnel_etc_t:file read_file_perms;
|
2010-09-24 07:28:34 +00:00
|
|
|
allow stunnel_t stunnel_etc_t:lnk_file read_lnk_file_perms;
|
2005-09-20 13:47:36 +00:00
|
|
|
|
2008-07-23 21:38:39 +00:00
|
|
|
manage_dirs_pattern(stunnel_t, stunnel_tmp_t, stunnel_tmp_t)
|
|
|
|
manage_files_pattern(stunnel_t, stunnel_tmp_t, stunnel_tmp_t)
|
2006-02-21 18:40:44 +00:00
|
|
|
files_tmp_filetrans(stunnel_t, stunnel_tmp_t, { file dir })
|
2005-09-20 13:47:36 +00:00
|
|
|
|
2010-09-02 19:48:08 +00:00
|
|
|
manage_dirs_pattern(stunnel_t, stunnel_var_run_t, stunnel_var_run_t)
|
2008-07-23 21:38:39 +00:00
|
|
|
manage_files_pattern(stunnel_t, stunnel_var_run_t, stunnel_var_run_t)
|
2010-09-02 19:48:08 +00:00
|
|
|
files_pid_filetrans(stunnel_t, stunnel_var_run_t, { dir file })
|
2005-09-20 13:47:36 +00:00
|
|
|
|
2006-01-31 16:49:43 +00:00
|
|
|
kernel_read_kernel_sysctls(stunnel_t)
|
2005-09-20 13:47:36 +00:00
|
|
|
kernel_read_system_state(stunnel_t)
|
|
|
|
kernel_read_network_state(stunnel_t)
|
|
|
|
|
2009-03-23 14:56:43 +00:00
|
|
|
corecmd_exec_bin(stunnel_t)
|
|
|
|
|
2007-06-27 15:23:21 +00:00
|
|
|
corenet_all_recvfrom_unlabeled(stunnel_t)
|
|
|
|
corenet_all_recvfrom_netlabel(stunnel_t)
|
2009-01-06 20:24:10 +00:00
|
|
|
corenet_tcp_sendrecv_generic_if(stunnel_t)
|
|
|
|
corenet_udp_sendrecv_generic_if(stunnel_t)
|
2009-01-09 19:48:02 +00:00
|
|
|
corenet_tcp_sendrecv_generic_node(stunnel_t)
|
|
|
|
corenet_udp_sendrecv_generic_node(stunnel_t)
|
2005-09-20 13:47:36 +00:00
|
|
|
corenet_tcp_sendrecv_all_ports(stunnel_t)
|
|
|
|
corenet_udp_sendrecv_all_ports(stunnel_t)
|
2009-01-09 19:48:02 +00:00
|
|
|
corenet_tcp_bind_generic_node(stunnel_t)
|
2006-09-04 15:15:35 +00:00
|
|
|
corenet_tcp_connect_all_ports(stunnel_t)
|
2005-09-20 13:47:36 +00:00
|
|
|
|
|
|
|
fs_getattr_all_fs(stunnel_t)
|
|
|
|
|
2007-12-04 15:05:55 +00:00
|
|
|
auth_use_nsswitch(stunnel_t)
|
|
|
|
|
2005-09-20 13:47:36 +00:00
|
|
|
logging_send_syslog_msg(stunnel_t)
|
|
|
|
|
|
|
|
miscfiles_read_localization(stunnel_t)
|
|
|
|
|
|
|
|
sysnet_read_config(stunnel_t)
|
|
|
|
|
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
2010-09-24 07:17:22 +00:00
|
|
|
ifdef(`distro_gentoo',`
|
2005-09-20 13:47:36 +00:00
|
|
|
dontaudit stunnel_t self:capability sys_tty_config;
|
|
|
|
allow stunnel_t self:udp_socket create_socket_perms;
|
|
|
|
|
|
|
|
dev_read_sysfs(stunnel_t)
|
|
|
|
|
|
|
|
fs_search_auto_mountpoints(stunnel_t)
|
|
|
|
|
2006-02-20 21:33:25 +00:00
|
|
|
domain_use_interactive_fds(stunnel_t)
|
2005-09-20 13:47:36 +00:00
|
|
|
|
2006-02-20 21:33:25 +00:00
|
|
|
userdom_dontaudit_use_unpriv_user_fds(stunnel_t)
|
2008-11-05 16:10:46 +00:00
|
|
|
userdom_dontaudit_search_user_home_dirs(stunnel_t)
|
2005-09-20 13:47:36 +00:00
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2006-01-16 18:30:14 +00:00
|
|
|
daemontools_service_domain(stunnel_t, stunnel_exec_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2008-12-03 18:33:19 +00:00
|
|
|
seutil_sigchld_newrole(stunnel_t)
|
2005-09-20 13:47:36 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2008-12-03 18:33:19 +00:00
|
|
|
udev_read_db(stunnel_t)
|
2005-09-20 13:47:36 +00:00
|
|
|
')
|
2005-11-25 15:51:50 +00:00
|
|
|
',`
|
2005-09-20 13:47:36 +00:00
|
|
|
allow stunnel_t self:netlink_tcpdiag_socket r_netlink_socket_perms;
|
|
|
|
|
|
|
|
dev_read_urand(stunnel_t)
|
|
|
|
|
|
|
|
files_read_etc_files(stunnel_t)
|
2009-03-23 14:56:43 +00:00
|
|
|
files_read_etc_runtime_files(stunnel_t)
|
2005-09-20 13:47:36 +00:00
|
|
|
files_search_home(stunnel_t)
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2008-12-03 18:33:19 +00:00
|
|
|
kerberos_use(stunnel_t)
|
2005-09-20 13:47:36 +00:00
|
|
|
')
|
|
|
|
')
|
2005-10-26 21:03:19 +00:00
|
|
|
|
2007-03-26 18:41:45 +00:00
|
|
|
# hack since this port has no interfaces since it doesnt
|
|
|
|
# have net_contexts
|
|
|
|
gen_require(`
|
|
|
|
type stunnel_port_t;
|
2005-10-26 21:03:19 +00:00
|
|
|
')
|
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
2010-09-24 07:17:22 +00:00
|
|
|
|
2007-03-26 18:41:45 +00:00
|
|
|
allow stunnel_t stunnel_port_t:tcp_socket name_bind;
|