2005-10-24 01:53:13 +00:00
|
|
|
## <summary>Remote Procedure Call Daemon for managment of network based process communication</summary>
|
|
|
|
|
|
|
|
#######################################
|
|
|
|
## <summary>
|
|
|
|
## The template to define a rpc domain.
|
|
|
|
## </summary>
|
|
|
|
## <desc>
|
|
|
|
## <p>
|
|
|
|
## This template creates a domain to be used for
|
|
|
|
## a new rpc daemon.
|
|
|
|
## </p>
|
|
|
|
## </desc>
|
|
|
|
## <param name="userdomain_prefix">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-10-24 01:53:13 +00:00
|
|
|
## The type of daemon to be used.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-10-24 01:53:13 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
template(`rpc_domain_template', `
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
|
|
|
type $1_t;
|
|
|
|
type $1_exec_t;
|
|
|
|
init_daemon_domain($1_t,$1_exec_t)
|
2006-02-20 21:33:25 +00:00
|
|
|
domain_use_interactive_fds($1_t)
|
2005-10-24 01:53:13 +00:00
|
|
|
|
|
|
|
####################################
|
|
|
|
#
|
|
|
|
# Local Policy
|
|
|
|
#
|
|
|
|
|
|
|
|
dontaudit $1_t self:capability { net_admin sys_tty_config };
|
|
|
|
allow $1_t self:capability net_bind_service;
|
|
|
|
allow $1_t self:process signal_perms;
|
|
|
|
allow $1_t self:unix_dgram_socket create_socket_perms;
|
|
|
|
allow $1_t self:unix_stream_socket create_stream_socket_perms;
|
|
|
|
allow $1_t self:netlink_route_socket r_netlink_socket_perms;
|
|
|
|
allow $1_t self:tcp_socket create_stream_socket_perms;
|
|
|
|
allow $1_t self:udp_socket create_socket_perms;
|
|
|
|
|
|
|
|
allow $1_t var_lib_nfs_t:dir create_dir_perms;
|
|
|
|
allow $1_t var_lib_nfs_t:file create_file_perms;
|
|
|
|
|
|
|
|
kernel_list_proc($1_t)
|
|
|
|
kernel_read_proc_symlinks($1_t)
|
2006-01-31 16:49:43 +00:00
|
|
|
kernel_read_kernel_sysctls($1_t)
|
2005-10-24 01:53:13 +00:00
|
|
|
# bind to arbitary unused ports
|
2006-01-31 16:49:43 +00:00
|
|
|
kernel_rw_rpc_sysctls($1_t)
|
2005-10-24 01:53:13 +00:00
|
|
|
|
|
|
|
dev_read_sysfs($1_t)
|
|
|
|
|
2006-05-25 17:56:07 +00:00
|
|
|
corenet_non_ipsec_sendrecv($1_t)
|
2005-10-24 01:53:13 +00:00
|
|
|
corenet_tcp_sendrecv_all_if($1_t)
|
|
|
|
corenet_udp_sendrecv_all_if($1_t)
|
|
|
|
corenet_tcp_sendrecv_all_nodes($1_t)
|
|
|
|
corenet_udp_sendrecv_all_nodes($1_t)
|
|
|
|
corenet_tcp_sendrecv_all_ports($1_t)
|
|
|
|
corenet_udp_sendrecv_all_ports($1_t)
|
|
|
|
corenet_tcp_bind_all_nodes($1_t)
|
|
|
|
corenet_udp_bind_all_nodes($1_t)
|
|
|
|
corenet_tcp_bind_reserved_port($1_t)
|
|
|
|
corenet_tcp_bind_reserved_port($1_t)
|
|
|
|
corenet_tcp_connect_all_ports($1_t)
|
2006-05-25 17:56:07 +00:00
|
|
|
corenet_sendrecv_portmap_client_packets($1_t)
|
2005-10-24 01:53:13 +00:00
|
|
|
# do not log when it tries to bind to a port belonging to another domain
|
|
|
|
corenet_dontaudit_tcp_bind_all_reserved_ports($1_t)
|
|
|
|
corenet_dontaudit_udp_bind_all_reserved_ports($1_t)
|
|
|
|
# bind to arbitary unused ports
|
|
|
|
corenet_tcp_bind_generic_port($1_t)
|
2006-05-26 20:29:51 +00:00
|
|
|
corenet_udp_bind_generic_port($1_t)
|
|
|
|
corenet_udp_bind_reserved_port($1_t)
|
2006-05-29 15:04:49 +00:00
|
|
|
corenet_sendrecv_generic_server_packets($1_t)
|
2005-10-24 01:53:13 +00:00
|
|
|
|
|
|
|
fs_search_auto_mountpoints($1_t)
|
|
|
|
|
|
|
|
term_dontaudit_use_console($1_t)
|
|
|
|
|
|
|
|
files_read_etc_files($1_t)
|
|
|
|
files_read_etc_runtime_files($1_t)
|
|
|
|
files_search_var($1_t)
|
2006-01-31 19:21:01 +00:00
|
|
|
files_search_var_lib($1_t)
|
2005-10-24 01:53:13 +00:00
|
|
|
|
2006-03-02 23:41:11 +00:00
|
|
|
init_use_fds($1_t)
|
2006-02-02 21:08:12 +00:00
|
|
|
init_use_script_ptys($1_t)
|
2005-10-24 01:53:13 +00:00
|
|
|
|
|
|
|
libs_use_ld_so($1_t)
|
|
|
|
libs_use_shared_libs($1_t)
|
|
|
|
|
|
|
|
logging_send_syslog_msg($1_t)
|
|
|
|
|
|
|
|
miscfiles_read_localization($1_t)
|
|
|
|
|
|
|
|
sysnet_read_config($1_t)
|
|
|
|
|
2006-02-20 21:33:25 +00:00
|
|
|
userdom_dontaudit_use_unpriv_user_fds($1_t)
|
2005-10-24 01:53:13 +00:00
|
|
|
|
|
|
|
ifdef(`targeted_policy',`
|
2006-02-02 21:08:12 +00:00
|
|
|
term_dontaudit_use_unallocated_ttys($1_t)
|
|
|
|
term_dontaudit_use_generic_ptys($1_t)
|
2006-01-31 19:21:01 +00:00
|
|
|
files_dontaudit_read_root_files($1_t)
|
2005-10-24 01:53:13 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-10-24 01:53:13 +00:00
|
|
|
nis_use_ypbind($1_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-10-24 01:53:13 +00:00
|
|
|
seutil_sigchld_newrole($1_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-10-24 01:53:13 +00:00
|
|
|
udev_read_db($1_t)
|
|
|
|
')
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Send UDP network traffic to rpc and recieve UDP traffic from rpc.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-10-24 01:53:13 +00:00
|
|
|
## The type of the process performing this action.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-10-24 01:53:13 +00:00
|
|
|
## </param>
|
|
|
|
#
|
2006-02-02 21:08:12 +00:00
|
|
|
interface(`rpc_udp_send',`
|
2005-10-24 01:53:13 +00:00
|
|
|
gen_require(`
|
|
|
|
type rpc_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 rpc_t:udp_socket sendto;
|
|
|
|
allow rpc_t $1:udp_socket recvfrom;
|
|
|
|
')
|
|
|
|
|
2005-11-25 17:39:35 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Do not audit attempts to get the attributes
|
|
|
|
## of the NFS export file.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-11-25 17:39:35 +00:00
|
|
|
## The type of the process performing this action.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-11-25 17:39:35 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`rpc_dontaudit_getattr_exports',`
|
|
|
|
gen_require(`
|
|
|
|
type exports_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
dontaudit $1 exports_t:file getattr;
|
|
|
|
')
|
|
|
|
|
2005-10-24 01:53:13 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Allow read access to exports.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-10-24 01:53:13 +00:00
|
|
|
## The type of the process performing this action.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-10-24 01:53:13 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`rpc_read_exports',`
|
|
|
|
gen_require(`
|
|
|
|
type exports_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 exports_t:file r_file_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Allow write access to exports.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-10-24 01:53:13 +00:00
|
|
|
## The type of the process performing this action.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-10-24 01:53:13 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`rpc_write_exports',`
|
|
|
|
gen_require(`
|
|
|
|
type exports_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 exports_t:file write;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Execute domain in nfsd domain.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-10-24 01:53:13 +00:00
|
|
|
## The type of the process performing this action.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-10-24 01:53:13 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`rpc_domtrans_nfsd',`
|
|
|
|
gen_require(`
|
|
|
|
type nfsd_t, nfsd_exec_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
domain_auto_trans($1,nfsd_exec_t,nfsd_t)
|
|
|
|
|
|
|
|
allow $1 nfsd_t:fd use;
|
|
|
|
allow nfsd_t $1:fd use;
|
|
|
|
allow nfsd_t $1:fifo_file rw_file_perms;
|
|
|
|
allow nfsd_t $1:process sigchld;
|
|
|
|
')
|
|
|
|
|
2006-06-14 20:52:45 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Read NFS exported content.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`rpc_read_nfs_content',`
|
|
|
|
gen_require(`
|
|
|
|
type nfsd_ro_t, nfsd_rw_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 { nfsd_ro_t nfsd_rw_t }:dir list_dir_perms;
|
|
|
|
allow $1 { nfsd_ro_t nfsd_rw_t }:file read_file_perms;
|
|
|
|
allow $1 { nfsd_ro_t nfsd_rw_t }:lnk_file { getattr read };
|
|
|
|
')
|
|
|
|
|
2005-10-24 01:53:13 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Allow domain to create read and write NFS directories.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-10-24 01:53:13 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-10-24 01:53:13 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`rpc_manage_nfs_rw_content',`
|
|
|
|
gen_require(`
|
|
|
|
type nfsd_rw_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 nfsd_rw_t:dir manage_dir_perms;
|
|
|
|
allow $1 nfsd_rw_t:file manage_file_perms;
|
|
|
|
allow $1 nfsd_rw_t:lnk_file create_lnk_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Allow domain to create read and write NFS directories.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-10-24 01:53:13 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-10-24 01:53:13 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`rpc_manage_nfs_ro_content',`
|
|
|
|
gen_require(`
|
|
|
|
type nfsd_ro_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 nfsd_ro_t:dir manage_dir_perms;
|
|
|
|
allow $1 nfsd_ro_t:file manage_file_perms;
|
|
|
|
allow $1 nfsd_ro_t:lnk_file create_lnk_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Allow domain to read and write to an NFS UDP socket.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-10-24 01:53:13 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-10-24 01:53:13 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`rpc_udp_rw_nfs_sockets',`
|
|
|
|
gen_require(`
|
|
|
|
type nfsd_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 nfsd_t:udp_socket rw_socket_perms;
|
|
|
|
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
2006-01-30 18:22:24 +00:00
|
|
|
## Send UDP traffic to NFSd.
|
2005-10-24 01:53:13 +00:00
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2006-01-30 18:22:24 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-10-24 01:53:13 +00:00
|
|
|
## </param>
|
|
|
|
#
|
2006-02-02 21:08:12 +00:00
|
|
|
interface(`rpc_udp_send_nfs',`
|
2005-10-24 01:53:13 +00:00
|
|
|
gen_require(`
|
|
|
|
type nfsd_t;
|
|
|
|
')
|
|
|
|
|
2006-01-30 18:22:24 +00:00
|
|
|
allow $1 nfsd_t:udp_socket sendto;
|
|
|
|
allow nfsd_t $1:udp_socket recvfrom;
|
2005-10-24 01:53:13 +00:00
|
|
|
')
|
2005-12-02 22:06:05 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Search NFS state data in /var/lib/nfs.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-12-02 22:06:05 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-12-02 22:06:05 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`rpc_search_nfs_state_data',`
|
|
|
|
gen_require(`
|
|
|
|
type var_lib_nfs_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
files_search_var_lib($1)
|
|
|
|
allow $1 var_lib_nfs_t:dir search;
|
|
|
|
')
|
2006-06-14 20:52:45 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Read NFS state data in /var/lib/nfs.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`rpc_read_nfs_state_data',`
|
|
|
|
gen_require(`
|
|
|
|
type var_lib_nfs_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
files_search_var_lib($1)
|
|
|
|
allow $1 var_lib_nfs_t:dir search_dir_perms;
|
|
|
|
allow $1 var_lib_nfs_t:file read_file_perms;
|
|
|
|
')
|