2010-05-24 19:32:01 +00:00
|
|
|
policy_module(inetd, 1.11.0)
|
2005-06-27 18:36:56 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
2005-09-20 20:48:17 +00:00
|
|
|
type inetd_t;
|
2005-06-27 18:36:56 +00:00
|
|
|
type inetd_exec_t;
|
2008-07-23 21:38:39 +00:00
|
|
|
init_daemon_domain(inetd_t, inetd_exec_t)
|
2005-06-27 18:36:56 +00:00
|
|
|
|
|
|
|
type inetd_log_t;
|
|
|
|
logging_log_file(inetd_log_t)
|
|
|
|
|
|
|
|
type inetd_tmp_t;
|
|
|
|
files_tmp_file(inetd_tmp_t)
|
|
|
|
|
|
|
|
type inetd_var_run_t;
|
|
|
|
files_pid_file(inetd_var_run_t)
|
|
|
|
|
2005-07-13 20:48:51 +00:00
|
|
|
type inetd_child_t;
|
2005-06-27 18:36:56 +00:00
|
|
|
type inetd_child_exec_t;
|
2008-07-23 21:38:39 +00:00
|
|
|
inetd_service_domain(inetd_child_t, inetd_child_exec_t)
|
2005-06-27 18:36:56 +00:00
|
|
|
role system_r types inetd_child_t;
|
|
|
|
|
|
|
|
type inetd_child_tmp_t;
|
|
|
|
files_tmp_file(inetd_child_tmp_t)
|
|
|
|
|
|
|
|
type inetd_child_var_run_t;
|
|
|
|
files_pid_file(inetd_child_var_run_t)
|
|
|
|
|
2008-08-29 13:21:53 +00:00
|
|
|
ifdef(`enable_mcs',`
|
2009-06-26 14:40:13 +00:00
|
|
|
init_ranged_daemon_domain(inetd_t, inetd_exec_t, s0 - mcs_systemhigh)
|
2008-08-29 13:21:53 +00:00
|
|
|
')
|
|
|
|
|
2005-06-27 18:36:56 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Local policy
|
|
|
|
#
|
|
|
|
|
|
|
|
allow inetd_t self:capability { setuid setgid };
|
|
|
|
dontaudit inetd_t self:capability sys_tty_config;
|
2007-02-16 23:01:42 +00:00
|
|
|
allow inetd_t self:process { setsched setexec };
|
2006-12-12 20:08:08 +00:00
|
|
|
allow inetd_t self:fifo_file rw_fifo_file_perms;
|
2005-06-27 18:36:56 +00:00
|
|
|
allow inetd_t self:tcp_socket create_stream_socket_perms;
|
2006-05-17 20:55:12 +00:00
|
|
|
allow inetd_t self:udp_socket create_socket_perms;
|
2007-02-16 23:01:42 +00:00
|
|
|
allow inetd_t self:fd use;
|
2005-06-27 18:36:56 +00:00
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
allow inetd_t inetd_log_t:file manage_file_perms;
|
2008-07-23 21:38:39 +00:00
|
|
|
logging_log_filetrans(inetd_t, inetd_log_t, file)
|
2005-06-27 18:36:56 +00:00
|
|
|
|
2008-07-23 21:38:39 +00:00
|
|
|
manage_dirs_pattern(inetd_t, inetd_tmp_t, inetd_tmp_t)
|
|
|
|
manage_files_pattern(inetd_t, inetd_tmp_t, inetd_tmp_t)
|
2006-02-21 18:40:44 +00:00
|
|
|
files_tmp_filetrans(inetd_t, inetd_tmp_t, { file dir })
|
2005-06-27 18:36:56 +00:00
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
allow inetd_t inetd_var_run_t:file manage_file_perms;
|
2008-07-23 21:38:39 +00:00
|
|
|
files_pid_filetrans(inetd_t, inetd_var_run_t, file)
|
2005-06-27 18:36:56 +00:00
|
|
|
|
2006-01-31 16:49:43 +00:00
|
|
|
kernel_read_kernel_sysctls(inetd_t)
|
2005-07-12 20:34:24 +00:00
|
|
|
kernel_list_proc(inetd_t)
|
|
|
|
kernel_read_proc_symlinks(inetd_t)
|
2007-02-16 23:01:42 +00:00
|
|
|
kernel_read_system_state(inetd_t)
|
|
|
|
kernel_tcp_recvfrom_unlabeled(inetd_t)
|
2005-06-27 18:36:56 +00:00
|
|
|
|
2008-08-29 13:21:53 +00:00
|
|
|
corecmd_bin_domtrans(inetd_t, inetd_child_t)
|
|
|
|
|
2006-06-02 13:48:34 +00:00
|
|
|
# base networking:
|
2007-06-27 15:23:21 +00:00
|
|
|
corenet_all_recvfrom_unlabeled(inetd_t)
|
|
|
|
corenet_all_recvfrom_netlabel(inetd_t)
|
2009-01-06 20:24:10 +00:00
|
|
|
corenet_tcp_sendrecv_generic_if(inetd_t)
|
|
|
|
corenet_udp_sendrecv_generic_if(inetd_t)
|
2009-01-09 19:48:02 +00:00
|
|
|
corenet_tcp_sendrecv_generic_node(inetd_t)
|
|
|
|
corenet_udp_sendrecv_generic_node(inetd_t)
|
2005-06-27 18:36:56 +00:00
|
|
|
corenet_tcp_sendrecv_all_ports(inetd_t)
|
|
|
|
corenet_udp_sendrecv_all_ports(inetd_t)
|
2009-01-09 19:48:02 +00:00
|
|
|
corenet_tcp_bind_generic_node(inetd_t)
|
|
|
|
corenet_udp_bind_generic_node(inetd_t)
|
2005-09-12 21:40:56 +00:00
|
|
|
corenet_tcp_connect_all_ports(inetd_t)
|
2006-06-02 13:48:34 +00:00
|
|
|
corenet_sendrecv_all_client_packets(inetd_t)
|
2005-06-27 18:36:56 +00:00
|
|
|
|
|
|
|
# listen on service ports:
|
2005-10-22 19:58:58 +00:00
|
|
|
corenet_tcp_bind_amanda_port(inetd_t)
|
|
|
|
corenet_udp_bind_amanda_port(inetd_t)
|
2005-09-12 21:40:56 +00:00
|
|
|
corenet_tcp_bind_auth_port(inetd_t)
|
2006-06-02 13:48:34 +00:00
|
|
|
corenet_udp_bind_comsat_port(inetd_t)
|
2005-06-27 18:36:56 +00:00
|
|
|
corenet_tcp_bind_dbskkd_port(inetd_t)
|
|
|
|
corenet_udp_bind_dbskkd_port(inetd_t)
|
2007-09-11 19:24:32 +00:00
|
|
|
corenet_tcp_bind_ftp_port(inetd_t)
|
2005-06-27 18:36:56 +00:00
|
|
|
corenet_udp_bind_ftp_port(inetd_t)
|
|
|
|
corenet_tcp_bind_inetd_child_port(inetd_t)
|
2007-09-11 19:24:32 +00:00
|
|
|
corenet_udp_bind_inetd_child_port(inetd_t)
|
2008-08-29 13:21:53 +00:00
|
|
|
corenet_tcp_bind_ircd_port(inetd_t)
|
2005-06-27 18:36:56 +00:00
|
|
|
corenet_udp_bind_ktalkd_port(inetd_t)
|
2005-10-23 22:10:59 +00:00
|
|
|
corenet_tcp_bind_printer_port(inetd_t)
|
2007-09-11 19:24:32 +00:00
|
|
|
corenet_udp_bind_rlogind_port(inetd_t)
|
2005-06-27 18:36:56 +00:00
|
|
|
corenet_udp_bind_rsh_port(inetd_t)
|
2007-09-11 19:24:32 +00:00
|
|
|
corenet_tcp_bind_rsh_port(inetd_t)
|
2005-06-27 18:36:56 +00:00
|
|
|
corenet_tcp_bind_rsync_port(inetd_t)
|
|
|
|
corenet_udp_bind_rsync_port(inetd_t)
|
|
|
|
#corenet_tcp_bind_stunnel_port(inetd_t)
|
|
|
|
corenet_tcp_bind_swat_port(inetd_t)
|
|
|
|
corenet_udp_bind_swat_port(inetd_t)
|
2007-09-11 19:24:32 +00:00
|
|
|
corenet_tcp_bind_telnetd_port(inetd_t)
|
2005-09-16 15:18:09 +00:00
|
|
|
corenet_udp_bind_tftp_port(inetd_t)
|
2007-02-16 23:01:42 +00:00
|
|
|
corenet_tcp_bind_ssh_port(inetd_t)
|
2010-01-08 15:36:49 +00:00
|
|
|
corenet_tcp_bind_git_port(inetd_t)
|
|
|
|
corenet_udp_bind_git_port(inetd_t)
|
2005-06-27 18:36:56 +00:00
|
|
|
|
2006-06-02 13:48:34 +00:00
|
|
|
# service port packets:
|
|
|
|
corenet_sendrecv_amanda_server_packets(inetd_t)
|
|
|
|
corenet_sendrecv_auth_server_packets(inetd_t)
|
|
|
|
corenet_sendrecv_comsat_server_packets(inetd_t)
|
|
|
|
corenet_sendrecv_dbskkd_server_packets(inetd_t)
|
|
|
|
corenet_sendrecv_ftp_server_packets(inetd_t)
|
|
|
|
corenet_sendrecv_inetd_child_server_packets(inetd_t)
|
2008-08-29 13:21:53 +00:00
|
|
|
corenet_sendrecv_ircd_server_packets(inetd_t)
|
2006-06-02 13:48:34 +00:00
|
|
|
corenet_sendrecv_ktalkd_server_packets(inetd_t)
|
|
|
|
corenet_sendrecv_printer_server_packets(inetd_t)
|
|
|
|
corenet_sendrecv_rsh_server_packets(inetd_t)
|
|
|
|
corenet_sendrecv_rsync_server_packets(inetd_t)
|
|
|
|
#corenet_sendrecv_stunnel_server_packets(inetd_t)
|
|
|
|
corenet_sendrecv_swat_server_packets(inetd_t)
|
|
|
|
corenet_sendrecv_tftp_server_packets(inetd_t)
|
|
|
|
|
2005-06-27 18:36:56 +00:00
|
|
|
dev_read_sysfs(inetd_t)
|
|
|
|
|
|
|
|
fs_getattr_all_fs(inetd_t)
|
|
|
|
fs_search_auto_mountpoints(inetd_t)
|
|
|
|
|
2007-02-16 23:01:42 +00:00
|
|
|
selinux_validate_context(inetd_t)
|
|
|
|
selinux_compute_create_context(inetd_t)
|
|
|
|
|
2005-06-27 20:59:28 +00:00
|
|
|
# Run other daemons in the inetd_child_t domain.
|
|
|
|
corecmd_search_bin(inetd_t)
|
2007-03-23 23:24:59 +00:00
|
|
|
corecmd_read_bin_symlinks(inetd_t)
|
2005-06-27 20:59:28 +00:00
|
|
|
|
2006-02-20 21:33:25 +00:00
|
|
|
domain_use_interactive_fds(inetd_t)
|
2005-06-27 18:36:56 +00:00
|
|
|
|
2005-06-29 14:26:41 +00:00
|
|
|
files_read_etc_files(inetd_t)
|
2008-11-11 16:38:34 +00:00
|
|
|
files_read_etc_runtime_files(inetd_t)
|
2005-06-27 18:36:56 +00:00
|
|
|
|
2010-01-08 15:36:49 +00:00
|
|
|
auth_use_nsswitch(inetd_t)
|
|
|
|
|
2005-06-27 18:36:56 +00:00
|
|
|
logging_send_syslog_msg(inetd_t)
|
|
|
|
|
|
|
|
miscfiles_read_localization(inetd_t)
|
|
|
|
|
2007-02-16 23:01:42 +00:00
|
|
|
# xinetd needs MLS override privileges to work
|
|
|
|
mls_fd_share_all_levels(inetd_t)
|
|
|
|
mls_socket_read_to_clearance(inetd_t)
|
2007-09-11 19:24:32 +00:00
|
|
|
mls_socket_write_to_clearance(inetd_t)
|
2007-02-16 23:01:42 +00:00
|
|
|
mls_process_set_level(inetd_t)
|
|
|
|
|
2005-06-27 18:36:56 +00:00
|
|
|
sysnet_read_config(inetd_t)
|
|
|
|
|
2006-02-20 21:33:25 +00:00
|
|
|
userdom_dontaudit_use_unpriv_user_fds(inetd_t)
|
2008-11-05 16:10:46 +00:00
|
|
|
userdom_dontaudit_search_user_home_dirs(inetd_t)
|
2005-06-27 18:36:56 +00:00
|
|
|
|
2008-08-29 13:21:53 +00:00
|
|
|
ifdef(`distro_redhat',`
|
|
|
|
optional_policy(`
|
|
|
|
unconfined_domain(inetd_t)
|
|
|
|
')
|
|
|
|
')
|
|
|
|
|
2007-09-11 19:24:32 +00:00
|
|
|
ifdef(`enable_mls',`
|
|
|
|
corenet_tcp_recvfrom_netlabel(inetd_t)
|
|
|
|
corenet_udp_recvfrom_netlabel(inetd_t)
|
|
|
|
')
|
2008-08-29 13:21:53 +00:00
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-10-22 19:58:58 +00:00
|
|
|
amanda_search_lib(inetd_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-06-29 14:26:41 +00:00
|
|
|
seutil_sigchld_newrole(inetd_t)
|
2005-06-27 18:36:56 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-06-27 18:36:56 +00:00
|
|
|
udev_read_db(inetd_t)
|
|
|
|
')
|
|
|
|
|
2007-10-02 16:04:50 +00:00
|
|
|
optional_policy(`
|
|
|
|
unconfined_domtrans(inetd_t)
|
2005-07-12 20:34:24 +00:00
|
|
|
')
|
|
|
|
|
2005-06-27 18:36:56 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# inetd child local_policy
|
|
|
|
#
|
|
|
|
|
|
|
|
allow inetd_child_t self:process signal_perms;
|
2006-12-12 20:08:08 +00:00
|
|
|
allow inetd_child_t self:fifo_file rw_fifo_file_perms;
|
2005-11-10 21:37:54 +00:00
|
|
|
allow inetd_child_t self:tcp_socket connected_stream_socket_perms;
|
|
|
|
allow inetd_child_t self:udp_socket create_socket_perms;
|
2005-06-27 18:36:56 +00:00
|
|
|
|
|
|
|
# for identd
|
|
|
|
allow inetd_child_t self:netlink_tcpdiag_socket r_netlink_socket_perms;
|
|
|
|
allow inetd_child_t self:capability { setuid setgid };
|
2005-07-12 20:34:24 +00:00
|
|
|
files_search_home(inetd_child_t)
|
2005-06-27 18:36:56 +00:00
|
|
|
|
2008-07-23 21:38:39 +00:00
|
|
|
manage_dirs_pattern(inetd_child_t, inetd_child_tmp_t, inetd_child_tmp_t)
|
|
|
|
manage_files_pattern(inetd_child_t, inetd_child_tmp_t, inetd_child_tmp_t)
|
2006-02-21 18:40:44 +00:00
|
|
|
files_tmp_filetrans(inetd_child_t, inetd_child_tmp_t, { file dir })
|
2005-06-27 18:36:56 +00:00
|
|
|
|
2008-07-23 21:38:39 +00:00
|
|
|
manage_files_pattern(inetd_child_t, inetd_child_var_run_t, inetd_child_var_run_t)
|
|
|
|
files_pid_filetrans(inetd_child_t, inetd_child_var_run_t, file)
|
2005-06-27 18:36:56 +00:00
|
|
|
|
2006-01-31 16:49:43 +00:00
|
|
|
kernel_read_kernel_sysctls(inetd_child_t)
|
2005-06-27 18:36:56 +00:00
|
|
|
kernel_read_system_state(inetd_child_t)
|
|
|
|
kernel_read_network_state(inetd_child_t)
|
|
|
|
|
2007-06-27 15:23:21 +00:00
|
|
|
corenet_all_recvfrom_unlabeled(inetd_child_t)
|
|
|
|
corenet_all_recvfrom_netlabel(inetd_child_t)
|
2009-01-06 20:24:10 +00:00
|
|
|
corenet_tcp_sendrecv_generic_if(inetd_child_t)
|
|
|
|
corenet_udp_sendrecv_generic_if(inetd_child_t)
|
2009-01-09 19:48:02 +00:00
|
|
|
corenet_tcp_sendrecv_generic_node(inetd_child_t)
|
|
|
|
corenet_udp_sendrecv_generic_node(inetd_child_t)
|
2005-06-27 18:36:56 +00:00
|
|
|
corenet_tcp_sendrecv_all_ports(inetd_child_t)
|
2005-10-24 00:54:39 +00:00
|
|
|
corenet_udp_sendrecv_all_ports(inetd_child_t)
|
2005-06-27 18:36:56 +00:00
|
|
|
|
|
|
|
dev_read_urand(inetd_child_t)
|
|
|
|
|
|
|
|
fs_getattr_xattr_fs(inetd_child_t)
|
|
|
|
|
2005-06-29 14:26:41 +00:00
|
|
|
files_read_etc_files(inetd_child_t)
|
2008-11-11 16:38:34 +00:00
|
|
|
files_read_etc_runtime_files(inetd_child_t)
|
2005-06-27 18:36:56 +00:00
|
|
|
|
2007-09-11 19:24:32 +00:00
|
|
|
auth_use_nsswitch(inetd_child_t)
|
|
|
|
|
2005-06-27 18:36:56 +00:00
|
|
|
logging_send_syslog_msg(inetd_child_t)
|
|
|
|
|
|
|
|
miscfiles_read_localization(inetd_child_t)
|
|
|
|
|
|
|
|
sysnet_read_config(inetd_child_t)
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-07-01 13:31:34 +00:00
|
|
|
kerberos_use(inetd_child_t)
|
|
|
|
')
|
|
|
|
|
2007-10-02 16:04:50 +00:00
|
|
|
optional_policy(`
|
|
|
|
unconfined_domain(inetd_child_t)
|
|
|
|
')
|