|
Chris PeBenito |
eb3cb6 |
## <summary>RPC port mapping service.</summary>
|
|
Chris PeBenito |
eb3cb6 |
|
|
Chris PeBenito |
eb3cb6 |
########################################
|
|
Chris PeBenito |
eb3cb6 |
## <summary>
|
|
Chris PeBenito |
eb3cb6 |
## Execute portmap_helper in the helper domain.
|
|
Chris PeBenito |
eb3cb6 |
## </summary>
|
|
Chris PeBenito |
eb3cb6 |
## <param name="domain">
|
|
Chris PeBenito |
eb3cb6 |
## Domain allowed access.
|
|
Chris PeBenito |
eb3cb6 |
## </param>
|
|
Chris PeBenito |
eb3cb6 |
#
|
|
Chris PeBenito |
eb3cb6 |
interface(`portmap_domtrans_helper',`
|
|
Chris PeBenito |
eb3cb6 |
gen_require(`
|
|
Chris PeBenito |
eb3cb6 |
type portmap_helper_t, portmap_helper_exec_t;
|
|
Chris PeBenito |
eb3cb6 |
class process sigchld;
|
|
Chris PeBenito |
eb3cb6 |
class fd use;
|
|
Chris PeBenito |
eb3cb6 |
class fifo_file rw_file_perms;
|
|
Chris PeBenito |
eb3cb6 |
')
|
|
Chris PeBenito |
eb3cb6 |
|
|
Chris PeBenito |
eb3cb6 |
corecmd_search_bin($1)
|
|
Chris PeBenito |
eb3cb6 |
domain_auto_trans($1,portmap_helper_exec_t,portmap_helper_t)
|
|
Chris PeBenito |
eb3cb6 |
|
|
Chris PeBenito |
eb3cb6 |
allow $1 portmap_helper_t:fd use;
|
|
Chris PeBenito |
eb3cb6 |
allow portmap_helper_t $1:fd use;
|
|
Chris PeBenito |
eb3cb6 |
allow portmap_helper_t $1:fifo_file rw_file_perms;
|
|
Chris PeBenito |
eb3cb6 |
allow portmap_helper_t $1:process sigchld;
|
|
Chris PeBenito |
eb3cb6 |
')
|
|
Chris PeBenito |
eb3cb6 |
|
|
Chris PeBenito |
eb3cb6 |
########################################
|
|
Chris PeBenito |
eb3cb6 |
## <summary>
|
|
Chris PeBenito |
eb3cb6 |
## Execute portmap helper in the helper domain, and
|
|
Chris PeBenito |
eb3cb6 |
## allow the specified role the helper domain.
|
|
Chris PeBenito |
eb3cb6 |
## Communicate with portmap.
|
|
Chris PeBenito |
eb3cb6 |
## </summary>
|
|
Chris PeBenito |
eb3cb6 |
## <param name="domain">
|
|
Chris PeBenito |
eb3cb6 |
## Domain allowed access.
|
|
Chris PeBenito |
eb3cb6 |
## </param>
|
|
Chris PeBenito |
eb3cb6 |
## <param name="role">
|
|
Chris PeBenito |
eb3cb6 |
## The role to be allowed the portmap domain.
|
|
Chris PeBenito |
eb3cb6 |
## </param>
|
|
Chris PeBenito |
eb3cb6 |
## <param name="terminal">
|
|
Chris PeBenito |
eb3cb6 |
## The type of the terminal allow the portmap domain to use.
|
|
Chris PeBenito |
eb3cb6 |
## </param>
|
|
Chris PeBenito |
eb3cb6 |
#
|
|
Chris PeBenito |
eb3cb6 |
interface(`portmap_run_helper',`
|
|
Chris PeBenito |
eb3cb6 |
gen_require(`
|
|
Chris PeBenito |
0efe52 |
type portmap_t, portmap_helper_t;
|
|
Chris PeBenito |
eb3cb6 |
class chr_file { getattr read write ioctl };
|
|
Chris PeBenito |
eb3cb6 |
')
|
|
Chris PeBenito |
eb3cb6 |
|
|
Chris PeBenito |
eb3cb6 |
portmap_domtrans_helper($1)
|
|
Chris PeBenito |
eb3cb6 |
role $2 types portmap_helper_t;
|
|
Chris PeBenito |
eb3cb6 |
allow portmap_helper_t $3:chr_file { getattr read write ioctl };
|
|
Chris PeBenito |
eb3cb6 |
|
|
Chris PeBenito |
eb3cb6 |
# send to portmap
|
|
Chris PeBenito |
eb3cb6 |
allow $1 portmap_t:udp_socket sendto;
|
|
Chris PeBenito |
eb3cb6 |
allow portmap_t $1:udp_socket recvfrom;
|
|
Chris PeBenito |
eb3cb6 |
|
|
Chris PeBenito |
eb3cb6 |
# receive from portmap
|
|
Chris PeBenito |
eb3cb6 |
allow portmap_t $1:udp_socket sendto;
|
|
Chris PeBenito |
eb3cb6 |
allow $1 portmap_t:udp_socket recvfrom;
|
|
Chris PeBenito |
eb3cb6 |
')
|
|
Chris PeBenito |
eb3cb6 |
|
|
Chris PeBenito |
eb3cb6 |
########################################
|
|
Chris PeBenito |
eb3cb6 |
## <summary>
|
|
Chris PeBenito |
eb3cb6 |
## Send UDP network traffic to portmap.
|
|
Chris PeBenito |
eb3cb6 |
## </summary>
|
|
Chris PeBenito |
eb3cb6 |
## <param name="domain">
|
|
Chris PeBenito |
eb3cb6 |
## The type of the process performing this action.
|
|
Chris PeBenito |
eb3cb6 |
## </param>
|
|
Chris PeBenito |
eb3cb6 |
#
|
|
Chris PeBenito |
eb3cb6 |
interface(`portmap_udp_sendto',`
|
|
Chris PeBenito |
eb3cb6 |
gen_require(`
|
|
Chris PeBenito |
eb3cb6 |
type portmap_t;
|
|
Chris PeBenito |
eb3cb6 |
class udp_socket { sendto recvfrom };
|
|
Chris PeBenito |
eb3cb6 |
')
|
|
Chris PeBenito |
eb3cb6 |
|
|
Chris PeBenito |
eb3cb6 |
allow $1 portmap_t:udp_socket sendto;
|
|
Chris PeBenito |
eb3cb6 |
allow portmap_t $1:udp_socket recvfrom;
|
|
Chris PeBenito |
eb3cb6 |
')
|