Chris PeBenito 17de1b
## <summary>Policy for NIS (YP) servers and clients</summary>
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Use the ypbind service to access NIS services
Chris PeBenito 17de1b
##	unconditionally.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <desc>
Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
##	Use the ypbind service to access NIS services
Chris PeBenito 17de1b
##	unconditionally.
Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
##	This interface was added because of apache and
Chris PeBenito 17de1b
##	spamassassin, to fix a nested conditionals problem.
Chris PeBenito 17de1b
##	When that support is added, this should be removed,
Chris PeBenito 17de1b
##	and the regular	interface should be used.
Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
## </desc>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The type of the process performing this action.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`nis_use_ypbind_uncond',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type var_yp_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	dontaudit $1 self:capability net_bind_service;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1 self:tcp_socket create_stream_socket_perms;
Chris PeBenito 17de1b
	allow $1 self:udp_socket create_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito c0868a
	allow $1 var_yp_t:dir list_dir_perms;
Chris PeBenito 17de1b
	allow $1 var_yp_t:lnk_file { getattr read };
Chris PeBenito c0868a
	allow $1 var_yp_t:file read_file_perms;
Chris PeBenito 17de1b
Chris PeBenito 190066
	corenet_all_recvfrom_unlabeled($1)
Chris PeBenito 190066
	corenet_all_recvfrom_netlabel($1)
Chris PeBenito 668b30
	corenet_tcp_sendrecv_generic_if($1)
Chris PeBenito 668b30
	corenet_udp_sendrecv_generic_if($1)
Chris PeBenito c12621
	corenet_tcp_sendrecv_generic_node($1)
Chris PeBenito c12621
	corenet_udp_sendrecv_generic_node($1)
Chris PeBenito 17de1b
	corenet_tcp_sendrecv_all_ports($1)
Chris PeBenito 17de1b
	corenet_udp_sendrecv_all_ports($1)
Chris PeBenito c12621
	corenet_tcp_bind_generic_node($1)
Chris PeBenito c12621
	corenet_udp_bind_generic_node($1)
Chris PeBenito 17de1b
	corenet_tcp_bind_generic_port($1)
Chris PeBenito 17de1b
	corenet_udp_bind_generic_port($1)
Chris PeBenito c98980
	corenet_dontaudit_tcp_bind_all_reserved_ports($1)
Chris PeBenito c98980
	corenet_dontaudit_udp_bind_all_reserved_ports($1)
Chris PeBenito 6b19be
	corenet_dontaudit_tcp_bind_all_ports($1)
Chris PeBenito 6b19be
	corenet_dontaudit_udp_bind_all_ports($1)
Chris PeBenito 17de1b
	corenet_tcp_connect_portmap_port($1)
Chris PeBenito 17de1b
	corenet_tcp_connect_reserved_port($1)
Chris PeBenito 17de1b
	corenet_tcp_connect_generic_port($1)
Chris PeBenito 6b19be
	corenet_dontaudit_tcp_connect_all_ports($1)
Chris PeBenito 17de1b
	corenet_sendrecv_portmap_client_packets($1)
Chris PeBenito 17de1b
	corenet_sendrecv_generic_client_packets($1)
Chris PeBenito 17de1b
	corenet_sendrecv_generic_server_packets($1)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	sysnet_read_config($1)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Use the ypbind service to access NIS services.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 0bbb16
## <desc>
Chris PeBenito 0bbb16
##	

Chris PeBenito 0bbb16
##	Allow the specified domain to use the ypbind service
Chris PeBenito 0bbb16
##	to access Network Information Service (NIS) services.
Chris PeBenito 0bbb16
##	Information that can be retreived from NIS includes
Chris PeBenito 0bbb16
##	usernames, passwords, home directories, and groups.
Chris PeBenito 0bbb16
##	If the network is configured to have a single sign-on
Chris PeBenito 0bbb16
##	using NIS, it is likely that any program that does
Chris PeBenito 0bbb16
##	authentication will need this access.
Chris PeBenito 0bbb16
##	

Chris PeBenito 0bbb16
## </desc>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 0bbb16
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 0bbb16
## <infoflow type="both" weight="10"/>
Chris PeBenito bbcd3c
## <rolecap/>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`nis_use_ypbind',`
Chris PeBenito c98980
	tunable_policy(`allow_ypbind',`
Chris PeBenito c98980
		nis_use_ypbind_uncond($1)
Chris PeBenito 17de1b
	')
Chris PeBenito c98980
')
Chris PeBenito 17de1b
Chris PeBenito c98980
########################################
Chris PeBenito c98980
## <summary>
Chris PeBenito c98980
##	Use the nis to authenticate passwords
Chris PeBenito c98980
## </summary>
Chris PeBenito c98980
## <param name="domain">
Chris PeBenito c98980
##	<summary>
Chris PeBenito c98980
##	Domain allowed access.
Chris PeBenito c98980
##	</summary>
Chris PeBenito c98980
## </param>
Chris PeBenito c98980
## <rolecap/>
Chris PeBenito c98980
#
Chris PeBenito c98980
interface(`nis_authenticate',`
Chris PeBenito 17de1b
	tunable_policy(`allow_ypbind',`
Chris PeBenito 17de1b
		nis_use_ypbind_uncond($1)
Chris PeBenito c98980
		corenet_tcp_bind_all_rpc_ports($1)
Chris PeBenito c98980
		corenet_udp_bind_all_rpc_ports($1)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute ypbind in the ypbind domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`nis_domtrans_ypbind',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type ypbind_t, ypbind_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	corecmd_search_bin($1)
Chris PeBenito 0bfccd
	domtrans_pattern($1, ypbind_exec_t, ypbind_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Send generic signals to ypbind.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The type of the process performing this action.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`nis_signal_ypbind',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type ypbind_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1 ypbind_t:process signal;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	List the contents of the NIS data directory.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The type of the process performing this action.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`nis_list_var_yp',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type var_yp_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_var($1)
Chris PeBenito c0868a
	allow $1 var_yp_t:dir list_dir_perms;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 33c7e6
##	Send UDP network traffic to NIS clients.  (Deprecated)
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The type of the process performing this action.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`nis_udp_send_ypbind',`
Chris PeBenito 33c7e6
	refpolicywarn(`$0($*) has been deprecated.')
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 33c7e6
##	Connect to ypbind over TCP.  (Deprecated)
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`nis_tcp_connect_ypbind',`
Chris PeBenito 33c7e6
	refpolicywarn(`$0($*) has been deprecated.')
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Read ypbind pid files.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`nis_read_ypbind_pid',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type ypbind_var_run_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_pids($1)
Chris PeBenito c0868a
	allow $1 ypbind_var_run_t:file read_file_perms;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Delete ypbind pid files.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`nis_delete_ypbind_pid',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type ypbind_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# TODO: add delete pid from dir call to files
Chris PeBenito 17de1b
	allow $1 ypbind_t:file unlink;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Read ypserv configuration files.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`nis_read_ypserv_config',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type ypserv_conf_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_etc($1)
Chris PeBenito 82d277
	allow $1 ypserv_conf_t:file read_file_perms;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute ypxfr in the ypxfr domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`nis_domtrans_ypxfr',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type ypxfr_t, ypxfr_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	corecmd_search_bin($1)
Chris PeBenito 0bfccd
	domtrans_pattern($1, ypxfr_exec_t, ypxfr_t)
Chris PeBenito 17de1b
')
Chris PeBenito c98980
Chris PeBenito c98980
########################################
Chris PeBenito c98980
## <summary>
Chris PeBenito c98980
##	All of the rules required to administrate 
Chris PeBenito c98980
##	an nis environment
Chris PeBenito c98980
## </summary>
Chris PeBenito c98980
## <param name="domain">
Chris PeBenito c98980
##	<summary>
Chris PeBenito c98980
##	Domain allowed access.
Chris PeBenito c98980
##	</summary>
Chris PeBenito c98980
## </param>
Chris PeBenito c98980
## <param name="role">
Chris PeBenito c98980
##	<summary>
Chris PeBenito c98980
##	Role allowed access.
Chris PeBenito c98980
##	</summary>
Chris PeBenito c98980
## </param>
Chris PeBenito c98980
## <rolecap/>
Chris PeBenito c98980
#
Chris PeBenito c98980
interface(`nis_admin',`
Chris PeBenito c98980
	gen_require(`
Chris PeBenito c98980
		type ypbind_t, yppasswdd_t, ypserv_t, ypxfr_t;
Chris PeBenito c98980
		type ypbind_tmp_t, ypserv_tmp_t, ypserv_conf_t;
Chris PeBenito c98980
		type ypbind_var_run_t, yppasswdd_var_run_t, ypserv_var_run_t;
Chris PeBenito c98980
	')
Chris PeBenito c98980
Chris PeBenito c98980
	allow $1 ypbind_t:process { ptrace signal_perms };
Chris PeBenito c98980
	ps_process_pattern($1, ypbind_t)
Chris PeBenito c98980
Chris PeBenito c98980
	allow $1 yppasswdd_t:process { ptrace signal_perms };
Chris PeBenito c98980
	ps_process_pattern($1, yppasswdd_t)
Chris PeBenito c98980
Chris PeBenito c98980
	allow $1 ypserv_t:process { ptrace signal_perms };
Chris PeBenito c98980
	ps_process_pattern($1, ypserv_t)
Chris PeBenito c98980
Chris PeBenito c98980
	allow $1 ypxfr_t:process { ptrace signal_perms };
Chris PeBenito c98980
	ps_process_pattern($1, ypxfr_t)
Chris PeBenito c98980
Chris PeBenito c98980
	files_list_tmp($1)
Chris PeBenito c98980
	admin_pattern($1, ypbind_tmp_t)
Chris PeBenito c98980
Chris PeBenito c98980
	files_list_pids($1)
Chris PeBenito c98980
	admin_pattern($1, ypbind_var_run_t)
Chris PeBenito c98980
Chris PeBenito c98980
	admin_pattern($1, yppasswdd_var_run_t)
Chris PeBenito c98980
Chris PeBenito c98980
	files_list_etc($1)
Chris PeBenito c98980
	admin_pattern($1, ypserv_conf_t)
Chris PeBenito c98980
Chris PeBenito c98980
	admin_pattern($1, ypserv_tmp_t)
Chris PeBenito c98980
Chris PeBenito c98980
	admin_pattern($1, ypserv_var_run_t)
Chris PeBenito c98980
')