Introduce lvm_admin interface

This commit is contained in:
Jason Zaman 2015-07-11 13:15:44 +04:00 committed by Chris PeBenito
parent 11697e1a69
commit 8bee8e80af
2 changed files with 45 additions and 0 deletions

View File

@ -578,6 +578,7 @@ optional_policy(`
')
optional_policy(`
lvm_admin(sysadm_t, sysadm_r)
lvm_run(sysadm_t, sysadm_r)
')

View File

@ -123,3 +123,47 @@ interface(`lvm_domtrans_clvmd',`
corecmd_search_bin($1)
domtrans_pattern($1, clvmd_exec_t, clvmd_t)
')
######################################
## <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_exec_t, clvmd_initrc_exec_t;
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;
')
allow $1 clvmd_t:process { ptrace signal_perms };
ps_process_pattern($1, clvmd_t)
init_startstop_service($1, $2, clvmd_t, clvmd_initrc_exec_t)
files_search_etc($1)
admin_pattern($1, lvm_etc_t)
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)
')