Chris PeBenito 31b7c0
# DESC: selinux policy for stunnel
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# Author:   petre rodan <kaiowas@gentoo.org>
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
ifdef(`distro_gentoo', `
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
daemon_domain(stunnel)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
can_network(stunnel_t)
Chris PeBenito 31b7c0
allow stunnel_t port_type:tcp_socket name_connect;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow stunnel_t self:capability { setgid setuid sys_chroot };
Chris PeBenito 31b7c0
allow stunnel_t self:fifo_file { read write };
Chris PeBenito 31b7c0
allow stunnel_t self:tcp_socket { read write };
Chris PeBenito 31b7c0
allow stunnel_t self:unix_stream_socket { connect create };
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
r_dir_file(stunnel_t, etc_t)
Chris PeBenito 31b7c0
', `
Chris PeBenito 31b7c0
inetd_child_domain(stunnel, tcp)
Chris PeBenito 31b7c0
allow stunnel_t self:capability sys_chroot;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
bool stunnel_is_daemon false;
Chris PeBenito 31b7c0
if (stunnel_is_daemon) {
Chris PeBenito 31b7c0
# Policy to run stunnel as a daemon should go here.
Chris PeBenito 31b7c0
allow stunnel_t self:tcp_socket rw_stream_socket_perms;
Chris PeBenito 31b7c0
allow stunnel_t stunnel_port_t:tcp_socket name_bind;
Chris PeBenito 31b7c0
}
Chris PeBenito 31b7c0
')
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
type stunnel_etc_t, file_type, sysadmfile;
Chris PeBenito 31b7c0
r_dir_file(stunnel_t, stunnel_etc_t)
Chris PeBenito 31b7c0
allow stunnel_t stunnel_port_t:tcp_socket { name_bind };
Chris PeBenito 31b7c0