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

1ec3d1a
##	Use the ypbind service to access NIS services
1ec3d1a
##	unconditionally.
1ec3d1a
##	

1ec3d1a
##	

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

1ec3d1a
## </desc>
1ec3d1a
## <param name="domain">
1ec3d1a
##	<summary>
1ec3d1a
##	Domain allowed access.
1ec3d1a
##	</summary>
1ec3d1a
## </param>
1ec3d1a
#
1ec3d1a
interface(`nis_use_ypbind_uncond',`
1ec3d1a
	gen_require(`
1ec3d1a
		type var_yp_t;
1ec3d1a
	')
1ec3d1a
	allow $1 self:tcp_socket create_stream_socket_perms;
1ec3d1a
	allow $1 self:udp_socket create_socket_perms;
1ec3d1a
1ec3d1a
	allow $1 var_yp_t:dir list_dir_perms;
1ec3d1a
	allow $1 var_yp_t:lnk_file read_lnk_file_perms;
1ec3d1a
	allow $1 var_yp_t:file read_file_perms;
1ec3d1a
1ec3d1a
	corenet_tcp_sendrecv_generic_if($1)
1ec3d1a
	corenet_udp_sendrecv_generic_if($1)
1ec3d1a
	corenet_tcp_sendrecv_generic_node($1)
1ec3d1a
	corenet_udp_sendrecv_generic_node($1)
1ec3d1a
	corenet_tcp_sendrecv_all_ports($1)
1ec3d1a
	corenet_udp_sendrecv_all_ports($1)
1ec3d1a
	corenet_tcp_bind_generic_node($1)
1ec3d1a
	corenet_udp_bind_generic_node($1)
1ec3d1a
	corenet_tcp_bind_generic_port($1)
1ec3d1a
	corenet_udp_bind_generic_port($1)
1ec3d1a
	corenet_tcp_bind_all_rpc_ports($1)
1ec3d1a
	corenet_udp_bind_all_rpc_ports($1)
1ec3d1a
	corenet_dontaudit_tcp_bind_all_ports($1)
1ec3d1a
	corenet_dontaudit_udp_bind_all_ports($1)
1ec3d1a
	corenet_tcp_connect_portmap_port($1)
1ec3d1a
	corenet_tcp_connect_all_reserved_ports($1)
1ec3d1a
	corenet_tcp_connect_generic_port($1)
1ec3d1a
	corenet_sendrecv_portmap_client_packets($1)
1ec3d1a
	corenet_sendrecv_generic_client_packets($1)
1ec3d1a
	corenet_sendrecv_generic_server_packets($1)
1ec3d1a
1ec3d1a
	sysnet_read_config($1)
1ec3d1a
')
1ec3d1a
1ec3d1a
########################################
1ec3d1a
## <summary>
1ec3d1a
##	Use the ypbind service to access NIS services.
1ec3d1a
## </summary>
1ec3d1a
## <desc>
1ec3d1a
##	

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

1ec3d1a
## </desc>
1ec3d1a
## <param name="domain">
1ec3d1a
##	<summary>
1ec3d1a
##	Domain allowed access.
1ec3d1a
##	</summary>
1ec3d1a
## </param>
1ec3d1a
## <infoflow type="both" weight="10"/>
1ec3d1a
## <rolecap/>
1ec3d1a
#
1ec3d1a
interface(`nis_use_ypbind',`
b28be49
	tunable_policy(`nis_enabled',`
1ec3d1a
		nis_use_ypbind_uncond($1)
1ec3d1a
	')
1ec3d1a
')
1ec3d1a
1ec3d1a
########################################
1ec3d1a
## <summary>
1ec3d1a
##	Use the nis to authenticate passwords
1ec3d1a
## </summary>
1ec3d1a
## <param name="domain">
1ec3d1a
##	<summary>
1ec3d1a
##	Domain allowed access.
1ec3d1a
##	</summary>
1ec3d1a
## </param>
1ec3d1a
## <rolecap/>
1ec3d1a
#
1ec3d1a
interface(`nis_authenticate',`
b28be49
	tunable_policy(`nis_enabled',`
1ec3d1a
		nis_use_ypbind_uncond($1)
1ec3d1a
		corenet_tcp_bind_all_rpc_ports($1)
1ec3d1a
		corenet_udp_bind_all_rpc_ports($1)
1ec3d1a
	')
1ec3d1a
')
1ec3d1a
1ec3d1a
########################################
1ec3d1a
## <summary>
1ec3d1a
##	Execute ypbind in the ypbind domain.
1ec3d1a
## </summary>
1ec3d1a
## <param name="domain">
1ec3d1a
##	<summary>
1ec3d1a
##	Domain allowed to transition.
1ec3d1a
##	</summary>
1ec3d1a
## </param>
1ec3d1a
#
1ec3d1a
interface(`nis_domtrans_ypbind',`
1ec3d1a
	gen_require(`
1ec3d1a
		type ypbind_t, ypbind_exec_t;
1ec3d1a
	')
1ec3d1a
1ec3d1a
	corecmd_search_bin($1)
1ec3d1a
	domtrans_pattern($1, ypbind_exec_t, ypbind_t)
1ec3d1a
')
1ec3d1a
08d4162
#######################################
08d4162
## <summary>
08d4162
##  Execute ypbind in the caller domain.
08d4162
## </summary>
08d4162
## <param name="domain">
08d4162
##  <summary>
08d4162
##  Domain allowed to transition.
08d4162
##  </summary>
08d4162
## </param>
08d4162
#
08d4162
interface(`nis_exec_ypbind',`
08d4162
    gen_require(`
08d4162
        type ypbind_t, ypbind_exec_t;
08d4162
    ')
08d4162
08d4162
	can_exec($1, ypbind_exec_t)
08d4162
')
08d4162
1ec3d1a
########################################
1ec3d1a
## <summary>
1ec3d1a
##	Execute ypbind in the ypbind domain, and
1ec3d1a
##	allow the specified role the ypbind domain.
1ec3d1a
## </summary>
1ec3d1a
## <param name="domain">
1ec3d1a
##	<summary>
1ec3d1a
##	Domain allowed to transition.
1ec3d1a
##	</summary>
1ec3d1a
## </param>
1ec3d1a
## <param name="role">
1ec3d1a
##	<summary>
1ec3d1a
##	Role allowed access.
1ec3d1a
##	</summary>
1ec3d1a
## </param>
1ec3d1a
## <rolecap/>
1ec3d1a
#
1ec3d1a
interface(`nis_run_ypbind',`
1ec3d1a
	gen_require(`
1ec3d1a
		type ypbind_t;
1ec3d1a
	')
1ec3d1a
1ec3d1a
	nis_domtrans_ypbind($1)
1ec3d1a
	role $2 types ypbind_t;
1ec3d1a
')
1ec3d1a
1ec3d1a
########################################
1ec3d1a
## <summary>
1ec3d1a
##	Send generic signals to ypbind.
1ec3d1a
## </summary>
1ec3d1a
## <param name="domain">
1ec3d1a
##	<summary>
1ec3d1a
##	Domain allowed access.
1ec3d1a
##	</summary>
1ec3d1a
## </param>
1ec3d1a
#
1ec3d1a
interface(`nis_signal_ypbind',`
1ec3d1a
	gen_require(`
1ec3d1a
		type ypbind_t;
1ec3d1a
	')
1ec3d1a
1ec3d1a
	allow $1 ypbind_t:process signal;
1ec3d1a
')
1ec3d1a
1ec3d1a
########################################
1ec3d1a
## <summary>
1ec3d1a
##	List the contents of the NIS data directory.
1ec3d1a
## </summary>
1ec3d1a
## <param name="domain">
1ec3d1a
##	<summary>
1ec3d1a
##	Domain allowed access.
1ec3d1a
##	</summary>
1ec3d1a
## </param>
1ec3d1a
#
1ec3d1a
interface(`nis_list_var_yp',`
1ec3d1a
	gen_require(`
1ec3d1a
		type var_yp_t;
1ec3d1a
	')
1ec3d1a
1ec3d1a
	files_search_var($1)
1ec3d1a
	allow $1 var_yp_t:dir list_dir_perms;
1ec3d1a
')
1ec3d1a
1ec3d1a
########################################
1ec3d1a
## <summary>
1ec3d1a
##	Send UDP network traffic to NIS clients.  (Deprecated)
1ec3d1a
## </summary>
1ec3d1a
## <param name="domain">
1ec3d1a
##	<summary>
1ec3d1a
##	Domain allowed access.
1ec3d1a
##	</summary>
1ec3d1a
## </param>
1ec3d1a
#
1ec3d1a
interface(`nis_udp_send_ypbind',`
1ec3d1a
	refpolicywarn(`$0($*) has been deprecated.')
1ec3d1a
')
1ec3d1a
1ec3d1a
########################################
1ec3d1a
## <summary>
1ec3d1a
##	Connect to ypbind over TCP.  (Deprecated)
1ec3d1a
## </summary>
1ec3d1a
## <param name="domain">
1ec3d1a
##	<summary>
1ec3d1a
##	Domain allowed access.
1ec3d1a
##	</summary>
1ec3d1a
## </param>
1ec3d1a
#
1ec3d1a
interface(`nis_tcp_connect_ypbind',`
1ec3d1a
	refpolicywarn(`$0($*) has been deprecated.')
1ec3d1a
')
1ec3d1a
1ec3d1a
########################################
1ec3d1a
## <summary>
1ec3d1a
##	Read ypbind pid files.
1ec3d1a
## </summary>
1ec3d1a
## <param name="domain">
1ec3d1a
##	<summary>
1ec3d1a
##	Domain allowed access.
1ec3d1a
##	</summary>
1ec3d1a
## </param>
1ec3d1a
#
1ec3d1a
interface(`nis_read_ypbind_pid',`
1ec3d1a
	gen_require(`
1ec3d1a
		type ypbind_var_run_t;
1ec3d1a
	')
1ec3d1a
1ec3d1a
	files_search_pids($1)
1ec3d1a
	allow $1 ypbind_var_run_t:file read_file_perms;
1ec3d1a
')
1ec3d1a
1ec3d1a
########################################
1ec3d1a
## <summary>
Chris PeBenito 9401ae1
##	Delete ypbind pid files.
Chris PeBenito 9401ae1
## </summary>
Chris PeBenito 9401ae1
## <param name="domain">
Chris PeBenito 9401ae1
##	<summary>
Chris PeBenito 9401ae1
##	Domain allowed access.
Chris PeBenito 9401ae1
##	</summary>
Chris PeBenito 9401ae1
## </param>
Chris PeBenito 9401ae1
#
Chris PeBenito 9401ae1
interface(`nis_delete_ypbind_pid',`
Chris PeBenito 9401ae1
	gen_require(`
Chris PeBenito 9401ae1
		type ypbind_t;
Chris PeBenito 9401ae1
	')
Chris PeBenito 9401ae1
Chris PeBenito 9401ae1
	# TODO: add delete pid from dir call to files
Chris PeBenito 9401ae1
	allow $1 ypbind_t:file unlink;
Chris PeBenito 9401ae1
')
Chris PeBenito 9401ae1
Chris PeBenito 9401ae1
########################################
Chris PeBenito 9401ae1
## <summary>
1ec3d1a
##	Read ypserv configuration files.
1ec3d1a
## </summary>
1ec3d1a
## <param name="domain">
1ec3d1a
##	<summary>
1ec3d1a
##	Domain allowed access.
1ec3d1a
##	</summary>
1ec3d1a
## </param>
1ec3d1a
#
1ec3d1a
interface(`nis_read_ypserv_config',`
1ec3d1a
	gen_require(`
1ec3d1a
		type ypserv_conf_t;
1ec3d1a
	')
1ec3d1a
1ec3d1a
	files_search_etc($1)
1ec3d1a
	allow $1 ypserv_conf_t:file read_file_perms;
1ec3d1a
')
1ec3d1a
1ec3d1a
########################################
1ec3d1a
## <summary>
1ec3d1a
##	Execute ypxfr in the ypxfr domain.
1ec3d1a
## </summary>
1ec3d1a
## <param name="domain">
1ec3d1a
##	<summary>
1ec3d1a
##	Domain allowed to transition.
1ec3d1a
##	</summary>
1ec3d1a
## </param>
1ec3d1a
#
1ec3d1a
interface(`nis_domtrans_ypxfr',`
1ec3d1a
	gen_require(`
1ec3d1a
		type ypxfr_t, ypxfr_exec_t;
1ec3d1a
	')
1ec3d1a
1ec3d1a
	corecmd_search_bin($1)
1ec3d1a
	domtrans_pattern($1, ypxfr_exec_t, ypxfr_t)
1ec3d1a
')
1ec3d1a
1ec3d1a
########################################
1ec3d1a
## <summary>
1ec3d1a
##	Execute nis server in the nis domain.
1ec3d1a
## </summary>
1ec3d1a
## <param name="domain">
1ec3d1a
##	<summary>
1ec3d1a
##	Domain allowed to transition.
1ec3d1a
##	</summary>
1ec3d1a
## </param>
1ec3d1a
#
1ec3d1a
#
1ec3d1a
interface(`nis_initrc_domtrans',`
1ec3d1a
	gen_require(`
1ec3d1a
		type nis_initrc_exec_t;
1ec3d1a
	')
1ec3d1a
1ec3d1a
	init_labeled_script_domtrans($1, nis_initrc_exec_t)
1ec3d1a
')
1ec3d1a
1ec3d1a
########################################
1ec3d1a
## <summary>
1ec3d1a
##	Execute nis server in the nis domain.
1ec3d1a
## </summary>
1ec3d1a
## <param name="domain">
1ec3d1a
##	<summary>
1ec3d1a
##	Domain allowed to transition.
1ec3d1a
##	</summary>
1ec3d1a
## </param>
1ec3d1a
#
1ec3d1a
interface(`nis_initrc_domtrans_ypbind',`
1ec3d1a
	gen_require(`
1ec3d1a
		type ypbind_initrc_exec_t;
1ec3d1a
	')
1ec3d1a
1ec3d1a
	init_labeled_script_domtrans($1, ypbind_initrc_exec_t)
1ec3d1a
')
1ec3d1a
1ec3d1a
########################################
1ec3d1a
## <summary>
1ec3d1a
##	Execute ypbind server in the ypbind domain.
1ec3d1a
## </summary>
1ec3d1a
## <param name="domain">
1ec3d1a
##	<summary>
1ec3d1a
##	Domain allowed to transition.
1ec3d1a
##	</summary>
1ec3d1a
## </param>
1ec3d1a
#
1ec3d1a
interface(`nis_systemctl_ypbind',`
1ec3d1a
	gen_require(`
1ec3d1a
		type ypbind_unit_file_t;
1ec3d1a
		type ypbind_t;
1ec3d1a
	')
1ec3d1a
1ec3d1a
	systemd_exec_systemctl($1)
1ec3d1a
	allow $1 ypbind_unit_file_t:file read_file_perms;
1ec3d1a
	allow $1 ypbind_unit_file_t:service manage_service_perms;
1ec3d1a
1ec3d1a
	ps_process_pattern($1, ypbind_t)
1ec3d1a
')
1ec3d1a
1ec3d1a
########################################
1ec3d1a
## <summary>
1ec3d1a
##	Execute ypbind server in the ypbind domain.
1ec3d1a
## </summary>
1ec3d1a
## <param name="domain">
1ec3d1a
##	<summary>
1ec3d1a
##	Domain allowed to transition.
1ec3d1a
##	</summary>
1ec3d1a
## </param>
1ec3d1a
#
1ec3d1a
interface(`nis_systemctl',`
1ec3d1a
	gen_require(`
1ec3d1a
		type nis_unit_file_t, ypbind_unit_file_t;
1ec3d1a
		type ypbind_t, yppasswdd_t, ypserv_t, ypxfr_t;
1ec3d1a
	')
1ec3d1a
1ec3d1a
	systemd_exec_systemctl($1)
1ec3d1a
	allow $1 nis_unit_file_t:file read_file_perms;
1ec3d1a
	allow $1 nis_unit_file_t:service manage_service_perms;
1ec3d1a
1ec3d1a
	ps_process_pattern($1, ypbind_t)
1ec3d1a
	ps_process_pattern($1, yppasswdd_t)
1ec3d1a
	ps_process_pattern($1, ypserv_t)
1ec3d1a
	ps_process_pattern($1, ypxfr_t)
1ec3d1a
')
1ec3d1a
1ec3d1a
########################################
1ec3d1a
## <summary>
1ec3d1a
##	All of the rules required to administrate
1ec3d1a
##	an nis environment
1ec3d1a
## </summary>
1ec3d1a
## <param name="domain">
1ec3d1a
##	<summary>
1ec3d1a
##	Domain allowed access.
1ec3d1a
##	</summary>
1ec3d1a
## </param>
1ec3d1a
## <param name="role">
1ec3d1a
##	<summary>
1ec3d1a
##	Role allowed access.
1ec3d1a
##	</summary>
1ec3d1a
## </param>
1ec3d1a
## <rolecap/>
1ec3d1a
#
1ec3d1a
interface(`nis_admin',`
1ec3d1a
	gen_require(`
1ec3d1a
		type ypbind_t, yppasswdd_t, ypserv_t;
1ec3d1a
		type ypserv_conf_t;
1ec3d1a
		type ypbind_var_run_t, yppasswdd_var_run_t, ypserv_var_run_t;
bde701d
		type ypserv_tmp_t;
1ec3d1a
		type ypbind_initrc_exec_t, nis_initrc_exec_t, ypxfr_t;
1ec3d1a
		type nis_unit_file_t;
1ec3d1a
		type ypbind_unit_file_t;
1ec3d1a
	')
1ec3d1a
1ec3d1a
	allow $1 ypbind_t:process signal_perms;
1ec3d1a
	ps_process_pattern($1, ypbind_t)
1ec3d1a
	tunable_policy(`deny_ptrace',`',`
1ec3d1a
		allow $1 ypbind_t:process ptrace;
1ec3d1a
		allow $1 yppasswdd_t:process ptrace;
1ec3d1a
		allow $1 ypserv_t:process ptrace;
1ec3d1a
		allow $1 ypxfr_t:process ptrace;
1ec3d1a
	')
1ec3d1a
1ec3d1a
	allow $1 yppasswdd_t:process signal_perms;
1ec3d1a
	ps_process_pattern($1, yppasswdd_t)
1ec3d1a
1ec3d1a
	allow $1 ypserv_t:process signal_perms;
1ec3d1a
	ps_process_pattern($1, ypserv_t)
1ec3d1a
1ec3d1a
	allow $1 ypxfr_t:process signal_perms;
1ec3d1a
	ps_process_pattern($1, ypxfr_t)
1ec3d1a
1ec3d1a
	nis_initrc_domtrans($1)
1ec3d1a
	nis_initrc_domtrans_ypbind($1)
1ec3d1a
	domain_system_change_exemption($1)
1ec3d1a
	role_transition $2 nis_initrc_exec_t system_r;
1ec3d1a
	role_transition $2 ypbind_initrc_exec_t system_r;
1ec3d1a
	allow $2 system_r;
1ec3d1a
1ec3d1a
	files_list_pids($1)
1ec3d1a
	admin_pattern($1, ypbind_var_run_t)
1ec3d1a
	nis_systemctl_ypbind($1)
1ec3d1a
	admin_pattern($1, ypbind_unit_file_t)
1ec3d1a
	allow $1 ypbind_unit_file_t:service all_service_perms;
1ec3d1a
1ec3d1a
	admin_pattern($1, yppasswdd_var_run_t)
1ec3d1a
1ec3d1a
	files_list_etc($1)
1ec3d1a
	admin_pattern($1, ypserv_conf_t)
1ec3d1a
1ec3d1a
	admin_pattern($1, ypserv_var_run_t)
1ec3d1a
bde701d
	admin_pattern($1, ypserv_tmp_t)
bde701d
1ec3d1a
	nis_systemctl($1)
1ec3d1a
	admin_pattern($1, nis_unit_file_t)
1ec3d1a
	allow $1 nis_unit_file_t:service all_service_perms;
1ec3d1a
')