Chris PeBenito 2961e7
Chris PeBenito 2961e7
policy_module(ldap,1.0)
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 2961e7
type slapd_db_t;
Chris PeBenito 2961e7
files_type(slapd_db_t)
Chris PeBenito 2961e7
Chris PeBenito 2961e7
type slapd_etc_t; #, usercanread;
Chris PeBenito 2961e7
files_type(slapd_etc_t)
Chris PeBenito 2961e7
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 2961e7
allow slapd_t self:capability { kill setgid setuid net_raw };
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 2961e7
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 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 2961e7
files_create_tmp_files(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 2961e7
files_create_pid(slapd_t,slapd_var_run_t)
Chris PeBenito 2961e7
Chris PeBenito 2961e7
kernel_read_system_state(slapd_t)
Chris PeBenito 2961e7
kernel_read_kernel_sysctl(slapd_t)
Chris PeBenito 2961e7
Chris PeBenito 2961e7
corenet_tcp_sendrecv_all_if(slapd_t)
Chris PeBenito 2961e7
corenet_udp_sendrecv_all_if(slapd_t)
Chris PeBenito 2961e7
corenet_raw_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_raw_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_udp_bind_all_nodes(slapd_t)
Chris PeBenito 2961e7
corenet_tcp_bind_ldap_port(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 2961e7
domain_use_wide_inherit_fd(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 2961e7
init_use_fd(slapd_t)
Chris PeBenito 2961e7
init_use_script_pty(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 2961e7
miscfiles_read_localization(slapd_t)
Chris PeBenito 2961e7
Chris PeBenito 2961e7
userdom_dontaudit_use_unpriv_user_fd(slapd_t)
Chris PeBenito 2961e7
userdom_dontaudit_search_sysadm_home_dir(slapd_t)
Chris PeBenito 2961e7
Chris PeBenito 2961e7
ifdef(`targeted_policy', `
Chris PeBenito 2961e7
	term_dontaudit_use_unallocated_tty(slapd_t)
Chris PeBenito 2961e7
	term_dontaudit_use_generic_pty(slapd_t)
Chris PeBenito 2961e7
	files_dontaudit_read_root_file(slapd_t)
Chris PeBenito 2961e7
')
Chris PeBenito 2961e7
Chris PeBenito 2961e7
optional_policy(`nis.te',`
Chris PeBenito 2961e7
	nis_use_ypbind(slapd_t)
Chris PeBenito 2961e7
')
Chris PeBenito 2961e7
Chris PeBenito 2961e7
optional_policy(`selinuxutil.te',`
Chris PeBenito 2961e7
	seutil_sigchld_newrole(slapd_t)
Chris PeBenito 2961e7
')
Chris PeBenito 2961e7
Chris PeBenito 2961e7
optional_policy(`udev.te', `
Chris PeBenito 2961e7
	udev_read_db(slapd_t)
Chris PeBenito 2961e7
')
Chris PeBenito 2961e7
Chris PeBenito 2961e7
ifdef(`TODO',`
Chris PeBenito c0d156
optional_policy(`rhgb.te',`
Chris PeBenito c0d156
	rhgb_domain(slapd_t)
Chris PeBenito c0d156
')
Chris PeBenito 2961e7
# allow any domain to connect to the LDAP server
Chris PeBenito 2961e7
# cjp: how does this relate to the old can_ldap() macro?
Chris PeBenito 2961e7
can_tcp_connect(domain, slapd_t)
Chris PeBenito 2961e7
') dnl end TODO