Chris PeBenito 493d6c
Chris PeBenito d3d270
policy_module(nscd,1.2.0)
Chris PeBenito 493d6c
Chris PeBenito 41c480
gen_require(`
Chris PeBenito 3774e4
	class nscd all_nscd_perms;
Chris PeBenito 41c480
')
Chris PeBenito 41c480
Chris PeBenito 493d6c
########################################
Chris PeBenito 493d6c
#
Chris PeBenito 493d6c
# Declarations
Chris PeBenito 493d6c
#
Chris PeBenito 493d6c
Chris PeBenito 12ae75
# cjp: this is out of order because of an
Chris PeBenito 12ae75
# ordering problem with loadable modules
Chris PeBenito 12ae75
type nscd_var_run_t;
Chris PeBenito 12ae75
files_pid_file(nscd_var_run_t)
Chris PeBenito 12ae75
Chris PeBenito 493d6c
# nscd is both the client program and the daemon.
Chris PeBenito 763a5e
type nscd_t;
Chris PeBenito 493d6c
type nscd_exec_t;
Chris PeBenito 493d6c
init_daemon_domain(nscd_t,nscd_exec_t)
Chris PeBenito 493d6c
Chris PeBenito 98a8ea
type nscd_log_t;
Chris PeBenito 98a8ea
logging_log_file(nscd_log_t)
Chris PeBenito 98a8ea
Chris PeBenito 493d6c
########################################
Chris PeBenito 493d6c
#
Chris PeBenito 493d6c
# Local policy
Chris PeBenito 493d6c
#
Chris PeBenito 493d6c
Chris PeBenito 493d6c
allow nscd_t self:capability { kill setgid setuid };
Chris PeBenito 493d6c
dontaudit nscd_t self:capability sys_tty_config;
Don Miner 45aa10
allow nscd_t self:process { getattr setsched signal_perms };
Chris PeBenito 763a5e
allow nscd_t self:fifo_file { read write };
Chris PeBenito 493d6c
allow nscd_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 493d6c
allow nscd_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 493d6c
allow nscd_t self:netlink_selinux_socket create_socket_perms;
Chris PeBenito 493d6c
allow nscd_t self:netlink_route_socket r_netlink_socket_perms;
Chris PeBenito 77f6e2
allow nscd_t self:netlink_audit_socket { create_netlink_socket_perms nlmsg_relay };
Chris PeBenito 493d6c
allow nscd_t self:tcp_socket create_socket_perms;
Chris PeBenito 763a5e
allow nscd_t self:udp_socket create_socket_perms;
Chris PeBenito 493d6c
Chris PeBenito 493d6c
# For client program operation, invoked from sysadm_t.
Chris PeBenito 493d6c
# Transition occurs to nscd_t due to direct_sysadm_daemon. 
Chris PeBenito 493d6c
allow nscd_t self:nscd { admin getstat };
Chris PeBenito 493d6c
Chris PeBenito 98a8ea
allow nscd_t nscd_log_t:file create_file_perms;
Chris PeBenito 103fe2
logging_log_filetrans(nscd_t,nscd_log_t)
Chris PeBenito 98a8ea
Chris PeBenito 493d6c
allow nscd_t nscd_var_run_t:file create_file_perms;
Chris PeBenito 493d6c
allow nscd_t nscd_var_run_t:sock_file create_file_perms;
Chris PeBenito d1b9d9
allow nscd_t nscd_var_run_t:dir rw_dir_perms;
Chris PeBenito 103fe2
files_pid_filetrans(nscd_t,nscd_var_run_t,{ file sock_file })
Chris PeBenito 493d6c
Chris PeBenito 445522
kernel_read_kernel_sysctls(nscd_t)
Chris PeBenito 493d6c
kernel_list_proc(nscd_t)
Chris PeBenito 493d6c
kernel_read_proc_symlinks(nscd_t)
Chris PeBenito 493d6c
Chris PeBenito 493d6c
dev_read_sysfs(nscd_t)
Chris PeBenito 493d6c
dev_read_rand(nscd_t)
Chris PeBenito 493d6c
dev_read_urand(nscd_t)
Chris PeBenito 493d6c
Chris PeBenito 493d6c
fs_getattr_all_fs(nscd_t)
Chris PeBenito 493d6c
fs_search_auto_mountpoints(nscd_t)
Chris PeBenito 493d6c
Chris PeBenito 493d6c
term_dontaudit_use_console(nscd_t)
Chris PeBenito 493d6c
Chris PeBenito 493d6c
# for when /etc/passwd has just been updated and has the wrong type
Chris PeBenito 493d6c
auth_getattr_shadow(nscd_t)
Chris PeBenito 493d6c
Chris PeBenito 493d6c
corenet_tcp_sendrecv_all_if(nscd_t)
Chris PeBenito 493d6c
corenet_udp_sendrecv_all_if(nscd_t)
Chris PeBenito 493d6c
corenet_raw_sendrecv_all_if(nscd_t)
Chris PeBenito 493d6c
corenet_tcp_sendrecv_all_nodes(nscd_t)
Chris PeBenito 493d6c
corenet_udp_sendrecv_all_nodes(nscd_t)
Chris PeBenito 493d6c
corenet_raw_sendrecv_all_nodes(nscd_t)
Chris PeBenito 493d6c
corenet_tcp_sendrecv_all_ports(nscd_t)
Chris PeBenito 493d6c
corenet_udp_sendrecv_all_ports(nscd_t)
Chris PeBenito bd7037
corenet_non_ipsec_sendrecv(nscd_t)
Chris PeBenito 493d6c
corenet_tcp_bind_all_nodes(nscd_t)
Chris PeBenito 493d6c
corenet_udp_bind_all_nodes(nscd_t)
Chris PeBenito 0907bd
corenet_tcp_connect_all_ports(nscd_t)
Chris PeBenito 5b6ddb
corenet_rw_tun_tap_dev(nscd_t)
Chris PeBenito 493d6c
Chris PeBenito 763a5e
selinux_get_fs_mount(nscd_t)
Chris PeBenito 763a5e
selinux_validate_context(nscd_t)
Chris PeBenito 763a5e
selinux_compute_access_vector(nscd_t)
Chris PeBenito 763a5e
selinux_compute_create_context(nscd_t)
Chris PeBenito 763a5e
selinux_compute_relabel_context(nscd_t)
Chris PeBenito 763a5e
selinux_compute_user_contexts(nscd_t)
Chris PeBenito 15722e
domain_use_interactive_fds(nscd_t)
Chris PeBenito 493d6c
Chris PeBenito 493d6c
files_read_etc_files(nscd_t)
Chris PeBenito 725926
files_read_generic_tmp_symlinks(nscd_t)
Chris PeBenito 493d6c
Chris PeBenito 493d6c
init_use_fd(nscd_t)
Chris PeBenito 1815ba
init_use_script_ptys(nscd_t)
Chris PeBenito 493d6c
Chris PeBenito 493d6c
libs_use_ld_so(nscd_t)
Chris PeBenito 493d6c
libs_use_shared_libs(nscd_t)
Chris PeBenito 493d6c
Chris PeBenito 493d6c
logging_send_syslog_msg(nscd_t)
Chris PeBenito 493d6c
Chris PeBenito 7a6d42
miscfiles_read_certs(nscd_t)
Chris PeBenito 493d6c
miscfiles_read_localization(nscd_t)
Chris PeBenito 493d6c
Chris PeBenito 763a5e
seutil_read_config(nscd_t)
Chris PeBenito 763a5e
seutil_read_default_contexts(nscd_t)
Chris PeBenito 763a5e
seutil_sigchld_newrole(nscd_t)
Chris PeBenito 763a5e
Chris PeBenito 493d6c
sysnet_read_config(nscd_t)
Chris PeBenito 493d6c
Chris PeBenito 15722e
userdom_dontaudit_use_unpriv_user_fds(nscd_t)
Chris PeBenito 103fe2
userdom_dontaudit_search_sysadm_home_dirs(nscd_t)
Chris PeBenito 493d6c
Chris PeBenito d1b9d9
ifdef(`targeted_policy',`
Chris PeBenito 1815ba
	term_use_unallocated_ttys(nscd_t)
Chris PeBenito 1815ba
	term_use_generic_ptys(nscd_t)
Chris PeBenito d1b9d9
Chris PeBenito 1815ba
	term_dontaudit_use_unallocated_ttys(nscd_t)
Chris PeBenito 1815ba
	term_dontaudit_use_generic_ptys(nscd_t)
Chris PeBenito 9e04f5
	files_dontaudit_read_root_files(nscd_t)
Chris PeBenito 493d6c
')
Chris PeBenito 493d6c
Chris PeBenito 132880
optional_policy(`nis',`
Chris PeBenito 493d6c
	nis_use_ypbind(nscd_t)
Chris PeBenito 493d6c
')
Chris PeBenito 493d6c
Chris PeBenito 132880
optional_policy(`samba',`
Chris PeBenito 1815ba
	samba_stream_connect_winbind(nscd_t)
Chris PeBenito d1b9d9
')
Chris PeBenito d1b9d9
Chris PeBenito 132880
optional_policy(`udev',`
Chris PeBenito 493d6c
	udev_read_db(nscd_t)
Chris PeBenito 493d6c
')