selinux-policy/refpolicy/policy/modules/services/inetd.te

231 lines
5.6 KiB
Plaintext
Raw Normal View History

2005-06-27 18:36:56 +00:00
policy_module(inetd,1.1.2)
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;
init_daemon_domain(inetd_t,inetd_exec_t)
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;
inetd_service_domain(inetd_child_t,inetd_child_exec_t)
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)
########################################
#
# Local policy
#
allow inetd_t self:capability { setuid setgid };
dontaudit inetd_t self:capability sys_tty_config;
allow inetd_t self:process setsched;
allow inetd_t self:fifo_file rw_file_perms;
allow inetd_t self:tcp_socket create_stream_socket_perms;
allow inetd_t self:udp_socket create_socket_perms;
2005-06-27 18:36:56 +00:00
allow inetd_t inetd_log_t:file create_file_perms;
logging_log_filetrans(inetd_t,inetd_log_t,file)
2005-06-27 18:36:56 +00:00
allow inetd_t inetd_tmp_t:dir create_dir_perms;
allow inetd_t inetd_tmp_t:file create_file_perms;
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
allow inetd_t inetd_var_run_t:file create_file_perms;
files_pid_filetrans(inetd_t,inetd_var_run_t,file)
2005-06-27 18:36:56 +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)
2005-09-08 17:12:38 +00:00
kernel_tcp_recvfrom(inetd_t)
2005-06-27 18:36:56 +00:00
# networking:
corenet_non_ipsec_sendrecv(inetd_t)
2005-06-27 18:36:56 +00:00
corenet_tcp_sendrecv_all_if(inetd_t)
corenet_udp_sendrecv_all_if(inetd_t)
corenet_tcp_sendrecv_all_nodes(inetd_t)
corenet_udp_sendrecv_all_nodes(inetd_t)
corenet_tcp_sendrecv_all_ports(inetd_t)
corenet_udp_sendrecv_all_ports(inetd_t)
corenet_tcp_bind_all_nodes(inetd_t)
corenet_udp_bind_all_nodes(inetd_t)
corenet_tcp_connect_all_ports(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)
corenet_tcp_bind_auth_port(inetd_t)
2005-06-27 18:36:56 +00:00
#corenet_udp_bind_comsat_port(inetd_t)
corenet_tcp_bind_dbskkd_port(inetd_t)
corenet_udp_bind_dbskkd_port(inetd_t)
corenet_udp_bind_ftp_port(inetd_t)
corenet_tcp_bind_inetd_child_port(inetd_t)
corenet_tcp_bind_inetd_child_port(inetd_t)
corenet_udp_bind_ktalkd_port(inetd_t)
2005-10-23 22:10:59 +00:00
corenet_tcp_bind_printer_port(inetd_t)
2005-06-27 18:36:56 +00:00
corenet_udp_bind_rsh_port(inetd_t)
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)
2005-09-16 15:18:09 +00:00
corenet_udp_bind_tftp_port(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)
term_dontaudit_use_console(inetd_t)
2005-06-27 20:59:28 +00:00
# Run other daemons in the inetd_child_t domain.
corecmd_search_bin(inetd_t)
2006-02-02 21:08:12 +00:00
corecmd_read_sbin_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
files_read_etc_files(inetd_t)
2005-06-27 18:36:56 +00:00
init_use_fds(inetd_t)
2006-02-02 21:08:12 +00:00
init_use_script_ptys(inetd_t)
2005-06-27 18:36:56 +00:00
libs_use_ld_so(inetd_t)
libs_use_shared_libs(inetd_t)
logging_send_syslog_msg(inetd_t)
miscfiles_read_localization(inetd_t)
sysnet_read_config(inetd_t)
2006-02-20 21:33:25 +00:00
userdom_dontaudit_use_unpriv_user_fds(inetd_t)
2006-02-21 18:40:44 +00:00
userdom_dontaudit_search_sysadm_home_dirs(inetd_t)
2005-06-27 18:36:56 +00:00
ifdef(`targeted_policy', `
2006-02-02 21:08:12 +00:00
term_dontaudit_use_unallocated_ttys(inetd_t)
term_dontaudit_use_generic_ptys(inetd_t)
files_dontaudit_read_root_files(inetd_t)
2005-06-27 18:36:56 +00:00
')
optional_policy(`
2005-10-22 19:58:58 +00:00
amanda_search_lib(inetd_t)
')
optional_policy(`
2005-06-27 20:59:28 +00:00
mount_send_nfs_client_request(inetd_t)
2005-06-27 18:36:56 +00:00
')
2005-09-20 20:48:17 +00:00
# Communicate with the portmapper.
optional_policy(`
2006-02-02 21:08:12 +00:00
portmap_udp_send(inetd_t)
2005-09-20 20:48:17 +00:00
')
optional_policy(`
seutil_sigchld_newrole(inetd_t)
2005-06-27 18:36:56 +00:00
')
optional_policy(`
2005-06-27 18:36:56 +00:00
udev_read_db(inetd_t)
')
2005-10-21 21:35:25 +00:00
ifdef(`targeted_policy',`
unconfined_domain(inetd_t)
',`
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;
allow inetd_child_t self:fifo_file rw_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 };
allow inetd_child_t self:dir search;
allow inetd_child_t self:{ lnk_file file } { getattr read };
2005-07-12 20:34:24 +00:00
files_search_home(inetd_child_t)
2005-06-27 18:36:56 +00:00
allow inetd_child_t inetd_child_tmp_t:dir create_dir_perms;
allow inetd_child_t inetd_child_tmp_t:file create_file_perms;
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
allow inetd_child_t inetd_child_var_run_t:file create_file_perms;
allow inetd_child_t inetd_child_var_run_t:dir rw_dir_perms;
files_pid_filetrans(inetd_child_t,inetd_child_var_run_t,file)
2005-06-27 18:36:56 +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)
corenet_non_ipsec_sendrecv(inetd_child_t)
2005-06-27 18:36:56 +00:00
corenet_tcp_sendrecv_all_if(inetd_child_t)
2005-10-21 21:35:25 +00:00
corenet_udp_sendrecv_all_if(inetd_child_t)
2005-06-27 18:36:56 +00:00
corenet_tcp_sendrecv_all_nodes(inetd_child_t)
2005-10-21 21:35:25 +00:00
corenet_udp_sendrecv_all_nodes(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)
files_read_etc_files(inetd_child_t)
2005-06-27 18:36:56 +00:00
libs_use_ld_so(inetd_child_t)
libs_use_shared_libs(inetd_child_t)
logging_send_syslog_msg(inetd_child_t)
miscfiles_read_localization(inetd_child_t)
sysnet_read_config(inetd_child_t)
tunable_policy(`run_ssh_inetd',`
corenet_tcp_bind_ssh_port(inetd_t)
')
optional_policy(`
2005-10-05 19:52:53 +00:00
tunable_policy(`ftpd_is_daemon',`
# Allows it to check exec privs on daemon
ftp_check_exec(inetd_t)
')
')
optional_policy(`
2005-07-01 13:31:34 +00:00
kerberos_use(inetd_child_t)
')
optional_policy(`
2005-06-27 18:36:56 +00:00
nis_use_ypbind(inetd_child_t)
')
2005-07-13 20:48:51 +00:00
optional_policy(`
2006-02-02 21:08:12 +00:00
nscd_socket_use(inetd_child_t)
2005-07-13 20:48:51 +00:00
')