Chris PeBenito 17de1b7
## <summary>Policy for mount.</summary>
Chris PeBenito 17de1b7
Chris PeBenito 17de1b7
########################################
Chris PeBenito 17de1b7
## <summary>
Chris PeBenito 17de1b7
##	Execute mount in the mount domain.
Chris PeBenito 17de1b7
## </summary>
Chris PeBenito 17de1b7
## <param name="domain">
Chris PeBenito 17de1b7
##	<summary>
Dominick Grift a0546c9
##	Domain allowed to transition.
Chris PeBenito 17de1b7
##	</summary>
Chris PeBenito 17de1b7
## </param>
Chris PeBenito 17de1b7
#
Chris PeBenito 17de1b7
interface(`mount_domtrans',`
Chris PeBenito 17de1b7
	gen_require(`
Chris PeBenito 17de1b7
		type mount_t, mount_exec_t;
Chris PeBenito 17de1b7
	')
Chris PeBenito 17de1b7
Chris PeBenito 3f67f72
	domtrans_pattern($1, mount_exec_t, mount_t)
3eaa993
	mount_domtrans_fusermount($1)
3eaa993
3eaa993
ifdef(`hide_broken_symptoms', `
3eaa993
	dontaudit mount_t $1:unix_stream_socket { read write };
3eaa993
	dontaudit mount_t $1:tcp_socket  { read write };
3eaa993
	dontaudit mount_t $1:udp_socket { read write };
3eaa993
')
3eaa993
Chris PeBenito 17de1b7
')
Chris PeBenito 17de1b7
Chris PeBenito 17de1b7
########################################
Chris PeBenito 17de1b7
## <summary>
Chris PeBenito 17de1b7
##	Execute mount in the mount domain, and
Chris PeBenito 17de1b7
##	allow the specified role the mount domain,
Chris PeBenito 17de1b7
##	and use the caller's terminal.
Chris PeBenito 17de1b7
## </summary>
Chris PeBenito 17de1b7
## <param name="domain">
Chris PeBenito 17de1b7
##	<summary>
Dominick Grift a0546c9
##	Domain allowed to transition.
Chris PeBenito 17de1b7
##	</summary>
Chris PeBenito 17de1b7
## </param>
Chris PeBenito 17de1b7
## <param name="role">
Chris PeBenito 17de1b7
##	<summary>
Chris PeBenito a7ee7f8
##	Role allowed access.
Chris PeBenito 17de1b7
##	</summary>
Chris PeBenito 17de1b7
## </param>
Chris PeBenito bbcd3c9
## <rolecap/>
Chris PeBenito 17de1b7
#
Chris PeBenito 17de1b7
interface(`mount_run',`
Chris PeBenito 17de1b7
	gen_require(`
Chris PeBenito 17de1b7
		type mount_t;
Chris PeBenito 17de1b7
	')
Chris PeBenito 17de1b7
Chris PeBenito 17de1b7
	mount_domtrans($1)
Chris PeBenito 17de1b7
	role $2 types mount_t;
Chris PeBenito 350b6ab
Chris PeBenito 350b6ab
	optional_policy(`
3eaa993
		fstools_run(mount_t, $2)
3eaa993
	')
3eaa993
3eaa993
	# Needed for mount crypt https://bugzilla.redhat.com/show_bug.cgi?id=418711
3eaa993
	optional_policy(`
3eaa993
		lvm_run(mount_t, $2)
3eaa993
	')
3eaa993
3eaa993
	optional_policy(`
3eaa993
		modutils_run_insmod(mount_t, $2)
3eaa993
	')
3eaa993
3eaa993
	optional_policy(`
3eaa993
		rpc_run_rpcd(mount_t, $2)
3eaa993
	')
3eaa993
3eaa993
	optional_policy(`
3eaa993
		samba_run_smbmount(mount_t, $2)
Chris PeBenito 350b6ab
	')
Chris PeBenito 17de1b7
')
Chris PeBenito 17de1b7
Chris PeBenito 17de1b7
########################################
Chris PeBenito 17de1b7
## <summary>
3eaa993
##	Execute fusermount in the mount domain, and
3eaa993
##	allow the specified role the mount domain,
3eaa993
##	and use the caller's terminal.
3eaa993
## </summary>
3eaa993
## <param name="domain">
3eaa993
##	<summary>
3eaa993
##	Domain allowed access.
3eaa993
##	</summary>
3eaa993
## </param>
3eaa993
## <param name="role">
3eaa993
##	<summary>
3eaa993
##	The role to be allowed the mount domain.
3eaa993
##	</summary>
3eaa993
## </param>
3eaa993
## <rolecap/>
3eaa993
#
3eaa993
interface(`mount_run_fusermount',`
3eaa993
	gen_require(`
3eaa993
		type mount_t;
3eaa993
	')
3eaa993
3eaa993
	mount_domtrans_fusermount($1)
3eaa993
	role $2 types mount_t;
3eaa993
3eaa993
	fstools_run(mount_t, $2)
3eaa993
')
3eaa993
3eaa993
########################################
3eaa993
## <summary>
Chris PeBenito 17de1b7
##	Execute mount in the caller domain.
Chris PeBenito 17de1b7
## </summary>
Chris PeBenito 17de1b7
## <param name="domain">
Chris PeBenito 17de1b7
##	<summary>
Dominick Grift a0546c9
##	Domain allowed access.
Chris PeBenito 17de1b7
##	</summary>
Chris PeBenito 17de1b7
## </param>
Chris PeBenito 17de1b7
#
Chris PeBenito 17de1b7
interface(`mount_exec',`
Chris PeBenito 17de1b7
	gen_require(`
Chris PeBenito 17de1b7
		type mount_exec_t;
Chris PeBenito 17de1b7
	')
Chris PeBenito 17de1b7
Chris PeBenito c0868a7
	# cjp: this should be removed:
Chris PeBenito c0868a7
	allow $1 mount_exec_t:dir list_dir_perms;
Chris PeBenito 17de1b7
Chris PeBenito c0868a7
	allow $1 mount_exec_t:lnk_file read_lnk_file_perms;
Chris PeBenito 3f67f72
	can_exec($1, mount_exec_t)
Chris PeBenito 17de1b7
')
Chris PeBenito 17de1b7
Chris PeBenito 17de1b7
########################################
Chris PeBenito 17de1b7
## <summary>
Chris PeBenito 3332229
##	Send a generic signal to mount.
Chris PeBenito 3332229
## </summary>
Chris PeBenito 3332229
## <param name="domain">
Chris PeBenito 3332229
##	<summary>
Chris PeBenito 3332229
##	Domain allowed access.
Chris PeBenito 3332229
##	</summary>
Chris PeBenito 3332229
## </param>
Chris PeBenito 3332229
#
Chris PeBenito 3332229
interface(`mount_signal',`
Chris PeBenito 3332229
	gen_require(`
Chris PeBenito 3332229
		type mount_t;
3eaa993
		type unconfined_mount_t;
Chris PeBenito 3332229
	')
Chris PeBenito 3332229
Chris PeBenito 3332229
	allow $1 mount_t:process signal;
3eaa993
	allow $1 unconfined_mount_t:process signal;
Chris PeBenito 3332229
')
Chris PeBenito 3332229
Chris PeBenito 3332229
########################################
Chris PeBenito 3332229
## <summary>
Chris PeBenito 17de1b7
##	Use file descriptors for mount.
Chris PeBenito 17de1b7
## </summary>
Chris PeBenito 17de1b7
## <param name="domain">
Chris PeBenito 17de1b7
##	<summary>
3eaa993
##	Domain allowed access.
Chris PeBenito 17de1b7
##	</summary>
Chris PeBenito 17de1b7
## </param>
Chris PeBenito 17de1b7
#
Chris PeBenito 17de1b7
interface(`mount_use_fds',`
Chris PeBenito 17de1b7
	gen_require(`
Chris PeBenito 17de1b7
		type mount_t;
Chris PeBenito 17de1b7
	')
Chris PeBenito 17de1b7
Chris PeBenito 17de1b7
	allow $1 mount_t:fd use; 
Chris PeBenito 17de1b7
')
Chris PeBenito 17de1b7
Chris PeBenito 17de1b7
########################################
Chris PeBenito 17de1b7
## <summary>
Chris PeBenito 17de1b7
##	Allow the mount domain to send nfs requests for mounting
Chris PeBenito 17de1b7
##	network drives
Chris PeBenito 17de1b7
## </summary>
Chris PeBenito 17de1b7
## <desc>
Chris PeBenito 17de1b7
##	

Chris PeBenito 17de1b7
##	Allow the mount domain to send nfs requests for mounting
Chris PeBenito 17de1b7
##	network drives
Chris PeBenito 17de1b7
##	

Chris PeBenito 17de1b7
##	

Chris PeBenito 17de1b7
##	This interface has been deprecated as these rules were
Chris PeBenito 17de1b7
##	a side effect of leaked mount file descriptors.  This
Chris PeBenito 17de1b7
##	interface has no effect.
Chris PeBenito 17de1b7
##	

Chris PeBenito 17de1b7
## </desc>
Chris PeBenito 17de1b7
## <param name="domain">
Chris PeBenito 17de1b7
##	<summary>
Chris PeBenito 17de1b7
##	Domain allowed access.
Chris PeBenito 17de1b7
##	</summary>
Chris PeBenito 17de1b7
## </param>
Chris PeBenito 17de1b7
#
Chris PeBenito 17de1b7
interface(`mount_send_nfs_client_request',`
Chris PeBenito ea3c1f5
	refpolicywarn(`$0($*) has been deprecated.')
Chris PeBenito 17de1b7
')
Chris PeBenito 17de1b7
Chris PeBenito 17de1b7
########################################
Chris PeBenito 17de1b7
## <summary>
Chris PeBenito 17de1b7
##	Execute mount in the unconfined mount domain.
Chris PeBenito 17de1b7
## </summary>
Chris PeBenito 17de1b7
## <param name="domain">
Chris PeBenito 17de1b7
##	<summary>
Dominick Grift a0546c9
##	Domain allowed to transition.
Chris PeBenito 17de1b7
##	</summary>
Chris PeBenito 17de1b7
## </param>
Chris PeBenito 17de1b7
#
Chris PeBenito 17de1b7
interface(`mount_domtrans_unconfined',`
Chris PeBenito 350b6ab
	gen_require(`
Chris PeBenito 350b6ab
		type unconfined_mount_t, mount_exec_t;
Chris PeBenito 350b6ab
	')
Chris PeBenito 17de1b7
Chris PeBenito 350b6ab
	domtrans_pattern($1, mount_exec_t, unconfined_mount_t)
Chris PeBenito 350b6ab
')
Chris PeBenito 17de1b7
Chris PeBenito 350b6ab
########################################
Chris PeBenito 350b6ab
## <summary>
Chris PeBenito 350b6ab
##	Execute mount in the unconfined mount domain, and
Chris PeBenito 350b6ab
##	allow the specified role the unconfined mount domain,
Chris PeBenito 350b6ab
##	and use the caller's terminal.
Chris PeBenito 350b6ab
## </summary>
Chris PeBenito 350b6ab
## <param name="domain">
Chris PeBenito 350b6ab
##	<summary>
Dominick Grift a0546c9
##	Domain allowed to transition.
Chris PeBenito 350b6ab
##	</summary>
Chris PeBenito 350b6ab
## </param>
Chris PeBenito 350b6ab
## <param name="role">
Chris PeBenito 350b6ab
##	<summary>
Chris PeBenito a7ee7f8
##	Role allowed access.
Chris PeBenito 350b6ab
##	</summary>
Chris PeBenito 350b6ab
## </param>
Chris PeBenito 350b6ab
## <rolecap/>
Chris PeBenito 350b6ab
#
Chris PeBenito 350b6ab
interface(`mount_run_unconfined',`
Chris PeBenito 350b6ab
	gen_require(`
Chris PeBenito 350b6ab
		type unconfined_mount_t;
Chris PeBenito 17de1b7
	')
Chris PeBenito 350b6ab
Chris PeBenito 350b6ab
	mount_domtrans_unconfined($1)
Chris PeBenito 350b6ab
	role $2 types unconfined_mount_t;
3eaa993
3eaa993
	optional_policy(`
3eaa993
		rpc_run_rpcd(unconfined_mount_t, $2)
3eaa993
	')
3eaa993
3eaa993
	optional_policy(`
3eaa993
		samba_run_smbmount(unconfined_mount_t, $2)
3eaa993
	')
3eaa993
')
3eaa993
3eaa993
########################################
3eaa993
## <summary>
3eaa993
##	Execute fusermount in the mount domain.
3eaa993
## </summary>
3eaa993
## <param name="domain">
3eaa993
##	<summary>
3eaa993
##	Domain allowed access.
3eaa993
##	</summary>
3eaa993
## </param>
3eaa993
#
3eaa993
interface(`mount_domtrans_fusermount',`
3eaa993
	gen_require(`
3eaa993
		type mount_t, fusermount_exec_t;
3eaa993
	')
3eaa993
3eaa993
	domtrans_pattern($1, fusermount_exec_t, mount_t)
3eaa993
')
3eaa993
3eaa993
########################################
3eaa993
## <summary>
3eaa993
##	Execute fusermount.
3eaa993
## </summary>
3eaa993
## <param name="domain">
3eaa993
##	<summary>
3eaa993
##	Domain allowed access.
3eaa993
##	</summary>
3eaa993
## </param>
3eaa993
#
3eaa993
interface(`mount_exec_fusermount',`
3eaa993
	gen_require(`
3eaa993
		type fusermount_exec_t;
3eaa993
	')
3eaa993
3eaa993
	can_exec($1, fusermount_exec_t)
3eaa993
')
3eaa993
3eaa993
########################################
3eaa993
## <summary>
3eaa993
##	dontaudit Execute fusermount.
3eaa993
## </summary>
3eaa993
## <param name="domain">
3eaa993
##	<summary>
3eaa993
##	Domain allowed access.
3eaa993
##	</summary>
3eaa993
## </param>
3eaa993
#
3eaa993
interface(`mount_dontaudit_exec_fusermount',`
3eaa993
	gen_require(`
3eaa993
		type fusermount_exec_t;
3eaa993
	')
3eaa993
3eaa993
	dontaudit $1 fusermount_exec_t:file exec_file_perms;
3eaa993
')
3eaa993
3eaa993
######################################
3eaa993
## <summary>
3eaa993
##  Execute a domain transition to run showmount.
3eaa993
## </summary>
3eaa993
## <param name="domain">
3eaa993
## <summary>
3eaa993
##  Domain allowed to transition.
3eaa993
## </summary>
3eaa993
## </param>
3eaa993
#
3eaa993
interface(`mount_domtrans_showmount',`
3eaa993
    gen_require(`
3eaa993
        type showmount_t, showmount_exec_t;
3eaa993
    ')
3eaa993
3eaa993
    domtrans_pattern($1, showmount_exec_t, showmount_t)
3eaa993
')
3eaa993
3eaa993
######################################
3eaa993
## <summary>
3eaa993
##  Execute showmount in the showmount domain, and
3eaa993
##  allow the specified role the showmount domain.
3eaa993
## </summary>
3eaa993
## <param name="domain">
3eaa993
##  <summary>
3eaa993
##  Domain allowed access
3eaa993
##  </summary>
3eaa993
## </param>
3eaa993
## <param name="role">
3eaa993
##  <summary>
3eaa993
##  The role to be allowed the showmount domain.
3eaa993
##  </summary>
3eaa993
## </param>
3eaa993
#
3eaa993
interface(`mount_run_showmount',`
3eaa993
    gen_require(`
3eaa993
        type showmount_t;
3eaa993
    ')
3eaa993
3eaa993
    mount_domtrans_showmount($1)
3eaa993
    role $2 types showmount_t;
Chris PeBenito 17de1b7
')