|
Chris PeBenito |
17de1b |
## <summary>Policy for mount.</summary>
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## Execute mount in the mount domain.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## <param name="domain">
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Dominick Grift |
a0546c |
## Domain allowed to transition.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## </param>
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
interface(`mount_domtrans',`
|
|
Chris PeBenito |
17de1b |
gen_require(`
|
|
Chris PeBenito |
17de1b |
type mount_t, mount_exec_t;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
3f67f7 |
domtrans_pattern($1, mount_exec_t, mount_t)
|
|
Dan Walsh |
3eaa99 |
mount_domtrans_fusermount($1)
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
ifdef(`hide_broken_symptoms', `
|
|
Dan Walsh |
3eaa99 |
dontaudit mount_t $1:unix_stream_socket { read write };
|
|
Dan Walsh |
3eaa99 |
dontaudit mount_t $1:tcp_socket { read write };
|
|
Dan Walsh |
3eaa99 |
dontaudit mount_t $1:udp_socket { read write };
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## Execute mount in the mount domain, and
|
|
Chris PeBenito |
17de1b |
## allow the specified role the mount domain,
|
|
Chris PeBenito |
17de1b |
## and use the caller's terminal.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## <param name="domain">
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Dominick Grift |
a0546c |
## Domain allowed to transition.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## </param>
|
|
Chris PeBenito |
17de1b |
## <param name="role">
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
a7ee7f |
## Role allowed access.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## </param>
|
|
Chris PeBenito |
bbcd3c |
## <rolecap/>
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
interface(`mount_run',`
|
|
Chris PeBenito |
17de1b |
gen_require(`
|
|
Chris PeBenito |
17de1b |
type mount_t;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
mount_domtrans($1)
|
|
Chris PeBenito |
17de1b |
role $2 types mount_t;
|
|
Chris PeBenito |
350b6a |
|
|
Chris PeBenito |
350b6a |
optional_policy(`
|
|
Dan Walsh |
3eaa99 |
fstools_run(mount_t, $2)
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
# Needed for mount crypt https://bugzilla.redhat.com/show_bug.cgi?id=418711
|
|
Dan Walsh |
3eaa99 |
optional_policy(`
|
|
Dan Walsh |
3eaa99 |
lvm_run(mount_t, $2)
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
optional_policy(`
|
|
Dan Walsh |
3eaa99 |
modutils_run_insmod(mount_t, $2)
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
optional_policy(`
|
|
Dan Walsh |
3eaa99 |
rpc_run_rpcd(mount_t, $2)
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
optional_policy(`
|
|
Dan Walsh |
3eaa99 |
samba_run_smbmount(mount_t, $2)
|
|
Chris PeBenito |
350b6a |
')
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Dan Walsh |
3eaa99 |
## Execute fusermount in the mount domain, and
|
|
Dan Walsh |
3eaa99 |
## allow the specified role the mount domain,
|
|
Dan Walsh |
3eaa99 |
## and use the caller's terminal.
|
|
Dan Walsh |
3eaa99 |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## <param name="domain">
|
|
Dan Walsh |
3eaa99 |
## <summary>
|
|
Dan Walsh |
3eaa99 |
## Domain allowed access.
|
|
Dan Walsh |
3eaa99 |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## </param>
|
|
Dan Walsh |
3eaa99 |
## <param name="role">
|
|
Dan Walsh |
3eaa99 |
## <summary>
|
|
Dan Walsh |
3eaa99 |
## The role to be allowed the mount domain.
|
|
Dan Walsh |
3eaa99 |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## </param>
|
|
Dan Walsh |
3eaa99 |
## <rolecap/>
|
|
Dan Walsh |
3eaa99 |
#
|
|
Dan Walsh |
3eaa99 |
interface(`mount_run_fusermount',`
|
|
Dan Walsh |
3eaa99 |
gen_require(`
|
|
Dan Walsh |
3eaa99 |
type mount_t;
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
mount_domtrans_fusermount($1)
|
|
Dan Walsh |
3eaa99 |
role $2 types mount_t;
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
fstools_run(mount_t, $2)
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
########################################
|
|
Dan Walsh |
3eaa99 |
## <summary>
|
|
Chris PeBenito |
17de1b |
## Execute mount in the caller domain.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## <param name="domain">
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Dominick Grift |
a0546c |
## Domain allowed access.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## </param>
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
interface(`mount_exec',`
|
|
Chris PeBenito |
17de1b |
gen_require(`
|
|
Chris PeBenito |
17de1b |
type mount_exec_t;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
c0868a |
# cjp: this should be removed:
|
|
Chris PeBenito |
c0868a |
allow $1 mount_exec_t:dir list_dir_perms;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
c0868a |
allow $1 mount_exec_t:lnk_file read_lnk_file_perms;
|
|
Chris PeBenito |
3f67f7 |
can_exec($1, mount_exec_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
333222 |
## Send a generic signal to mount.
|
|
Chris PeBenito |
333222 |
## </summary>
|
|
Chris PeBenito |
333222 |
## <param name="domain">
|
|
Chris PeBenito |
333222 |
## <summary>
|
|
Chris PeBenito |
333222 |
## Domain allowed access.
|
|
Chris PeBenito |
333222 |
## </summary>
|
|
Chris PeBenito |
333222 |
## </param>
|
|
Chris PeBenito |
333222 |
#
|
|
Chris PeBenito |
333222 |
interface(`mount_signal',`
|
|
Chris PeBenito |
333222 |
gen_require(`
|
|
Chris PeBenito |
333222 |
type mount_t;
|
|
Dan Walsh |
3eaa99 |
type unconfined_mount_t;
|
|
Chris PeBenito |
333222 |
')
|
|
Chris PeBenito |
333222 |
|
|
Chris PeBenito |
333222 |
allow $1 mount_t:process signal;
|
|
Dan Walsh |
3eaa99 |
allow $1 unconfined_mount_t:process signal;
|
|
Chris PeBenito |
333222 |
')
|
|
Chris PeBenito |
333222 |
|
|
Chris PeBenito |
333222 |
########################################
|
|
Chris PeBenito |
333222 |
## <summary>
|
|
Chris PeBenito |
17de1b |
## Use file descriptors for mount.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## <param name="domain">
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Dan Walsh |
3eaa99 |
## Domain allowed access.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## </param>
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
interface(`mount_use_fds',`
|
|
Chris PeBenito |
17de1b |
gen_require(`
|
|
Chris PeBenito |
17de1b |
type mount_t;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
allow $1 mount_t:fd use;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## Allow the mount domain to send nfs requests for mounting
|
|
Chris PeBenito |
17de1b |
## network drives
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## <desc>
|
|
Chris PeBenito |
17de1b |
##
|
|
Chris PeBenito |
17de1b |
## Allow the mount domain to send nfs requests for mounting
|
|
Chris PeBenito |
17de1b |
## network drives
|
|
Chris PeBenito |
17de1b |
##
|
|
Chris PeBenito |
17de1b |
##
|
|
Chris PeBenito |
17de1b |
## This interface has been deprecated as these rules were
|
|
Chris PeBenito |
17de1b |
## a side effect of leaked mount file descriptors. This
|
|
Chris PeBenito |
17de1b |
## interface has no effect.
|
|
Chris PeBenito |
17de1b |
##
|
|
Chris PeBenito |
17de1b |
## </desc>
|
|
Chris PeBenito |
17de1b |
## <param name="domain">
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## Domain allowed access.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## </param>
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
interface(`mount_send_nfs_client_request',`
|
|
Chris PeBenito |
ea3c1f |
refpolicywarn(`$0($*) has been deprecated.')
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## Execute mount in the unconfined mount domain.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## <param name="domain">
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Dominick Grift |
a0546c |
## Domain allowed to transition.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## </param>
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
interface(`mount_domtrans_unconfined',`
|
|
Chris PeBenito |
350b6a |
gen_require(`
|
|
Chris PeBenito |
350b6a |
type unconfined_mount_t, mount_exec_t;
|
|
Chris PeBenito |
350b6a |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
350b6a |
domtrans_pattern($1, mount_exec_t, unconfined_mount_t)
|
|
Chris PeBenito |
350b6a |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
350b6a |
########################################
|
|
Chris PeBenito |
350b6a |
## <summary>
|
|
Chris PeBenito |
350b6a |
## Execute mount in the unconfined mount domain, and
|
|
Chris PeBenito |
350b6a |
## allow the specified role the unconfined mount domain,
|
|
Chris PeBenito |
350b6a |
## and use the caller's terminal.
|
|
Chris PeBenito |
350b6a |
## </summary>
|
|
Chris PeBenito |
350b6a |
## <param name="domain">
|
|
Chris PeBenito |
350b6a |
## <summary>
|
|
Dominick Grift |
a0546c |
## Domain allowed to transition.
|
|
Chris PeBenito |
350b6a |
## </summary>
|
|
Chris PeBenito |
350b6a |
## </param>
|
|
Chris PeBenito |
350b6a |
## <param name="role">
|
|
Chris PeBenito |
350b6a |
## <summary>
|
|
Chris PeBenito |
a7ee7f |
## Role allowed access.
|
|
Chris PeBenito |
350b6a |
## </summary>
|
|
Chris PeBenito |
350b6a |
## </param>
|
|
Chris PeBenito |
350b6a |
## <rolecap/>
|
|
Chris PeBenito |
350b6a |
#
|
|
Chris PeBenito |
350b6a |
interface(`mount_run_unconfined',`
|
|
Chris PeBenito |
350b6a |
gen_require(`
|
|
Chris PeBenito |
350b6a |
type unconfined_mount_t;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
350b6a |
|
|
Chris PeBenito |
350b6a |
mount_domtrans_unconfined($1)
|
|
Chris PeBenito |
350b6a |
role $2 types unconfined_mount_t;
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
optional_policy(`
|
|
Dan Walsh |
3eaa99 |
rpc_run_rpcd(unconfined_mount_t, $2)
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
optional_policy(`
|
|
Dan Walsh |
3eaa99 |
samba_run_smbmount(unconfined_mount_t, $2)
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
########################################
|
|
Dan Walsh |
3eaa99 |
## <summary>
|
|
Dan Walsh |
3eaa99 |
## Execute fusermount in the mount domain.
|
|
Dan Walsh |
3eaa99 |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## <param name="domain">
|
|
Dan Walsh |
3eaa99 |
## <summary>
|
|
Dan Walsh |
3eaa99 |
## Domain allowed access.
|
|
Dan Walsh |
3eaa99 |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## </param>
|
|
Dan Walsh |
3eaa99 |
#
|
|
Dan Walsh |
3eaa99 |
interface(`mount_domtrans_fusermount',`
|
|
Dan Walsh |
3eaa99 |
gen_require(`
|
|
Dan Walsh |
3eaa99 |
type mount_t, fusermount_exec_t;
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
domtrans_pattern($1, fusermount_exec_t, mount_t)
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
########################################
|
|
Dan Walsh |
3eaa99 |
## <summary>
|
|
Dan Walsh |
3eaa99 |
## Execute fusermount.
|
|
Dan Walsh |
3eaa99 |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## <param name="domain">
|
|
Dan Walsh |
3eaa99 |
## <summary>
|
|
Dan Walsh |
3eaa99 |
## Domain allowed access.
|
|
Dan Walsh |
3eaa99 |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## </param>
|
|
Dan Walsh |
3eaa99 |
#
|
|
Dan Walsh |
3eaa99 |
interface(`mount_exec_fusermount',`
|
|
Dan Walsh |
3eaa99 |
gen_require(`
|
|
Dan Walsh |
3eaa99 |
type fusermount_exec_t;
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
can_exec($1, fusermount_exec_t)
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
########################################
|
|
Dan Walsh |
3eaa99 |
## <summary>
|
|
Dan Walsh |
3eaa99 |
## dontaudit Execute fusermount.
|
|
Dan Walsh |
3eaa99 |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## <param name="domain">
|
|
Dan Walsh |
3eaa99 |
## <summary>
|
|
Dan Walsh |
3eaa99 |
## Domain allowed access.
|
|
Dan Walsh |
3eaa99 |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## </param>
|
|
Dan Walsh |
3eaa99 |
#
|
|
Dan Walsh |
3eaa99 |
interface(`mount_dontaudit_exec_fusermount',`
|
|
Dan Walsh |
3eaa99 |
gen_require(`
|
|
Dan Walsh |
3eaa99 |
type fusermount_exec_t;
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
dontaudit $1 fusermount_exec_t:file exec_file_perms;
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
######################################
|
|
Dan Walsh |
3eaa99 |
## <summary>
|
|
Dan Walsh |
3eaa99 |
## Execute a domain transition to run showmount.
|
|
Dan Walsh |
3eaa99 |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## <param name="domain">
|
|
Dan Walsh |
3eaa99 |
## <summary>
|
|
Dan Walsh |
3eaa99 |
## Domain allowed to transition.
|
|
Dan Walsh |
3eaa99 |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## </param>
|
|
Dan Walsh |
3eaa99 |
#
|
|
Dan Walsh |
3eaa99 |
interface(`mount_domtrans_showmount',`
|
|
Dan Walsh |
3eaa99 |
gen_require(`
|
|
Dan Walsh |
3eaa99 |
type showmount_t, showmount_exec_t;
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
domtrans_pattern($1, showmount_exec_t, showmount_t)
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
######################################
|
|
Dan Walsh |
3eaa99 |
## <summary>
|
|
Dan Walsh |
3eaa99 |
## Execute showmount in the showmount domain, and
|
|
Dan Walsh |
3eaa99 |
## allow the specified role the showmount domain.
|
|
Dan Walsh |
3eaa99 |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## <param name="domain">
|
|
Dan Walsh |
3eaa99 |
## <summary>
|
|
Dan Walsh |
3eaa99 |
## Domain allowed access
|
|
Dan Walsh |
3eaa99 |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## </param>
|
|
Dan Walsh |
3eaa99 |
## <param name="role">
|
|
Dan Walsh |
3eaa99 |
## <summary>
|
|
Dan Walsh |
3eaa99 |
## The role to be allowed the showmount domain.
|
|
Dan Walsh |
3eaa99 |
## </summary>
|
|
Dan Walsh |
3eaa99 |
## </param>
|
|
Dan Walsh |
3eaa99 |
#
|
|
Dan Walsh |
3eaa99 |
interface(`mount_run_showmount',`
|
|
Dan Walsh |
3eaa99 |
gen_require(`
|
|
Dan Walsh |
3eaa99 |
type showmount_t;
|
|
Dan Walsh |
3eaa99 |
')
|
|
Dan Walsh |
3eaa99 |
|
|
Dan Walsh |
3eaa99 |
mount_domtrans_showmount($1)
|
|
Dan Walsh |
3eaa99 |
role $2 types showmount_t;
|
|
Chris PeBenito |
17de1b |
')
|