Chris PeBenito 17de1b
Chris PeBenito 24af9b
policy_module(inetd, 1.7.1)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Declarations
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type inetd_t;
Chris PeBenito 17de1b
type inetd_exec_t;
Chris PeBenito 0bfccd
init_daemon_domain(inetd_t, inetd_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type inetd_log_t;
Chris PeBenito 17de1b
logging_log_file(inetd_log_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type inetd_tmp_t;
Chris PeBenito 17de1b
files_tmp_file(inetd_tmp_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type inetd_var_run_t;
Chris PeBenito 17de1b
files_pid_file(inetd_var_run_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type inetd_child_t;
Chris PeBenito 17de1b
type inetd_child_exec_t;
Chris PeBenito 0bfccd
inetd_service_domain(inetd_child_t, inetd_child_exec_t)
Chris PeBenito 17de1b
role system_r types inetd_child_t;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type inetd_child_tmp_t;
Chris PeBenito 17de1b
files_tmp_file(inetd_child_tmp_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type inetd_child_var_run_t;
Chris PeBenito 17de1b
files_pid_file(inetd_child_var_run_t)
Chris PeBenito 17de1b
Chris PeBenito 24af9b
ifdef(`enable_mcs',`
Chris PeBenito 24af9b
	init_ranged_daemon_domain(inetd_t, inetd_exec_t,s0 - mcs_systemhigh)
Chris PeBenito 24af9b
')
Chris PeBenito 24af9b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow inetd_t self:capability { setuid setgid };
Chris PeBenito 17de1b
dontaudit inetd_t self:capability sys_tty_config;
Chris PeBenito 6b19be
allow inetd_t self:process { setsched setexec };
Chris PeBenito c0868a
allow inetd_t self:fifo_file rw_fifo_file_perms;
Chris PeBenito 17de1b
allow inetd_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito 17de1b
allow inetd_t self:udp_socket create_socket_perms;
Chris PeBenito 6b19be
allow inetd_t self:fd use;
Chris PeBenito 17de1b
Chris PeBenito c0868a
allow inetd_t inetd_log_t:file manage_file_perms;
Chris PeBenito 0bfccd
logging_log_filetrans(inetd_t, inetd_log_t, file)
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
manage_dirs_pattern(inetd_t, inetd_tmp_t, inetd_tmp_t)
Chris PeBenito 0bfccd
manage_files_pattern(inetd_t, inetd_tmp_t, inetd_tmp_t)
Chris PeBenito 17de1b
files_tmp_filetrans(inetd_t, inetd_tmp_t, { file dir })
Chris PeBenito 17de1b
Chris PeBenito c0868a
allow inetd_t inetd_var_run_t:file manage_file_perms;
Chris PeBenito 0bfccd
files_pid_filetrans(inetd_t, inetd_var_run_t, file)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
kernel_read_kernel_sysctls(inetd_t)
Chris PeBenito 17de1b
kernel_list_proc(inetd_t)
Chris PeBenito 17de1b
kernel_read_proc_symlinks(inetd_t)
Chris PeBenito 6b19be
kernel_read_system_state(inetd_t)
Chris PeBenito 6b19be
kernel_tcp_recvfrom_unlabeled(inetd_t)
Chris PeBenito 17de1b
Chris PeBenito 24af9b
corecmd_bin_domtrans(inetd_t, inetd_child_t)
Chris PeBenito 24af9b
Chris PeBenito 17de1b
# base networking:
Chris PeBenito 190066
corenet_all_recvfrom_unlabeled(inetd_t)
Chris PeBenito 190066
corenet_all_recvfrom_netlabel(inetd_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_if(inetd_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_all_if(inetd_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_nodes(inetd_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_all_nodes(inetd_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_ports(inetd_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_all_ports(inetd_t)
Chris PeBenito 17de1b
corenet_tcp_bind_all_nodes(inetd_t)
Chris PeBenito 17de1b
corenet_udp_bind_all_nodes(inetd_t)
Chris PeBenito 17de1b
corenet_tcp_connect_all_ports(inetd_t)
Chris PeBenito 17de1b
corenet_sendrecv_all_client_packets(inetd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# listen on service ports:
Chris PeBenito 17de1b
corenet_tcp_bind_amanda_port(inetd_t)
Chris PeBenito 17de1b
corenet_udp_bind_amanda_port(inetd_t)
Chris PeBenito 17de1b
corenet_tcp_bind_auth_port(inetd_t)
Chris PeBenito 17de1b
corenet_udp_bind_comsat_port(inetd_t)
Chris PeBenito 17de1b
corenet_tcp_bind_dbskkd_port(inetd_t)
Chris PeBenito 17de1b
corenet_udp_bind_dbskkd_port(inetd_t)
Chris PeBenito 134a79
corenet_tcp_bind_ftp_port(inetd_t)
Chris PeBenito 17de1b
corenet_udp_bind_ftp_port(inetd_t)
Chris PeBenito 17de1b
corenet_tcp_bind_inetd_child_port(inetd_t)
Chris PeBenito 134a79
corenet_udp_bind_inetd_child_port(inetd_t)
Chris PeBenito 24af9b
corenet_tcp_bind_ircd_port(inetd_t)
Chris PeBenito 17de1b
corenet_udp_bind_ktalkd_port(inetd_t)
Chris PeBenito 17de1b
corenet_tcp_bind_printer_port(inetd_t)
Chris PeBenito 134a79
corenet_udp_bind_rlogind_port(inetd_t)
Chris PeBenito 17de1b
corenet_udp_bind_rsh_port(inetd_t)
Chris PeBenito 134a79
corenet_tcp_bind_rsh_port(inetd_t)
Chris PeBenito 17de1b
corenet_tcp_bind_rsync_port(inetd_t)
Chris PeBenito 17de1b
corenet_udp_bind_rsync_port(inetd_t)
Chris PeBenito 17de1b
#corenet_tcp_bind_stunnel_port(inetd_t)
Chris PeBenito 17de1b
corenet_tcp_bind_swat_port(inetd_t)
Chris PeBenito 17de1b
corenet_udp_bind_swat_port(inetd_t)
Chris PeBenito 134a79
corenet_tcp_bind_telnetd_port(inetd_t)
Chris PeBenito 17de1b
corenet_udp_bind_tftp_port(inetd_t)
Chris PeBenito 6b19be
corenet_tcp_bind_ssh_port(inetd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# service port packets:
Chris PeBenito 17de1b
corenet_sendrecv_amanda_server_packets(inetd_t)
Chris PeBenito 17de1b
corenet_sendrecv_auth_server_packets(inetd_t)
Chris PeBenito 17de1b
corenet_sendrecv_comsat_server_packets(inetd_t)
Chris PeBenito 17de1b
corenet_sendrecv_dbskkd_server_packets(inetd_t)
Chris PeBenito 17de1b
corenet_sendrecv_ftp_server_packets(inetd_t)
Chris PeBenito 17de1b
corenet_sendrecv_inetd_child_server_packets(inetd_t)
Chris PeBenito 24af9b
corenet_sendrecv_ircd_server_packets(inetd_t)
Chris PeBenito 17de1b
corenet_sendrecv_ktalkd_server_packets(inetd_t)
Chris PeBenito 17de1b
corenet_sendrecv_printer_server_packets(inetd_t)
Chris PeBenito 17de1b
corenet_sendrecv_rsh_server_packets(inetd_t)
Chris PeBenito 17de1b
corenet_sendrecv_rsync_server_packets(inetd_t)
Chris PeBenito 17de1b
#corenet_sendrecv_stunnel_server_packets(inetd_t)
Chris PeBenito 17de1b
corenet_sendrecv_swat_server_packets(inetd_t)
Chris PeBenito 17de1b
corenet_sendrecv_tftp_server_packets(inetd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
dev_read_sysfs(inetd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
fs_getattr_all_fs(inetd_t)
Chris PeBenito 17de1b
fs_search_auto_mountpoints(inetd_t)
Chris PeBenito 17de1b
Chris PeBenito 6b19be
selinux_validate_context(inetd_t)
Chris PeBenito 6b19be
selinux_compute_create_context(inetd_t)
Chris PeBenito 6b19be
Chris PeBenito 17de1b
# Run other daemons in the inetd_child_t domain.
Chris PeBenito 17de1b
corecmd_search_bin(inetd_t)
Chris PeBenito 8021cb
corecmd_read_bin_symlinks(inetd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
domain_use_interactive_fds(inetd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
files_read_etc_files(inetd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
libs_use_ld_so(inetd_t)
Chris PeBenito 17de1b
libs_use_shared_libs(inetd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
logging_send_syslog_msg(inetd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
miscfiles_read_localization(inetd_t)
Chris PeBenito 17de1b
Chris PeBenito 6b19be
# xinetd needs MLS override privileges to work
Chris PeBenito 6b19be
mls_fd_share_all_levels(inetd_t)
Chris PeBenito 6b19be
mls_socket_read_to_clearance(inetd_t)
Chris PeBenito 134a79
mls_socket_write_to_clearance(inetd_t)
Chris PeBenito 6b19be
mls_process_set_level(inetd_t)
Chris PeBenito 6b19be
Chris PeBenito 17de1b
sysnet_read_config(inetd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
userdom_dontaudit_use_unpriv_user_fds(inetd_t)
Chris PeBenito e9c6cd
Chris PeBenito e9c6cd
sysadm_dontaudit_search_home_dirs(inetd_t)
Chris PeBenito 17de1b
Chris PeBenito 24af9b
ifdef(`distro_redhat',`
Chris PeBenito 24af9b
	optional_policy(`
Chris PeBenito 24af9b
		unconfined_domain(inetd_t)
Chris PeBenito 24af9b
	')
Chris PeBenito 24af9b
')
Chris PeBenito 24af9b
Chris PeBenito 134a79
ifdef(`enable_mls',`
Chris PeBenito 134a79
	corenet_tcp_recvfrom_netlabel(inetd_t)
Chris PeBenito 134a79
	corenet_udp_recvfrom_netlabel(inetd_t)
Chris PeBenito 134a79
')
Chris PeBenito 24af9b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	amanda_search_lib(inetd_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	seutil_sigchld_newrole(inetd_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	udev_read_db(inetd_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 350b6a
optional_policy(`
Chris PeBenito 350b6a
	unconfined_domtrans(inetd_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# inetd child local_policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow inetd_child_t self:process signal_perms;
Chris PeBenito c0868a
allow inetd_child_t self:fifo_file rw_fifo_file_perms;
Chris PeBenito 17de1b
allow inetd_child_t self:tcp_socket connected_stream_socket_perms;
Chris PeBenito 17de1b
allow inetd_child_t self:udp_socket create_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# for identd
Chris PeBenito 17de1b
allow inetd_child_t self:netlink_tcpdiag_socket r_netlink_socket_perms;
Chris PeBenito 17de1b
allow inetd_child_t self:capability { setuid setgid };
Chris PeBenito 17de1b
files_search_home(inetd_child_t)
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
manage_dirs_pattern(inetd_child_t, inetd_child_tmp_t, inetd_child_tmp_t)
Chris PeBenito 0bfccd
manage_files_pattern(inetd_child_t, inetd_child_tmp_t, inetd_child_tmp_t)
Chris PeBenito 17de1b
files_tmp_filetrans(inetd_child_t, inetd_child_tmp_t, { file dir })
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
manage_files_pattern(inetd_child_t, inetd_child_var_run_t, inetd_child_var_run_t)
Chris PeBenito 0bfccd
files_pid_filetrans(inetd_child_t, inetd_child_var_run_t, file)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
kernel_read_kernel_sysctls(inetd_child_t)
Chris PeBenito 17de1b
kernel_read_system_state(inetd_child_t)
Chris PeBenito 17de1b
kernel_read_network_state(inetd_child_t)
Chris PeBenito 17de1b
Chris PeBenito 190066
corenet_all_recvfrom_unlabeled(inetd_child_t)
Chris PeBenito 190066
corenet_all_recvfrom_netlabel(inetd_child_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_if(inetd_child_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_all_if(inetd_child_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_nodes(inetd_child_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_all_nodes(inetd_child_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_ports(inetd_child_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_all_ports(inetd_child_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
dev_read_urand(inetd_child_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
fs_getattr_xattr_fs(inetd_child_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
files_read_etc_files(inetd_child_t)
Chris PeBenito 17de1b
Chris PeBenito 134a79
auth_use_nsswitch(inetd_child_t)
Chris PeBenito 134a79
Chris PeBenito 17de1b
libs_use_ld_so(inetd_child_t)
Chris PeBenito 17de1b
libs_use_shared_libs(inetd_child_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
logging_send_syslog_msg(inetd_child_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
miscfiles_read_localization(inetd_child_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
sysnet_read_config(inetd_child_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	kerberos_use(inetd_child_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 350b6a
optional_policy(`
Chris PeBenito 350b6a
	unconfined_domain(inetd_child_t)
Chris PeBenito 350b6a
')