Chris PeBenito 2961e7
Chris PeBenito 522b59
policy_module(ldap,1.2.3)
Chris PeBenito 2961e7
Chris PeBenito 2961e7
########################################
Chris PeBenito 2961e7
#
Chris PeBenito 2961e7
# Declarations
Chris PeBenito 2961e7
#
Chris PeBenito 2961e7
Chris PeBenito 2961e7
type slapd_t;
Chris PeBenito 2961e7
type slapd_exec_t;
Chris PeBenito 2961e7
init_daemon_domain(slapd_t,slapd_exec_t)
Chris PeBenito 2961e7
Chris PeBenito 7b062e
type slapd_cert_t;
Chris PeBenito 7b062e
files_type(slapd_cert_t)
Chris PeBenito 7b062e
Chris PeBenito 2961e7
type slapd_db_t;
Chris PeBenito 2961e7
files_type(slapd_db_t)
Chris PeBenito 2961e7
Chris PeBenito 9bbc75
type slapd_etc_t;
Chris PeBenito 9bbc75
files_config_file(slapd_etc_t)
Chris PeBenito 2961e7
Chris PeBenito 7b062e
type slapd_lock_t;
Chris PeBenito 7b062e
files_lock_file(slapd_lock_t)
Chris PeBenito 7b062e
Chris PeBenito 2961e7
type slapd_replog_t;
Chris PeBenito 2961e7
files_type(slapd_replog_t)
Chris PeBenito 2961e7
Chris PeBenito 2961e7
type slapd_tmp_t;
Chris PeBenito 2961e7
files_tmp_file(slapd_tmp_t)
Chris PeBenito 2961e7
Chris PeBenito 2961e7
type slapd_var_run_t;
Chris PeBenito 2961e7
files_pid_file(slapd_var_run_t)
Chris PeBenito 2961e7
Chris PeBenito 2961e7
########################################
Chris PeBenito 2961e7
#
Chris PeBenito 2961e7
# Local policy
Chris PeBenito 2961e7
#
Chris PeBenito 2961e7
Chris PeBenito 2961e7
# should not need kill
Chris PeBenito 2961e7
# cjp: why net_raw?
Chris PeBenito 2705f9
allow slapd_t self:capability { kill setgid setuid net_raw dac_override dac_read_search };
Chris PeBenito 2961e7
dontaudit slapd_t self:capability sys_tty_config;
Chris PeBenito 2961e7
allow slapd_t self:process setsched;
Chris PeBenito 2961e7
allow slapd_t self:fifo_file { read write };
Chris PeBenito 2961e7
allow slapd_t self:netlink_route_socket r_netlink_socket_perms;
Chris PeBenito d1b9d9
allow slapd_t self:udp_socket create_socket_perms;
Chris PeBenito dd3544
#slapd needs to listen and accept needed by ldapsearch (slapd needs to accept from ldapseach)
Chris PeBenito dd3544
allow slapd_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito 2961e7
Chris PeBenito 7b062e
allow slapd_t slapd_cert_t:dir r_dir_perms;
Chris PeBenito 7b062e
allow slapd_t slapd_cert_t:file r_file_perms;
Chris PeBenito 7b062e
allow slapd_t slapd_cert_t:lnk_file { getattr read };
Chris PeBenito 7b062e
Chris PeBenito 2961e7
# Allow access to the slapd databases
Chris PeBenito 2961e7
allow slapd_t slapd_db_t:dir create_dir_perms;
Chris PeBenito 2961e7
allow slapd_t slapd_db_t:file create_file_perms;
Chris PeBenito 2961e7
allow slapd_t slapd_db_t:lnk_file create_lnk_perms;
Chris PeBenito 2961e7
Chris PeBenito 2961e7
allow slapd_t slapd_etc_t:file { getattr read };
Chris PeBenito 2961e7
Chris PeBenito 7b062e
allow slapd_t slapd_lock_t:file create_file_perms;
Chris PeBenito 1c1ac6
files_lock_filetrans(slapd_t,slapd_lock_t,file)
Chris PeBenito 7b062e
Chris PeBenito 2961e7
# Allow access to write the replication log (should tighten this)
Chris PeBenito 2961e7
allow slapd_t slapd_replog_t:dir create_dir_perms;
Chris PeBenito 2961e7
allow slapd_t slapd_replog_t:file create_file_perms;
Chris PeBenito 2961e7
allow slapd_t slapd_replog_t:lnk_file create_lnk_perms;
Chris PeBenito 2961e7
Chris PeBenito 2961e7
allow slapd_t slapd_tmp_t:dir create_dir_perms;
Chris PeBenito 2961e7
allow slapd_t slapd_tmp_t:file create_file_perms;
Chris PeBenito 103fe2
files_tmp_filetrans(slapd_t, slapd_tmp_t, { file dir })
Chris PeBenito 2961e7
Chris PeBenito 2961e7
allow slapd_t slapd_var_run_t:file create_file_perms;
Chris PeBenito 30910b
allow slapd_t slapd_var_run_t:dir rw_dir_perms;
Chris PeBenito 1c1ac6
files_pid_filetrans(slapd_t,slapd_var_run_t,file)
Chris PeBenito 2961e7
Chris PeBenito 2961e7
kernel_read_system_state(slapd_t)
Chris PeBenito 445522
kernel_read_kernel_sysctls(slapd_t)
Chris PeBenito 3774e4
kernel_tcp_recvfrom(slapd_t)
Chris PeBenito 2961e7
Chris PeBenito b516e8
corenet_non_ipsec_sendrecv(slapd_t)
Chris PeBenito 2961e7
corenet_tcp_sendrecv_all_if(slapd_t)
Chris PeBenito 2961e7
corenet_udp_sendrecv_all_if(slapd_t)
Chris PeBenito 2961e7
corenet_tcp_sendrecv_all_nodes(slapd_t)
Chris PeBenito 2961e7
corenet_udp_sendrecv_all_nodes(slapd_t)
Chris PeBenito 2961e7
corenet_tcp_sendrecv_all_ports(slapd_t)
Chris PeBenito 2961e7
corenet_udp_sendrecv_all_ports(slapd_t)
Chris PeBenito 2961e7
corenet_tcp_bind_all_nodes(slapd_t)
Chris PeBenito 2961e7
corenet_tcp_bind_ldap_port(slapd_t)
Chris PeBenito 2705f9
corenet_tcp_connect_all_ports(slapd_t)
Chris PeBenito 141cff
corenet_sendrecv_ldap_server_packets(slapd_t)
Chris PeBenito 141cff
corenet_sendrecv_all_client_packets(slapd_t)
Chris PeBenito 2961e7
Chris PeBenito 2961e7
dev_read_urand(slapd_t)
Chris PeBenito 2961e7
dev_read_sysfs(slapd_t)
Chris PeBenito 2961e7
Chris PeBenito 2961e7
fs_getattr_all_fs(slapd_t)
Chris PeBenito 2961e7
fs_search_auto_mountpoints(slapd_t)
Chris PeBenito 2961e7
Chris PeBenito 2961e7
term_dontaudit_use_console(slapd_t)
Chris PeBenito 2961e7
Chris PeBenito 15722e
domain_use_interactive_fds(slapd_t)
Chris PeBenito 2961e7
Chris PeBenito 2961e7
files_read_etc_files(slapd_t)
Chris PeBenito 2961e7
files_read_etc_runtime_files(slapd_t)
Chris PeBenito 2961e7
files_read_usr_files(slapd_t)
Chris PeBenito 2961e7
files_list_var_lib(slapd_t)
Chris PeBenito 2961e7
Chris PeBenito 1c1ac6
init_use_fds(slapd_t)
Chris PeBenito 1815ba
init_use_script_ptys(slapd_t)
Chris PeBenito 2961e7
Chris PeBenito 2961e7
libs_use_ld_so(slapd_t)
Chris PeBenito 2961e7
libs_use_shared_libs(slapd_t)
Chris PeBenito 2961e7
Chris PeBenito 2961e7
logging_send_syslog_msg(slapd_t)
Chris PeBenito 2961e7
Chris PeBenito d1b9d9
miscfiles_read_certs(slapd_t)
Chris PeBenito 2961e7
miscfiles_read_localization(slapd_t)
Chris PeBenito 2961e7
Chris PeBenito d1b9d9
sysnet_read_config(slapd_t)
Chris PeBenito d1b9d9
Chris PeBenito 15722e
userdom_dontaudit_use_unpriv_user_fds(slapd_t)
Chris PeBenito 103fe2
userdom_dontaudit_search_sysadm_home_dirs(slapd_t)
Chris PeBenito 2961e7
Chris PeBenito 7e1c14
ifdef(`targeted_policy',`
Chris PeBenito dd3544
	#reh slapcat will want to talk to the terminal
Chris PeBenito 1815ba
	term_use_generic_ptys(slapd_t)
Chris PeBenito 1815ba
	term_use_unallocated_ttys(slapd_t)
Chris PeBenito dd3544
Chris PeBenito 103fe2
	userdom_search_generic_user_home_dirs(slapd_t)
Chris PeBenito dd3544
	#need to be able to read ldif files created by root
Chris PeBenito dd3544
	# cjp: fix to not use templated interface:
Chris PeBenito 103fe2
	userdom_read_user_home_content_files(user,slapd_t)
Chris PeBenito dd3544
Chris PeBenito 1815ba
	term_dontaudit_use_unallocated_ttys(slapd_t)
Chris PeBenito 1815ba
	term_dontaudit_use_generic_ptys(slapd_t)
Chris PeBenito 9e04f5
	files_dontaudit_read_root_files(slapd_t)
Chris PeBenito 2961e7
')
Chris PeBenito 2961e7
Chris PeBenito bb7170
optional_policy(`
Chris PeBenito bf080a
	kerberos_use(slapd_t)
Chris PeBenito bf080a
')
Chris PeBenito bf080a
Chris PeBenito bb7170
optional_policy(`
Chris PeBenito 2961e7
	nis_use_ypbind(slapd_t)
Chris PeBenito 2961e7
')
Chris PeBenito 2961e7
Chris PeBenito bb7170
optional_policy(`
Chris PeBenito 2961e7
	seutil_sigchld_newrole(slapd_t)
Chris PeBenito 2961e7
')
Chris PeBenito 2961e7
Chris PeBenito bb7170
optional_policy(`
Chris PeBenito 2961e7
	udev_read_db(slapd_t)
Chris PeBenito 2961e7
')