|
Chris PeBenito |
ab58ad |
#DESC Inetd - Internet services daemon
|
|
Chris PeBenito |
ab58ad |
#
|
|
Chris PeBenito |
ab58ad |
# Authors: Stephen Smalley <sds@epoch.ncsc.mil> and Timothy Fraser
|
|
Chris PeBenito |
ab58ad |
# re-written with daemon_domain by Russell Coker <russell@coker.com.au>
|
|
Chris PeBenito |
ab58ad |
# X-Debian-Packages: netkit-inetd openbsd-inetd xinetd
|
|
Chris PeBenito |
ab58ad |
#
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
#################################
|
|
Chris PeBenito |
ab58ad |
#
|
|
Chris PeBenito |
ab58ad |
# Rules for the inetd_t domain and
|
|
Chris PeBenito |
ab58ad |
# the inetd_child_t domain.
|
|
Chris PeBenito |
ab58ad |
#
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
daemon_domain(inetd, `ifdef(`unlimitedInetd', `,admin, etc_writer, fs_domain, auth_write, privmem')' )
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
can_network(inetd_t)
|
|
Chris PeBenito |
ab58ad |
allow inetd_t port_type:tcp_socket name_connect;
|
|
Chris PeBenito |
ab58ad |
allow inetd_t self:unix_dgram_socket create_socket_perms;
|
|
Chris PeBenito |
ab58ad |
allow inetd_t self:unix_stream_socket create_socket_perms;
|
|
Chris PeBenito |
ab58ad |
allow inetd_t self:fifo_file rw_file_perms;
|
|
Chris PeBenito |
ab58ad |
allow inetd_t etc_t:file { getattr read ioctl };
|
|
Chris PeBenito |
ab58ad |
allow inetd_t self:process setsched;
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
log_domain(inetd)
|
|
Chris PeBenito |
ab58ad |
tmp_domain(inetd)
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Use capabilities.
|
|
Chris PeBenito |
ab58ad |
allow inetd_t self:capability { setuid setgid net_bind_service };
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# allow any domain to connect to inetd
|
|
Chris PeBenito |
ab58ad |
can_tcp_connect(userdomain, inetd_t)
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Run each daemon with a defined domain in its own domain.
|
|
Chris PeBenito |
ab58ad |
# These rules have been moved to the individual target domain .te files.
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Run other daemons in the inetd_child_t domain.
|
|
Chris PeBenito |
ab58ad |
allow inetd_t { bin_t sbin_t }:dir search;
|
|
Chris PeBenito |
ab58ad |
allow inetd_t sbin_t:lnk_file read;
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Bind to the telnet, ftp, rlogin and rsh ports.
|
|
Chris PeBenito |
ab58ad |
ifdef(`ftpd.te', `allow inetd_t ftp_port_t:tcp_socket name_bind;')
|
|
Chris PeBenito |
ab58ad |
ifdef(`rshd.te', `allow inetd_t rsh_port_t:tcp_socket name_bind;')
|
|
Chris PeBenito |
ab58ad |
ifdef(`talk.te', `
|
|
Chris PeBenito |
ab58ad |
allow inetd_t talk_port_t:tcp_socket name_bind;
|
|
Chris PeBenito |
ab58ad |
allow inetd_t ntalk_port_t:tcp_socket name_bind;
|
|
Chris PeBenito |
ab58ad |
')
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
allow inetd_t auth_port_t:tcp_socket name_bind;
|
|
Chris PeBenito |
ab58ad |
# Communicate with the portmapper.
|
|
Chris PeBenito |
ab58ad |
ifdef(`portmap.te', `can_udp_send(inetd_t, portmap_t)')
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
inetd_child_domain(inetd_child)
|
|
Chris PeBenito |
ab58ad |
allow inetd_child_t proc_net_t:dir search;
|
|
Chris PeBenito |
ab58ad |
allow inetd_child_t proc_net_t:file { getattr read };
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
ifdef(`unconfined.te', `
|
|
Chris PeBenito |
ab58ad |
domain_auto_trans(inetd_t, unconfined_exec_t, unconfined_t)
|
|
Chris PeBenito |
ab58ad |
')
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
ifdef(`unlimitedInetd', `
|
|
Chris PeBenito |
ab58ad |
unconfined_domain(inetd_t)
|
|
Chris PeBenito |
ab58ad |
')
|
|
Chris PeBenito |
ab58ad |
|