Chris PeBenito 17de1b
## <summary>Name service cache daemon</summary>
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Send generic signals to NSCD.
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(`nscd_signal',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type nscd_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1 nscd_t:process signal;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito bb8816
##	Send NSCD the kill signal.
Chris PeBenito bb8816
## </summary>
Chris PeBenito bb8816
## <param name="domain">
Chris PeBenito bb8816
##	<summary>
Chris PeBenito bb8816
##	Domain allowed access.
Chris PeBenito bb8816
##	</summary>
Chris PeBenito bb8816
## </param>
Chris PeBenito bb8816
#
Chris PeBenito bb8816
interface(`nscd_kill',`
Chris PeBenito bb8816
	gen_require(`
Chris PeBenito bb8816
		type nscd_t;
Chris PeBenito bb8816
	')
Chris PeBenito bb8816
Chris PeBenito bb8816
	allow $1 nscd_t:process sigkill;
Chris PeBenito bb8816
')
Chris PeBenito bb8816
Chris PeBenito bb8816
########################################
Chris PeBenito bb8816
## <summary>
Chris PeBenito bb8816
##	Send signulls to NSCD.
Chris PeBenito bb8816
## </summary>
Chris PeBenito bb8816
## <param name="domain">
Chris PeBenito bb8816
##	<summary>
Chris PeBenito bb8816
##	Domain allowed access.
Chris PeBenito bb8816
##	</summary>
Chris PeBenito bb8816
## </param>
Chris PeBenito bb8816
#
Chris PeBenito bb8816
interface(`nscd_signull',`
Chris PeBenito bb8816
	gen_require(`
Chris PeBenito bb8816
		type nscd_t;
Chris PeBenito bb8816
	')
Chris PeBenito bb8816
Chris PeBenito bb8816
	allow $1 nscd_t:process signull;
Chris PeBenito bb8816
')
Chris PeBenito bb8816
Chris PeBenito bb8816
########################################
Chris PeBenito bb8816
## <summary>
Chris PeBenito 17de1b
##	Execute NSCD in the nscd domain.
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(`nscd_domtrans',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type nscd_t, nscd_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 8021cb
	corecmd_search_bin($1)
Chris PeBenito 0bfccd
	domtrans_pattern($1, nscd_exec_t, nscd_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 465510
##	Allow the specified domain to execute nscd
Chris PeBenito 465510
##	in the caller domain.
Chris PeBenito 465510
## </summary>
Chris PeBenito 465510
## <param name="domain">
Chris PeBenito 465510
##	<summary>
Chris PeBenito 465510
##	Domain allowed access.
Chris PeBenito 465510
##	</summary>
Chris PeBenito 465510
## </param>
Chris PeBenito 465510
#
Chris PeBenito 465510
interface(`nscd_exec',`
Chris PeBenito 465510
	gen_require(`
Chris PeBenito 465510
		type nscd_exec_t;
Chris PeBenito 465510
	')
Chris PeBenito 465510
Chris PeBenito 0bfccd
	can_exec($1, nscd_exec_t)
Chris PeBenito 465510
')
Chris PeBenito 465510
Chris PeBenito 465510
########################################
Chris PeBenito 465510
## <summary>
Chris PeBenito 17de1b
##	Use NSCD services by connecting using
Chris PeBenito 17de1b
##	a unix stream socket.
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(`nscd_socket_use',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type nscd_t, nscd_var_run_t;
Chris PeBenito bb8816
		class nscd { getserv getpwd getgrp gethost shmempwd shmemgrp shmemhost shmemserv };
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1 self:unix_stream_socket create_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1 nscd_t:nscd { getpwd getgrp gethost };
Chris PeBenito 17de1b
	dontaudit $1 nscd_t:fd use;
Chris PeBenito bb8816
	dontaudit $1 nscd_t:nscd { getserv shmempwd shmemgrp shmemhost shmemserv };
Chris PeBenito 17de1b
	files_search_pids($1)
Chris PeBenito 0bfccd
	stream_connect_pattern($1, nscd_var_run_t, nscd_var_run_t, nscd_t)
Chris PeBenito 17de1b
	dontaudit $1 nscd_var_run_t:file { getattr read };
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Use NSCD services by mapping the database from
Chris PeBenito 17de1b
##	an inherited NSCD file descriptor.
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(`nscd_shm_use',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type nscd_t, nscd_var_run_t;
Chris PeBenito 17de1b
		class nscd { getpwd getgrp gethost shmempwd shmemgrp shmemhost };
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito c0868a
	allow $1 nscd_var_run_t:dir list_dir_perms;
Chris PeBenito 17de1b
	allow $1 nscd_t:nscd { shmempwd shmemgrp shmemhost };
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# Receive fd from nscd and map the backing file with read access.
Chris PeBenito 17de1b
	allow $1 nscd_t:fd use;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# cjp: these were originally inherited from the
Chris PeBenito ff8f0a
	# nscd_socket_domain macro. need to investigate
Chris PeBenito 17de1b
	# if they are all actually required
Chris PeBenito 17de1b
	allow $1 self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 17de1b
	allow $1 nscd_t:unix_stream_socket connectto;
Chris PeBenito 17de1b
	allow $1 nscd_var_run_t:sock_file rw_file_perms;
Chris PeBenito 17de1b
	files_search_pids($1)
Chris PeBenito 17de1b
	allow $1 nscd_t:nscd { getpwd getgrp gethost };
Chris PeBenito 17de1b
	dontaudit $1 nscd_var_run_t:file { getattr read };
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 4846dc
##	Do not audit attempts to search the NSCD pid directory.
Chris PeBenito 4846dc
## </summary>
Chris PeBenito 4846dc
## <param name="domain">
Chris PeBenito 4846dc
##	<summary>
Chris PeBenito 4846dc
##	Domain allowed access.
Chris PeBenito 4846dc
##	</summary>
Chris PeBenito 4846dc
## </param>
Chris PeBenito 4846dc
#
Chris PeBenito 4846dc
interface(`nscd_dontaudit_search_pid',`
Chris PeBenito 4846dc
	gen_require(`
Chris PeBenito 4846dc
		type nscd_var_run_t;
Chris PeBenito 4846dc
	')
Chris PeBenito 4846dc
Chris PeBenito 4846dc
	dontaudit $1 nscd_var_run_t:dir search;
Chris PeBenito 4846dc
')
Chris PeBenito 4846dc
Chris PeBenito 4846dc
########################################
Chris PeBenito 4846dc
## <summary>
Chris PeBenito 17de1b
##	Read NSCD pid file.
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(`nscd_read_pid',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type nscd_var_run_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_pids($1)
Chris PeBenito 0bfccd
	read_files_pattern($1, nscd_var_run_t, nscd_var_run_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Unconfined access to NSCD services.
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(`nscd_unconfined',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type nscd_t;
Chris PeBenito 17de1b
		class nscd all_nscd_perms;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1 nscd_t:nscd *;
Chris PeBenito 17de1b
')
Chris PeBenito cdc91b
Chris PeBenito cdc91b
########################################
Chris PeBenito cdc91b
## <summary>
Chris PeBenito cdc91b
##	Execute nscd in the nscd domain, and
Chris PeBenito cdc91b
##	allow the specified role the nscd domain.
Chris PeBenito cdc91b
## </summary>
Chris PeBenito cdc91b
## <param name="domain">
Chris PeBenito cdc91b
##	<summary>
Chris PeBenito cdc91b
##	Domain allowed access
Chris PeBenito cdc91b
##	</summary>
Chris PeBenito cdc91b
## </param>
Chris PeBenito cdc91b
## <param name="role">
Chris PeBenito cdc91b
##	<summary>
Chris PeBenito cdc91b
##	The role to be allowed the nscd domain.
Chris PeBenito cdc91b
##	</summary>
Chris PeBenito cdc91b
## </param>
Chris PeBenito cdc91b
#
Chris PeBenito cdc91b
interface(`nscd_run',`
Chris PeBenito cdc91b
	gen_require(`
Chris PeBenito cdc91b
		type nscd_t;
Chris PeBenito cdc91b
	')
Chris PeBenito cdc91b
Chris PeBenito cdc91b
	nscd_domtrans($1)
Chris PeBenito cdc91b
	role $2 types nscd_t;
Chris PeBenito cdc91b
')
Chris PeBenito bb8816
Chris PeBenito bb8816
########################################
Chris PeBenito bb8816
## <summary>
Chris PeBenito 937b2c
##	Execute the nscd server init script.
Chris PeBenito 937b2c
## </summary>
Chris PeBenito 937b2c
## <param name="domain">
Chris PeBenito 937b2c
##	<summary>
Chris PeBenito 937b2c
##	Domain allowed access.
Chris PeBenito 937b2c
##	</summary>
Chris PeBenito 937b2c
## </param>
Chris PeBenito 937b2c
#
Chris PeBenito 937b2c
interface(`nscd_initrc_domtrans',`
Chris PeBenito 937b2c
	gen_require(`
Chris PeBenito 937b2c
		type nscd_initrc_exec_t;
Chris PeBenito 937b2c
	')
Chris PeBenito 937b2c
Chris PeBenito 937b2c
	init_labeled_script_domtrans($1, nscd_initrc_exec_t)
Chris PeBenito 937b2c
')
Chris PeBenito 937b2c
Chris PeBenito 937b2c
########################################
Chris PeBenito 937b2c
## <summary>
Chris PeBenito bb8816
##	All of the rules required to administrate 
Chris PeBenito bb8816
##	an nscd environment
Chris PeBenito bb8816
## </summary>
Chris PeBenito bb8816
## <param name="domain">
Chris PeBenito bb8816
##	<summary>
Chris PeBenito bb8816
##	Domain allowed access.
Chris PeBenito bb8816
##	</summary>
Chris PeBenito bb8816
## </param>
Chris PeBenito bb8816
## <param name="role">
Chris PeBenito bb8816
##	<summary>
Chris PeBenito bb8816
##	The role to be allowed to manage the nscd domain.
Chris PeBenito bb8816
##	</summary>
Chris PeBenito bb8816
## </param>
Chris PeBenito bb8816
## <rolecap/>
Chris PeBenito bb8816
#
Chris PeBenito bb8816
interface(`nscd_admin',`
Chris PeBenito bb8816
	gen_require(`
Chris PeBenito bb8816
		type nscd_t, nscd_log_t, nscd_var_run_t;
Chris PeBenito bb8816
		type nscd_initrc_exec_t;
Chris PeBenito bb8816
	')
Chris PeBenito bb8816
Chris PeBenito bb8816
	allow $1 nscd_t:process { ptrace signal_perms };
Chris PeBenito bb8816
	ps_process_pattern($1, nscd_t)
Chris PeBenito bb8816
Chris PeBenito bb8816
	init_labeled_script_domtrans($1, nscd_initrc_exec_t)
Chris PeBenito bb8816
	domain_system_change_exemption($1)
Chris PeBenito bb8816
	role_transition $2 nscd_initrc_exec_t system_r;
Chris PeBenito bb8816
	allow $2 system_r;
Chris PeBenito bb8816
Chris PeBenito bb8816
	logging_list_logs($1)
Chris PeBenito bb8816
	admin_pattern($1, nscd_log_t)
Chris PeBenito bb8816
Chris PeBenito bb8816
	files_list_pids($1)
Chris PeBenito bb8816
	admin_pattern($1, nscd_var_run_t)
Chris PeBenito bb8816
')