Chris PeBenito 17de1b
## <summary>OpenLDAP directory server</summary>
Chris PeBenito 17de1b
Dan Walsh 3eaa99
#######################################
Dan Walsh 3eaa99
## <summary>
Dan Walsh 3eaa99
##      Execute OpenLDAP in the ldap domain.
Dan Walsh 3eaa99
## </summary>
Dan Walsh 3eaa99
## <param name="domain">
Dan Walsh 3eaa99
##      <summary>
Dan Walsh 3eaa99
##      Domain allowed access.
Dan Walsh 3eaa99
##      </summary>
Dan Walsh 3eaa99
## </param>
Dan Walsh 3eaa99
#
Dan Walsh 3eaa99
interface(`ldap_domtrans',`
Dan Walsh 3eaa99
        gen_require(`
Dan Walsh 3eaa99
                type slapd_t, slapd_exec_t;
Dan Walsh 3eaa99
        ')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
        domtrans_pattern($1, slapd_exec_t, slapd_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
#######################################
Dan Walsh 3eaa99
## <summary>
Dan Walsh 3eaa99
##      Execute OpenLDAP server in the ldap domain.
Dan Walsh 3eaa99
## </summary>
Dan Walsh 3eaa99
## <param name="domain">
Dan Walsh 3eaa99
##      <summary>
Dan Walsh 3eaa99
##      Domain allowed access.
Dan Walsh 3eaa99
##      </summary>
Dan Walsh 3eaa99
## </param>
Dan Walsh 3eaa99
#
Dan Walsh 3eaa99
interface(`ldap_initrc_domtrans',`
Dan Walsh 3eaa99
        gen_require(`
Dan Walsh 3eaa99
                type slapd_initrc_exec_t;
Dan Walsh 3eaa99
        ')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
        init_labeled_script_domtrans($1, slapd_initrc_exec_t)
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Read the contents of the OpenLDAP
Chris PeBenito 17de1b
##	database directories.
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(`ldap_list_db',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type slapd_db_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito c0868a
	allow $1 slapd_db_t:dir list_dir_perms;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Dan Walsh 3eaa99
##	Read the contents of the OpenLDAP
Dan Walsh 3eaa99
##	database files.
Dan Walsh 3eaa99
## </summary>
Dan Walsh 3eaa99
## <param name="domain">
Dan Walsh 3eaa99
##	<summary>
Dan Walsh 3eaa99
##	Domain allowed access.
Dan Walsh 3eaa99
##	</summary>
Dan Walsh 3eaa99
## </param>
Dan Walsh 3eaa99
#
Dan Walsh 3eaa99
interface(`ldap_read_db_files',`
Dan Walsh 3eaa99
	gen_require(`
Dan Walsh 3eaa99
		type slapd_db_t;
Dan Walsh 3eaa99
	')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	read_files_pattern($1, slapd_db_t, slapd_db_t)
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
########################################
Dan Walsh 3eaa99
## <summary>
Chris PeBenito 17de1b
##	Read the OpenLDAP 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 bbcd3c
## <rolecap/>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`ldap_read_config',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type slapd_etc_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_etc($1)
Chris PeBenito 82d277
	allow $1 slapd_etc_t:file read_file_perms;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 33c7e6
##	Use LDAP over TCP connection.  (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(`ldap_use',`
Chris PeBenito 33c7e6
	refpolicywarn(`$0($*) has been deprecated.')
Chris PeBenito 17de1b
')
Chris PeBenito 465510
Chris PeBenito 465510
########################################
Chris PeBenito 465510
## <summary>
Chris PeBenito 465510
##	Connect to slapd over an unix stream socket.
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(`ldap_stream_connect',`
Chris PeBenito 465510
	gen_require(`
Chris PeBenito 465510
		type slapd_t, slapd_var_run_t;
Chris PeBenito 465510
	')
Chris PeBenito 465510
Chris PeBenito 465510
	files_search_pids($1)
Dominick Grift f386b9
	stream_connect_pattern($1, slapd_var_run_t, slapd_var_run_t, slapd_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	optional_policy(`
Dominick Grift f386b9
		ldap_stream_connect_dirsrv($1)
Dan Walsh 3eaa99
	')
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
########################################
Dan Walsh 3eaa99
## <summary>
Dan Walsh 3eaa99
##	Connect to dirsrv over an unix stream socket.
Dan Walsh 3eaa99
## </summary>
Dan Walsh 3eaa99
## <param name="domain">
Dan Walsh 3eaa99
##	<summary>
Dan Walsh 3eaa99
##	Domain allowed access.
Dan Walsh 3eaa99
##	</summary>
Dan Walsh 3eaa99
## </param>
Dan Walsh 3eaa99
#
Dan Walsh 3eaa99
interface(`ldap_stream_connect_dirsrv',`
Dan Walsh 3eaa99
	gen_require(`
Dan Walsh 3eaa99
		type dirsrv_t, dirsrv_var_run_t;
Dan Walsh 3eaa99
	')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	files_search_pids($1)
Dominick Grift f386b9
	stream_connect_pattern($1, dirsrv_var_run_t, dirsrv_var_run_t, dirsrv_t)
Chris PeBenito 465510
')
Chris PeBenito 967fd1
Chris PeBenito 967fd1
########################################
Chris PeBenito 967fd1
## <summary>
Chris PeBenito 967fd1
##	All of the rules required to administrate 
Chris PeBenito 967fd1
##	an ldap environment
Chris PeBenito 967fd1
## </summary>
Chris PeBenito 967fd1
## <param name="domain">
Chris PeBenito 967fd1
##	<summary>
Chris PeBenito 967fd1
##	Domain allowed access.
Chris PeBenito 967fd1
##	</summary>
Chris PeBenito 967fd1
## </param>
Chris PeBenito 967fd1
## <param name="role">
Chris PeBenito 967fd1
##	<summary>
Chris PeBenito 967fd1
##	The role to be allowed to manage the ldap domain.
Chris PeBenito 967fd1
##	</summary>
Chris PeBenito 967fd1
## </param>
Chris PeBenito 967fd1
## <rolecap/>
Chris PeBenito 967fd1
#
Chris PeBenito 967fd1
interface(`ldap_admin',`
Chris PeBenito 967fd1
	gen_require(`
Chris PeBenito 967fd1
		type slapd_t, slapd_tmp_t, slapd_replog_t;
Chris PeBenito 967fd1
		type slapd_lock_t, slapd_etc_t, slapd_var_run_t;
Chris PeBenito 967fd1
		type slapd_initrc_exec_t;
Chris PeBenito 967fd1
	')
Chris PeBenito 967fd1
Chris PeBenito 967fd1
	allow $1 slapd_t:process { ptrace signal_perms };
Chris PeBenito 967fd1
	ps_process_pattern($1, slapd_t)
Chris PeBenito 967fd1
Chris PeBenito 967fd1
	init_labeled_script_domtrans($1, slapd_initrc_exec_t)
Chris PeBenito 967fd1
	domain_system_change_exemption($1)
Chris PeBenito 967fd1
	role_transition $2 slapd_initrc_exec_t system_r;
Chris PeBenito 967fd1
	allow $2 system_r;
Chris PeBenito 967fd1
Chris PeBenito 967fd1
	files_list_etc($1)
Chris PeBenito 967fd1
	admin_pattern($1, slapd_etc_t)
Chris PeBenito 967fd1
Chris PeBenito 967fd1
	admin_pattern($1, slapd_lock_t)
Chris PeBenito 967fd1
Chris PeBenito 967fd1
	admin_pattern($1, slapd_replog_t)
Chris PeBenito 967fd1
Chris PeBenito 967fd1
	files_list_tmp($1)
Chris PeBenito 967fd1
	admin_pattern($1, slapd_tmp_t)
Chris PeBenito 967fd1
Chris PeBenito 967fd1
	files_list_pids($1)
Chris PeBenito 967fd1
	admin_pattern($1, slapd_var_run_t)
Chris PeBenito 967fd1
')