Chris PeBenito 17de1b
Chris PeBenito 5d4f4b
policy_module(rpc, 1.9.0)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Declarations
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 56e1b3
## <desc>
Chris PeBenito 56e1b3
## 

Chris PeBenito dd9e1d
## Allow gssd to read temp directory.  For access to kerberos tgt.
Chris PeBenito 56e1b3
## 

Chris PeBenito 56e1b3
## </desc>
Chris PeBenito 0bfccd
gen_tunable(allow_gssd_read_tmp, true)
Chris PeBenito 56e1b3
Chris PeBenito 56e1b3
## <desc>
Chris PeBenito 56e1b3
## 

Chris PeBenito 56e1b3
## Allow nfs servers to modify public files
Chris PeBenito dd9e1d
## used for public file transfer services.  Files/Directories must be
Chris PeBenito dd9e1d
## labeled public_content_rw_t.
Chris PeBenito 56e1b3
## 

Chris PeBenito 56e1b3
## </desc>
Chris PeBenito 0bfccd
gen_tunable(allow_nfsd_anon_write, false)
Chris PeBenito 56e1b3
Chris PeBenito 17de1b
type exports_t;
Chris PeBenito 17de1b
files_type(exports_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
rpc_domain_template(gssd)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type gssd_tmp_t;
Chris PeBenito 17de1b
files_tmp_file(gssd_tmp_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type rpcd_var_run_t;
Chris PeBenito 17de1b
files_pid_file(rpcd_var_run_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# rpcd_t is the domain of rpc daemons.
Chris PeBenito 17de1b
# rpc_exec_t is the type of rpc daemon programs.
Chris PeBenito 17de1b
rpc_domain_template(rpcd)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
rpc_domain_template(nfsd)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type nfsd_rw_t;
Chris PeBenito 17de1b
files_type(nfsd_rw_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type nfsd_ro_t;
Chris PeBenito 17de1b
files_type(nfsd_ro_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type var_lib_nfs_t;
Chris PeBenito 17de1b
files_mountpoint(var_lib_nfs_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# RPC local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito d15dd5
allow rpcd_t self:capability { chown dac_override setgid setuid };
Chris PeBenito c0868a
allow rpcd_t self:fifo_file rw_fifo_file_perms;
Chris PeBenito 17de1b
Chris PeBenito c0868a
allow rpcd_t rpcd_var_run_t:dir setattr;
Chris PeBenito 0bfccd
manage_files_pattern(rpcd_t, rpcd_var_run_t, rpcd_var_run_t)
Chris PeBenito 0bfccd
files_pid_filetrans(rpcd_t, rpcd_var_run_t, file)
Chris PeBenito 17de1b
Chris PeBenito 01e8ff
# rpc.statd executes sm-notify
Chris PeBenito 01e8ff
can_exec(rpcd_t, rpcd_exec_t)
Chris PeBenito 01e8ff
Chris PeBenito 13d7ce
kernel_read_system_state(rpcd_t) 
Chris PeBenito 3e5987
kernel_read_network_state(rpcd_t)
Chris PeBenito 17de1b
# for rpc.rquotad
Chris PeBenito 17de1b
kernel_read_sysctl(rpcd_t)  
Chris PeBenito 01e8ff
kernel_rw_fs_sysctls(rpcd_t)
Chris PeBenito 17de1b
Chris PeBenito 3e5987
corecmd_exec_bin(rpcd_t)
Chris PeBenito 3e5987
Chris PeBenito 3e5987
files_manage_mounttab(rpcd_t)
Chris PeBenito 3e5987
Chris PeBenito 17de1b
fs_list_rpc(rpcd_t)
Chris PeBenito 17de1b
fs_read_rpc_files(rpcd_t)
Chris PeBenito 17de1b
fs_read_rpc_symlinks(rpcd_t)
Chris PeBenito 17de1b
fs_read_rpc_sockets(rpcd_t) 
Chris PeBenito 17de1b
Chris PeBenito 3e5987
selinux_dontaudit_read_fs(rpcd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
miscfiles_read_certs(rpcd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
seutil_dontaudit_search_config(rpcd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	nis_read_ypserv_config(rpcd_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# NFSD local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow nfsd_t self:capability { dac_override dac_read_search sys_admin sys_resource };
Chris PeBenito 17de1b
Chris PeBenito 0b36a2
allow nfsd_t exports_t:file read_file_perms;
Chris PeBenito c0868a
allow nfsd_t { nfsd_rw_t nfsd_ro_t }:dir list_dir_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# for /proc/fs/nfs/exports - should we have a new type?
Chris PeBenito 17de1b
kernel_read_system_state(nfsd_t) 
Chris PeBenito 17de1b
kernel_read_network_state(nfsd_t) 
Chris PeBenito 17de1b
Chris PeBenito d9845a
corenet_tcp_bind_all_rpc_ports(nfsd_t)
Chris PeBenito d9845a
corenet_udp_bind_all_rpc_ports(nfsd_t)
Chris PeBenito d9845a
Chris PeBenito 3e5987
dev_dontaudit_getattr_all_blk_files(nfsd_t)
Chris PeBenito 3e5987
dev_dontaudit_getattr_all_chr_files(nfsd_t)
Chris PeBenito 3e5987
dev_rw_lvm_control(nfsd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# does not really need this, but it is easier to just allow it
Chris PeBenito 17de1b
files_search_pids(nfsd_t) 
Chris PeBenito 17de1b
# for exportfs and rpc.mountd
Chris PeBenito 17de1b
files_getattr_tmp_dirs(nfsd_t) 
Chris PeBenito 17de1b
# cjp: this should really have its own type
Chris PeBenito 17de1b
files_manage_mounttab(rpcd_t)
Chris PeBenito 17de1b
Chris PeBenito 3e5987
fs_mount_nfsd_fs(nfsd_t) 
Chris PeBenito 3e5987
fs_search_nfsd_fs(nfsd_t) 
Chris PeBenito 3e5987
fs_getattr_all_fs(nfsd_t) 
Chris PeBenito 3e5987
fs_getattr_all_dirs(nfsd_t)
Chris PeBenito 3e5987
fs_rw_nfsd_fs(nfsd_t) 
Chris PeBenito 3e5987
Chris PeBenito 3e5987
storage_dontaudit_read_fixed_disk(nfsd_t)
Chris PeBenito 3e5987
Chris PeBenito 17de1b
# Read access to public_content_t and public_content_rw_t
Chris PeBenito 17de1b
miscfiles_read_public_files(nfsd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# Write access to public_content_t and public_content_rw_t
Chris PeBenito 17de1b
tunable_policy(`allow_nfsd_anon_write',`
Chris PeBenito 17de1b
	miscfiles_manage_public_files(nfsd_t)
Chris PeBenito 17de1b
') 
Chris PeBenito 17de1b
Chris PeBenito 17de1b
tunable_policy(`nfs_export_all_rw',`
Chris PeBenito 17de1b
	fs_read_noxattr_fs_files(nfsd_t) 
Chris PeBenito 17de1b
	auth_manage_all_files_except_shadow(nfsd_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
tunable_policy(`nfs_export_all_ro',`
Chris PeBenito 17de1b
	fs_read_noxattr_fs_files(nfsd_t) 
Chris PeBenito 17de1b
	auth_read_all_files_except_shadow(nfsd_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# GSSD local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito c23eb5
allow gssd_t self:capability { dac_override dac_read_search setuid sys_nice };
Chris PeBenito c23eb5
allow gssd_t self:process { getsched setsched };
Chris PeBenito c23eb5
allow gssd_t self:fifo_file rw_file_perms;
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
manage_dirs_pattern(gssd_t, gssd_tmp_t, gssd_tmp_t)
Chris PeBenito 0bfccd
manage_files_pattern(gssd_t, gssd_tmp_t, gssd_tmp_t)
Chris PeBenito 17de1b
files_tmp_filetrans(gssd_t, gssd_tmp_t, { file dir })
Chris PeBenito 17de1b
Chris PeBenito 3e5987
kernel_read_system_state(gssd_t)
Chris PeBenito 17de1b
kernel_read_network_state(gssd_t)
Chris PeBenito 17de1b
kernel_read_network_state_symlinks(gssd_t)	
Chris PeBenito c23eb5
kernel_search_network_sysctl(gssd_t)	
Chris PeBenito c23eb5
Chris PeBenito c23eb5
corecmd_exec_bin(gssd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
fs_list_rpc(gssd_t) 
Chris PeBenito 17de1b
fs_read_rpc_sockets(gssd_t) 
Chris PeBenito 17de1b
fs_read_rpc_files(gssd_t) 
Chris PeBenito 17de1b
Chris PeBenito 17de1b
files_list_tmp(gssd_t) 
Chris PeBenito c23eb5
files_read_usr_symlinks(gssd_t) 
Chris PeBenito 17de1b
Chris PeBenito 3e5987
auth_use_nsswitch(gssd_t)
Chris PeBenito 3e5987
Chris PeBenito d9845a
miscfiles_read_certs(gssd_t)
Chris PeBenito d9845a
Chris PeBenito 17de1b
tunable_policy(`allow_gssd_read_tmp',`
Chris PeBenito 17de1b
	userdom_list_unpriv_users_tmp(gssd_t) 
Chris PeBenito 17de1b
	userdom_read_unpriv_users_tmp_files(gssd_t) 
Chris PeBenito 17de1b
	userdom_read_unpriv_users_tmp_symlinks(gssd_t) 
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	kerberos_use(gssd_t)
Chris PeBenito 17de1b
	kerberos_read_keytab(gssd_t) 
Chris PeBenito 17de1b
')
Chris PeBenito c23eb5
Chris PeBenito c23eb5
optional_policy(`
Chris PeBenito c23eb5
	pcscd_read_pub_files(gssd_t)
Chris PeBenito c23eb5
')
Chris PeBenito c23eb5
Chris PeBenito c23eb5
optional_policy(`
Chris PeBenito c23eb5
	xserver_rw_xdm_tmp_files(gssd_t)
Chris PeBenito c23eb5
')