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