Chris PeBenito 43989f
Chris PeBenito 43989f
policy_module(rpc,1.0)
Chris PeBenito 43989f
Chris PeBenito 43989f
########################################
Chris PeBenito 43989f
#
Chris PeBenito 43989f
# Declarations
Chris PeBenito 43989f
#
Chris PeBenito 43989f
Chris PeBenito 43989f
type exports_t;
Chris PeBenito 43989f
files_type(exports_t)
Chris PeBenito 43989f
Chris PeBenito 43989f
rpc_domain_template(gssd)
Chris PeBenito 43989f
Chris PeBenito 43989f
type gssd_tmp_t;
Chris PeBenito 43989f
files_tmp_file(gssd_tmp_t)
Chris PeBenito 43989f
Chris PeBenito 19b555
type rpcd_var_run_t;
Chris PeBenito 19b555
files_pid_file(rpcd_var_run_t)
Chris PeBenito 43989f
Chris PeBenito 19b555
# rpcd_t is the domain of rpc daemons.
Chris PeBenito 43989f
# rpc_exec_t is the type of rpc daemon programs.
Chris PeBenito 19b555
rpc_domain_template(rpcd)
Chris PeBenito 43989f
Chris PeBenito 43989f
rpc_domain_template(nfsd)
Chris PeBenito 43989f
Chris PeBenito 43989f
type nfsd_rw_t;
Chris PeBenito 9bbc75
files_config_file(nfsd_rw_t)
Chris PeBenito 43989f
Chris PeBenito 43989f
type nfsd_ro_t;
Chris PeBenito 9bbc75
files_config_file(nfsd_ro_t)
Chris PeBenito 43989f
Chris PeBenito 43989f
type var_lib_nfs_t;
Chris PeBenito 9bbc75
files_config_file(var_lib_nfs_t)
Chris PeBenito 43989f
Chris PeBenito 43989f
########################################
Chris PeBenito 43989f
#
Chris PeBenito 43989f
# RPC local policy
Chris PeBenito 43989f
#
Chris PeBenito 43989f
Chris PeBenito 19b555
allow rpcd_t self:fifo_file rw_file_perms;
Chris PeBenito 19b555
allow rpcd_t self:file { getattr read };
Chris PeBenito 43989f
Chris PeBenito ce0383
allow rpcd_t rpcd_var_run_t:file manage_file_perms;
Chris PeBenito ce0383
allow rpcd_t rpcd_var_run_t:dir { rw_dir_perms setattr };
Chris PeBenito 19b555
files_create_pid(rpcd_t,rpcd_var_run_t)
Chris PeBenito 43989f
Chris PeBenito 19b555
kernel_search_network_state(rpcd_t) 
Chris PeBenito 43989f
# for rpc.rquotad
Chris PeBenito 19b555
kernel_read_sysctl(rpcd_t)  
Chris PeBenito 43989f
Chris PeBenito ce0383
corenet_udp_bind_generic_port(rpcd_t)
Chris PeBenito ce0383
corenet_udp_bind_reserved_port(rpcd_t)
Chris PeBenito ce0383
Chris PeBenito ce0383
fs_read_rpc_dirs(rpcd_t)
Chris PeBenito ce0383
fs_read_rpc_files(rpcd_t)
Chris PeBenito ce0383
fs_read_rpc_symlinks(rpcd_t)
Chris PeBenito 19b555
fs_read_rpc_sockets(rpcd_t) 
Chris PeBenito ce0383
term_use_controlling_term(rpcd_t)
Chris PeBenito ce0383
Chris PeBenito ce0383
# cjp: this should really have its own type
Chris PeBenito ce0383
files_manage_mounttab(rpcd_t)
Chris PeBenito 43989f
Chris PeBenito 19b555
seutil_dontaudit_search_config(rpcd_t)
Chris PeBenito 43989f
Chris PeBenito ce0383
ifdef(`distro_redhat',`
Chris PeBenito 19b555
	allow rpcd_t self:capability { chown dac_override setgid setuid };
Chris PeBenito 43989f
')
Chris PeBenito 43989f
Chris PeBenito 725926
optional_policy(`nis.te',`
Chris PeBenito 725926
	nis_read_ypserv_config(rpcd_t)
Chris PeBenito 725926
')
Chris PeBenito 725926
Chris PeBenito 725926
# FIXME
Chris PeBenito 725926
dontaudit userdomain exports_t:file getattr;
Chris PeBenito 725926
Chris PeBenito 43989f
########################################
Chris PeBenito 43989f
#
Chris PeBenito 43989f
# NFSD local policy
Chris PeBenito 43989f
#
Chris PeBenito 43989f
Chris PeBenito 43989f
allow nfsd_t self:capability { sys_admin sys_resource };
Chris PeBenito 43989f
Chris PeBenito 43989f
allow nfsd_t exports_t:file { getattr read };
Chris PeBenito 43989f
allow nfsd_t { nfsd_rw_t nfsd_ro_t }:dir r_dir_perms;
Chris PeBenito 43989f
Chris PeBenito 43989f
# for /proc/fs/nfs/exports - should we have a new type?
Chris PeBenito 43989f
kernel_read_system_state(nfsd_t) 
Chris PeBenito 43989f
kernel_read_network_state(nfsd_t) 
Chris PeBenito 43989f
kernel_udp_sendfrom(nfsd_t)	
Chris PeBenito 43989f
kernel_tcp_recvfrom(nfsd_t) 
Chris PeBenito ce0383
Chris PeBenito ce0383
corenet_udp_bind_generic_port(nfsd_t)
Chris PeBenito 2e0a88
corenet_udp_bind_reserved_port(nfsd_t)
Chris PeBenito ce0383
Chris PeBenito 43989f
fs_mount_nfsd_fs(nfsd_t) 
Chris PeBenito 43989f
fs_search_nfsd_fs(nfsd_t) 
Chris PeBenito 43989f
fs_getattr_all_fs(nfsd_t) 
Chris PeBenito 43989f
fs_rw_nfsd_fs(nfsd_t) 
Chris PeBenito 43989f
Chris PeBenito 43989f
term_use_controlling_term(nfsd_t) 
Chris PeBenito 43989f
Chris PeBenito 43989f
# does not really need this, but it is easier to just allow it
Chris PeBenito 43989f
files_search_pids(nfsd_t) 
Chris PeBenito 43989f
# for exportfs and rpc.mountd
Chris PeBenito 43989f
files_getattr_tmp_dir(nfsd_t) 
Chris PeBenito ce0383
# cjp: this should really have its own type
Chris PeBenito ce0383
files_manage_mounttab(rpcd_t)
Chris PeBenito 43989f
Chris PeBenito 43989f
tunable_policy(`nfs_export_all_rw',`
Chris PeBenito 43989f
	auth_read_all_dirs_except_shadow(nfsd_t) 
Chris PeBenito 43989f
	fs_read_noxattr_fs_files(nfsd_t) 
Chris PeBenito 43989f
')
Chris PeBenito 43989f
Chris PeBenito 43989f
tunable_policy(`nfs_export_all_ro',`
Chris PeBenito 43989f
	auth_read_all_dirs_except_shadow(nfsd_t) 
Chris PeBenito 43989f
	fs_read_noxattr_fs_files(nfsd_t) 
Chris PeBenito 43989f
')
Chris PeBenito 43989f
Chris PeBenito 43989f
########################################
Chris PeBenito 43989f
#
Chris PeBenito 43989f
# GSSD local policy
Chris PeBenito 43989f
#
Chris PeBenito 43989f
Chris PeBenito 43989f
allow gssd_t self:capability { dac_override dac_read_search setuid };
Chris PeBenito 43989f
allow gssd_t self:fifo_file { read write };
Chris PeBenito 43989f
Chris PeBenito 43989f
allow gssd_t gssd_tmp_t:dir create_dir_perms;
Chris PeBenito 43989f
allow gssd_t gssd_tmp_t:file create_file_perms;
Chris PeBenito 43989f
files_create_tmp_files(gssd_t, gssd_tmp_t, { file dir })
Chris PeBenito 43989f
Chris PeBenito 43989f
kernel_read_network_state(gssd_t)
Chris PeBenito 43989f
kernel_read_network_state_symlinks(gssd_t)	
Chris PeBenito 43989f
Chris PeBenito 2e0a88
corenet_udp_bind_generic_port(gssd_t)
Chris PeBenito 2e0a88
corenet_udp_bind_reserved_port(gssd_t)
Chris PeBenito 2e0a88
Chris PeBenito 43989f
dev_read_urand(gssd_t)
Chris PeBenito 43989f
Chris PeBenito 43989f
fs_read_rpc_dirs(gssd_t) 
Chris PeBenito 43989f
fs_read_rpc_sockets(gssd_t) 
Chris PeBenito 43989f
fs_read_rpc_files(gssd_t) 
Chris PeBenito 43989f
Chris PeBenito 725926
files_list_tmp(gssd_t) 
Chris PeBenito 725926
files_read_generic_tmp_files(gssd_t) 
Chris PeBenito 725926
files_read_generic_tmp_symlinks(gssd_t) 
Chris PeBenito 43989f
Chris PeBenito 43989f
tunable_policy(`allow_gssd_read_tmp',`
Chris PeBenito 43989f
	userdom_list_unpriv_user_tmp(gssd_t) 
Chris PeBenito 43989f
	userdom_read_unpriv_user_tmp_files(gssd_t) 
Chris PeBenito 43989f
	userdom_read_unpriv_user_tmp_symlinks(gssd_t) 
Chris PeBenito 43989f
')
Chris PeBenito 43989f
Chris PeBenito 43989f
optional_policy(`kerberos.te',`
Chris PeBenito 43989f
	kerberos_use(gssd_t)
Chris PeBenito 43989f
	kerberos_read_keytab(gssd_t) 
Chris PeBenito 43989f
')