selinux-refpolicy/policy/modules/system/lvm.if

225 lines
4.2 KiB
Plaintext
Raw Normal View History

## <summary>Policy for logical volume management programs.</summary>
2005-05-13 14:36:35 +00:00
########################################
2005-08-11 17:46:39 +00:00
## <summary>
2005-06-23 21:30:57 +00:00
## Execute lvm programs in the lvm domain.
2005-08-11 17:46:39 +00:00
## </summary>
2005-06-23 21:30:57 +00:00
## <param name="domain">
## <summary>
## Domain allowed to transition.
## </summary>
2005-06-23 21:30:57 +00:00
## </param>
2005-05-13 14:36:35 +00:00
#
interface(`lvm_domtrans',`
2005-06-17 17:59:26 +00:00
gen_require(`
type lvm_t, lvm_exec_t;
')
2007-03-23 23:24:59 +00:00
corecmd_search_bin($1)
2006-12-12 20:08:08 +00:00
domtrans_pattern($1, lvm_exec_t, lvm_t)
2005-05-13 14:36:35 +00:00
')
2009-11-24 14:19:45 +00:00
########################################
## <summary>
2009-11-24 16:11:38 +00:00
## Execute lvm programs in the caller domain.
2009-11-24 14:19:45 +00:00
## </summary>
## <param name="domain">
2009-11-24 16:11:38 +00:00
## <summary>
## Domain allowed access.
2009-11-24 16:11:38 +00:00
## </summary>
2009-11-24 14:19:45 +00:00
## </param>
#
interface(`lvm_exec',`
2009-11-24 16:11:38 +00:00
gen_require(`
type lvm_exec_t;
')
2009-11-24 14:19:45 +00:00
corecmd_search_bin($1)
2009-11-24 16:11:38 +00:00
can_exec($1, lvm_exec_t)
2009-11-24 14:19:45 +00:00
')
2009-11-24 16:11:38 +00:00
########################################
2005-08-11 17:46:39 +00:00
## <summary>
2005-06-23 21:30:57 +00:00
## Execute lvm programs in the lvm domain.
2005-08-11 17:46:39 +00:00
## </summary>
2005-06-23 21:30:57 +00:00
## <param name="domain">
## <summary>
## Domain allowed to transition.
## </summary>
2005-06-23 21:30:57 +00:00
## </param>
## <param name="role">
## <summary>
2005-06-23 21:30:57 +00:00
## The role to allow the LVM domain.
## </summary>
2005-06-23 21:30:57 +00:00
## </param>
2006-09-06 22:07:25 +00:00
## <rolecap/>
2005-05-13 14:36:35 +00:00
#
interface(`lvm_run',`
2005-06-17 17:59:26 +00:00
gen_require(`
type lvm_t;
')
2005-06-13 17:35:46 +00:00
lvm_domtrans($1)
role $2 types lvm_t;
')
########################################
## <summary>
## Send lvm a null signal.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`lvm_signull',`
gen_require(`
type lvm_t;
')
allow $1 lvm_t:process signull;
')
########################################
2005-08-11 17:46:39 +00:00
## <summary>
2005-06-23 21:30:57 +00:00
## Read LVM configuration files.
2005-08-11 17:46:39 +00:00
## </summary>
2005-06-23 21:30:57 +00:00
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
2005-06-23 21:30:57 +00:00
## </param>
2006-09-06 22:07:25 +00:00
## <rolecap/>
2005-05-13 14:36:35 +00:00
#
interface(`lvm_read_config',`
2005-06-17 17:59:26 +00:00
gen_require(`
type lvm_etc_t;
2005-06-17 17:59:26 +00:00
')
2005-06-17 17:59:26 +00:00
files_search_etc($1)
2006-12-12 20:08:08 +00:00
allow $1 lvm_etc_t:dir list_dir_perms;
2009-05-06 14:44:57 +00:00
read_files_pattern($1, lvm_etc_t, lvm_etc_t)
2005-05-13 14:36:35 +00:00
')
########################################
## <summary>
## Manage LVM configuration files.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
## <rolecap/>
#
interface(`lvm_manage_config',`
gen_require(`
type lvm_etc_t;
')
files_search_etc($1)
2009-05-06 14:44:57 +00:00
manage_dirs_pattern($1, lvm_etc_t, lvm_etc_t)
manage_files_pattern($1, lvm_etc_t, lvm_etc_t)
')
2009-11-24 14:19:45 +00:00
########################################
## <summary>
## Create lvm_lock_t directories
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
## <rolecap/>
#
interface(`lvm_create_lock_dirs',`
gen_require(`
type lvm_lock_t;
')
create_dirs_pattern($1, lvm_lock_t, lvm_lock_t)
files_add_entry_lock_dirs($1)
')
2017-02-24 01:03:23 +00:00
########################################
## <summary>
## Read and write a lvm unnamed pipe.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`lvm_rw_inherited_pid_pipes',`
gen_require(`
type lvm_var_run_t;
')
allow $1 lvm_var_run_t:fifo_file rw_inherited_fifo_file_perms;
')
2009-11-24 14:19:45 +00:00
######################################
## <summary>
2009-11-24 16:11:38 +00:00
## Execute a domain transition to run clvmd.
2009-11-24 14:19:45 +00:00
## </summary>
## <param name="domain">
## <summary>
2009-11-24 16:11:38 +00:00
## Domain allowed to transition.
2009-11-24 14:19:45 +00:00
## </summary>
## </param>
#
interface(`lvm_domtrans_clvmd',`
2009-11-24 16:11:38 +00:00
gen_require(`
type clvmd_t, clvmd_exec_t;
')
2009-11-24 14:19:45 +00:00
2009-11-24 16:11:38 +00:00
corecmd_search_bin($1)
domtrans_pattern($1, clvmd_exec_t, clvmd_t)
2009-11-24 14:19:45 +00:00
')
2015-07-11 09:15:44 +00:00
######################################
## <summary>
## All of the rules required to
## administrate an lvm environment.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
## <param name="role">
## <summary>
## Role allowed access.
## </summary>
## </param>
#
interface(`lvm_admin',`
gen_require(`
type clvmd_t, clvmd_initrc_exec_t, lvm_t, lvm_unit_t;
2015-07-11 09:15:44 +00:00
type lvm_etc_t, lvm_lock_t, lvm_metadata_t;
type lvm_var_lib_t, lvm_var_run_t, clvmd_var_run_t, lvm_tmp_t;
')
admin_process_pattern($1, { clvmd_t lvm_t })
2015-07-11 09:15:44 +00:00
init_startstop_service($1, $2, clvmd_t, clvmd_initrc_exec_t, lvm_unit_t)
2015-07-11 09:15:44 +00:00
files_search_etc($1)
admin_pattern($1, { lvm_etc_t lvm_metadata_t })
2015-07-11 09:15:44 +00:00
files_search_locks($1)
admin_pattern($1, lvm_lock_t)
files_search_var_lib($1)
admin_pattern($1, lvm_var_lib_t)
files_search_pids($1)
admin_pattern($1, { lvm_var_run_t clvmd_var_run_t })
files_search_tmp($1)
admin_pattern($1, lvm_tmp_t)
')