Chris PeBenito ab58ad
#DESC RSHD - RSH daemon
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# Authors:  Stephen Smalley <sds@epoch.ncsc.mil> and Timothy Fraser  
Chris PeBenito ab58ad
# X-Debian-Packages: rsh-server rsh-redone-server
Chris PeBenito ab58ad
# Depends: inetd.te
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#################################
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# Rules for the rshd_t domain.
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
daemon_sub_domain(inetd_t, rshd, `, auth_chkpwd, privuser, privrole')
Chris PeBenito ab58ad
Chris PeBenito ab58ad
ifdef(`tcpd.te', `
Chris PeBenito ab58ad
domain_auto_trans(tcpd_t, rshd_exec_t, rshd_t)
Chris PeBenito ab58ad
')
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# Use sockets inherited from inetd.
Chris PeBenito ab58ad
allow rshd_t inetd_t:tcp_socket rw_stream_socket_perms;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# Use capabilities.
Chris PeBenito ab58ad
allow rshd_t self:capability { net_bind_service setuid setgid fowner fsetid chown dac_override};
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# Use the network.
Chris PeBenito ab58ad
can_network_server(rshd_t)
Chris PeBenito ab58ad
allow rshd_t rsh_port_t:tcp_socket name_bind;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
allow rshd_t etc_t:file { getattr read };
Chris PeBenito ab58ad
read_locale(rshd_t)
Chris PeBenito ab58ad
allow rshd_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito ab58ad
allow rshd_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito ab58ad
allow rshd_t { home_root_t home_dir_type }:dir { search getattr };
Chris PeBenito ab58ad
can_kerberos(rshd_t)
Chris PeBenito ab58ad
allow rshd_t { bin_t sbin_t tmp_t}:dir { search };
Chris PeBenito ab58ad
allow rshd_t { bin_t sbin_t }:lnk_file r_file_perms;
Chris PeBenito ab58ad
ifdef(`rlogind.te', `
Chris PeBenito ab58ad
allow rshd_t rlogind_tmp_t:file rw_file_perms;
Chris PeBenito ab58ad
')
Chris PeBenito ab58ad
allow rshd_t urandom_device_t:chr_file { getattr read };
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# Read the user's .rhosts file.
Chris PeBenito ab58ad
allow rshd_t home_type:file  r_file_perms ;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# Random reasons
Chris PeBenito ab58ad
can_getsecurity(rshd_t)
Chris PeBenito ab58ad
can_setexec(rshd_t)
Chris PeBenito ab58ad
r_dir_file(rshd_t, selinux_config_t)
Chris PeBenito ab58ad
r_dir_file(rshd_t, default_context_t)
Chris PeBenito ab58ad
read_sysctl(rshd_t);
Chris PeBenito ab58ad
Chris PeBenito ab58ad
if (use_nfs_home_dirs) {
Chris PeBenito ab58ad
r_dir_file(rshd_t, nfs_t)
Chris PeBenito ab58ad
}
Chris PeBenito ab58ad
Chris PeBenito ab58ad
if (use_samba_home_dirs) {
Chris PeBenito ab58ad
r_dir_file(rshd_t, cifs_t)
Chris PeBenito ab58ad
}
Chris PeBenito ab58ad
Chris PeBenito ab58ad
allow rshd_t self:process { fork signal setsched setpgid };
Chris PeBenito ab58ad
allow rshd_t self:fifo_file rw_file_perms;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
ifdef(`targeted_policy', `
Chris PeBenito ab58ad
unconfined_domain(rshd_t)
Chris PeBenito ab58ad
domain_auto_trans(rshd_t,shell_exec_t,unconfined_t)
Chris PeBenito ab58ad
')