Chris PeBenito 17de1b
Chris PeBenito 29af4c
policy_module(rpc, 1.12.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 50458c
files_config_file(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 372acd
type rpcd_initrc_exec_t;
Chris PeBenito 372acd
init_script_file(rpcd_initrc_exec_t);
Chris PeBenito 372acd
Chris PeBenito 17de1b
rpc_domain_template(nfsd)
Chris PeBenito 17de1b
Chris PeBenito 372acd
type nfsd_initrc_exec_t;
Chris PeBenito 372acd
init_script_file(nfsd_initrc_exec_t);
Chris PeBenito 372acd
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 372acd
allow rpcd_t self:capability { sys_admin chown dac_override setgid setuid };
Chris PeBenito 372acd
allow rpcd_t self:process { getcap setcap };
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 372acd
kernel_read_system_state(rpcd_t)
Chris PeBenito 3e5987
kernel_read_network_state(rpcd_t)
Chris PeBenito 17de1b
# for rpc.rquotad
Chris PeBenito 6073ea
kernel_read_sysctl(rpcd_t)
Chris PeBenito 01e8ff
kernel_rw_fs_sysctls(rpcd_t)
Chris PeBenito 3c9b2e
kernel_dontaudit_getattr_core_if(rpcd_t)
Chris PeBenito 372acd
kernel_signal(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 50458c
files_getattr_all_dirs(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 372acd
fs_rw_rpc_sockets(rpcd_t)
Chris PeBenito 372acd
fs_get_all_fs_quotas(rpcd_t)
Chris PeBenito 372acd
fs_getattr_all_fs(rpcd_t)
Chris PeBenito 50458c
Chris PeBenito 50458c
storage_getattr_fixed_disk_dev(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 50458c
	automount_signal(rpcd_t)
Chris PeBenito 372acd
	automount_dontaudit_write_pipes(rpcd_t)
Chris PeBenito 50458c
')
Chris PeBenito 50458c
Chris PeBenito 50458c
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 372acd
kernel_read_system_state(nfsd_t)
Chris PeBenito 372acd
kernel_read_network_state(nfsd_t)
Chris PeBenito 372acd
kernel_dontaudit_getattr_core_if(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 372acd
files_search_pids(nfsd_t)
Chris PeBenito 17de1b
# for exportfs and rpc.mountd
Chris PeBenito 372acd
files_getattr_tmp_dirs(nfsd_t)
Chris PeBenito 17de1b
# cjp: this should really have its own type
Chris PeBenito 50458c
files_manage_mounttab(nfsd_t)
Chris PeBenito 372acd
files_read_etc_runtime_files(nfsd_t)
Chris PeBenito 17de1b
Chris PeBenito 372acd
fs_mount_nfsd_fs(nfsd_t)
Chris PeBenito 372acd
fs_search_nfsd_fs(nfsd_t)
Chris PeBenito 372acd
fs_getattr_all_fs(nfsd_t)
Chris PeBenito 3e5987
fs_getattr_all_dirs(nfsd_t)
Chris PeBenito 372acd
fs_rw_nfsd_fs(nfsd_t)
Chris PeBenito 3e5987
Chris PeBenito 3e5987
storage_dontaudit_read_fixed_disk(nfsd_t)
Chris PeBenito 372acd
storage_raw_read_removable_device(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 372acd
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
tunable_policy(`nfs_export_all_rw',`
Chris PeBenito 3c9b2e
	dev_getattr_all_blk_files(nfsd_t)
Chris PeBenito 3c9b2e
	dev_getattr_all_chr_files(nfsd_t)
Chris PeBenito 3c9b2e
Chris PeBenito 372acd
	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 3c9b2e
	dev_getattr_all_blk_files(nfsd_t)
Chris PeBenito 3c9b2e
	dev_getattr_all_chr_files(nfsd_t)
Chris PeBenito 3c9b2e
Chris PeBenito 3c9b2e
	files_getattr_all_pipes(nfsd_t)
Chris PeBenito 3c9b2e
	files_getattr_all_sockets(nfsd_t)
Chris PeBenito 3c9b2e
Chris PeBenito 3c9b2e
	fs_read_noxattr_fs_files(nfsd_t)
Chris PeBenito 3c9b2e
Chris PeBenito 3c9b2e
	auth_read_all_dirs_except_shadow(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 372acd
kernel_read_network_state_symlinks(gssd_t)
Dominick Grift 91b12a
kernel_request_load_module(gssd_t)
Chris PeBenito 372acd
kernel_search_network_sysctl(gssd_t)
Chris PeBenito 372acd
kernel_signal(gssd_t)
Chris PeBenito c23eb5
Chris PeBenito c23eb5
corecmd_exec_bin(gssd_t)
Chris PeBenito 17de1b
Chris PeBenito 372acd
fs_list_rpc(gssd_t)
Chris PeBenito 372acd
fs_rw_rpc_sockets(gssd_t)
Chris PeBenito 372acd
fs_read_rpc_files(gssd_t)
Chris PeBenito 17de1b
Chris PeBenito 372acd
fs_list_inotifyfs(gssd_t)
Chris PeBenito 372acd
files_list_tmp(gssd_t)
Chris PeBenito 372acd
files_read_usr_symlinks(gssd_t)
Chris PeBenito 372acd
files_dontaudit_write_var_dirs(gssd_t)
Chris PeBenito 17de1b
Chris PeBenito 3e5987
auth_use_nsswitch(gssd_t)
Chris PeBenito 372acd
auth_manage_cache(gssd_t)
Chris PeBenito 3e5987
Chris PeBenito d9845a
miscfiles_read_certs(gssd_t)
Chris PeBenito d9845a
Chris PeBenito 50458c
mount_signal(gssd_t)
Chris PeBenito 50458c
Chris PeBenito 372acd
userdom_signal_all_users(gssd_t)
Chris PeBenito 372acd
Chris PeBenito 17de1b
tunable_policy(`allow_gssd_read_tmp',`
Chris PeBenito 372acd
	userdom_list_user_tmp(gssd_t)
Chris PeBenito 372acd
	userdom_read_user_tmp_files(gssd_t)
Chris PeBenito 372acd
	userdom_read_user_tmp_symlinks(gssd_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 50458c
	automount_signal(gssd_t)
Chris PeBenito 50458c
')
Chris PeBenito 50458c
Chris PeBenito 50458c
optional_policy(`
Chris PeBenito 372acd
	kerberos_keytab_template(gssd, 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
')