|
|
1ec3d1a |
|
|
|
1ec3d1a |
## <summary>policy for sanlock</summary>
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
########################################
|
|
|
1ec3d1a |
## <summary>
|
|
|
1ec3d1a |
## Execute a domain transition to run sanlock.
|
|
|
1ec3d1a |
## </summary>
|
|
|
1ec3d1a |
## <param name="domain">
|
|
|
1ec3d1a |
## <summary>
|
|
|
1ec3d1a |
## Domain allowed access.
|
|
|
1ec3d1a |
## </summary>
|
|
|
1ec3d1a |
## </param>
|
|
|
1ec3d1a |
#
|
|
|
1ec3d1a |
interface(`sanlock_domtrans',`
|
|
|
1ec3d1a |
gen_require(`
|
|
|
1ec3d1a |
type sanlock_t, sanlock_exec_t;
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
domtrans_pattern($1, sanlock_exec_t, sanlock_t)
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
########################################
|
|
|
1ec3d1a |
## <summary>
|
|
|
1ec3d1a |
## Execute sanlock server in the sanlock domain.
|
|
|
1ec3d1a |
## </summary>
|
|
|
1ec3d1a |
## <param name="domain">
|
|
|
1ec3d1a |
## <summary>
|
|
|
1ec3d1a |
## The type of the process performing this action.
|
|
|
1ec3d1a |
## </summary>
|
|
|
1ec3d1a |
## </param>
|
|
|
1ec3d1a |
#
|
|
|
1ec3d1a |
interface(`sanlock_initrc_domtrans',`
|
|
|
1ec3d1a |
gen_require(`
|
|
|
1ec3d1a |
type sanlock_initrc_exec_t;
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
init_labeled_script_domtrans($1, sanlock_initrc_exec_t)
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
######################################
|
|
|
1ec3d1a |
## <summary>
|
|
|
1ec3d1a |
## Create, read, write, and delete sanlock PID files.
|
|
|
1ec3d1a |
## </summary>
|
|
|
1ec3d1a |
## <param name="domain">
|
|
|
1ec3d1a |
## <summary>
|
|
|
1ec3d1a |
## Domain allowed access.
|
|
|
1ec3d1a |
## </summary>
|
|
|
1ec3d1a |
## </param>
|
|
|
1ec3d1a |
#
|
|
|
1ec3d1a |
interface(`sanlock_manage_pid_files',`
|
|
|
1ec3d1a |
gen_require(`
|
|
|
1ec3d1a |
type sanlock_var_run_t;
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
files_search_pids($1)
|
|
|
1ec3d1a |
manage_files_pattern($1, sanlock_var_run_t, sanlock_var_run_t)
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
########################################
|
|
|
1ec3d1a |
## <summary>
|
|
|
1ec3d1a |
## Connect to sanlock over a unix stream socket.
|
|
|
1ec3d1a |
## </summary>
|
|
|
1ec3d1a |
## <param name="domain">
|
|
|
1ec3d1a |
## <summary>
|
|
|
1ec3d1a |
## Domain allowed access.
|
|
|
1ec3d1a |
## </summary>
|
|
|
1ec3d1a |
## </param>
|
|
|
1ec3d1a |
#
|
|
|
1ec3d1a |
interface(`sanlock_stream_connect',`
|
|
|
1ec3d1a |
gen_require(`
|
|
|
1ec3d1a |
type sanlock_t, sanlock_var_run_t;
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
files_search_pids($1)
|
|
|
1ec3d1a |
stream_connect_pattern($1, sanlock_var_run_t, sanlock_var_run_t, sanlock_t)
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
########################################
|
|
|
1ec3d1a |
## <summary>
|
|
|
e491048 |
## Execute virt server in the virt domain.
|
|
|
e491048 |
## </summary>
|
|
|
e491048 |
## <param name="domain">
|
|
|
e491048 |
## <summary>
|
|
|
e491048 |
## Domain allowed to transition.
|
|
|
e491048 |
## </summary>
|
|
|
e491048 |
## </param>
|
|
|
e491048 |
#
|
|
|
c759ff5 |
interface(`sanlock_systemctl',`
|
|
|
e491048 |
gen_require(`
|
|
|
e491048 |
type sanlock_unit_file_t;
|
|
|
e491048 |
type sanlock_t;
|
|
|
e491048 |
')
|
|
|
e491048 |
|
|
|
e491048 |
systemd_exec_systemctl($1)
|
|
|
e491048 |
allow $1 sanlock_unit_file_t:file read_file_perms;
|
|
|
e491048 |
allow $1 sanlock_unit_file_t:service manage_service_perms;
|
|
|
e491048 |
|
|
|
e491048 |
ps_process_pattern($1, sanlock_t)
|
|
|
e491048 |
')
|
|
|
e491048 |
|
|
|
e491048 |
########################################
|
|
|
e491048 |
## <summary>
|
|
|
1ec3d1a |
## All of the rules required to administrate
|
|
|
1ec3d1a |
## an sanlock environment
|
|
|
1ec3d1a |
## </summary>
|
|
|
1ec3d1a |
## <param name="domain">
|
|
|
1ec3d1a |
## <summary>
|
|
|
1ec3d1a |
## Domain allowed access.
|
|
|
1ec3d1a |
## </summary>
|
|
|
1ec3d1a |
## </param>
|
|
|
1ec3d1a |
## <param name="role">
|
|
|
1ec3d1a |
## <summary>
|
|
|
1ec3d1a |
## Role allowed access.
|
|
|
1ec3d1a |
## </summary>
|
|
|
1ec3d1a |
## </param>
|
|
|
1ec3d1a |
## <rolecap/>
|
|
|
1ec3d1a |
#
|
|
|
1ec3d1a |
interface(`sanlock_admin',`
|
|
|
1ec3d1a |
gen_require(`
|
|
|
1ec3d1a |
type sanlock_t;
|
|
|
1ec3d1a |
type sanlock_initrc_exec_t;
|
|
|
e491048 |
type sanlock_unit_file_t;
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
allow $1 sanlock_t:process signal_perms;
|
|
|
1ec3d1a |
ps_process_pattern($1, sanlock_t)
|
|
|
1ec3d1a |
tunable_policy(`deny_ptrace',`',`
|
|
|
1ec3d1a |
allow $1 sanlock_t:process ptrace;
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
sanlock_initrc_domtrans($1)
|
|
|
1ec3d1a |
domain_system_change_exemption($1)
|
|
|
1ec3d1a |
role_transition $2 sanlock_initrc_exec_t system_r;
|
|
|
1ec3d1a |
allow $2 system_r;
|
|
|
1ec3d1a |
|
|
|
e491048 |
virt_systemctl($1)
|
|
|
e491048 |
admin_pattern($1, sanlock_unit_file_t)
|
|
|
e491048 |
allow $1 sanlock_unit_file_t:service all_service_perms;
|
|
|
1ec3d1a |
')
|