|
|
889a9bf |
|
|
|
889a9bf |
## <summary>policy for openvswitch</summary>
|
|
|
889a9bf |
|
|
|
889a9bf |
########################################
|
|
|
889a9bf |
## <summary>
|
|
|
889a9bf |
## Execute TEMPLATE in the openvswitch domin.
|
|
|
889a9bf |
## </summary>
|
|
|
889a9bf |
## <param name="domain">
|
|
|
889a9bf |
## <summary>
|
|
|
889a9bf |
## Domain allowed to transition.
|
|
|
889a9bf |
## </summary>
|
|
|
889a9bf |
## </param>
|
|
|
889a9bf |
#
|
|
|
889a9bf |
interface(`openvswitch_domtrans',`
|
|
|
889a9bf |
gen_require(`
|
|
|
889a9bf |
type openvswitch_t, openvswitch_exec_t;
|
|
|
889a9bf |
')
|
|
|
889a9bf |
|
|
|
889a9bf |
corecmd_search_bin($1)
|
|
|
889a9bf |
domtrans_pattern($1, openvswitch_exec_t, openvswitch_t)
|
|
|
889a9bf |
')
|
|
|
889a9bf |
########################################
|
|
|
889a9bf |
## <summary>
|
|
|
889a9bf |
## Read openvswitch's log files.
|
|
|
889a9bf |
## </summary>
|
|
|
889a9bf |
## <param name="domain">
|
|
|
889a9bf |
## <summary>
|
|
|
889a9bf |
## Domain allowed access.
|
|
|
889a9bf |
## </summary>
|
|
|
889a9bf |
## </param>
|
|
|
889a9bf |
## <rolecap/>
|
|
|
889a9bf |
#
|
|
|
889a9bf |
interface(`openvswitch_read_log',`
|
|
|
889a9bf |
gen_require(`
|
|
|
889a9bf |
type openvswitch_log_t;
|
|
|
889a9bf |
')
|
|
|
889a9bf |
|
|
|
889a9bf |
logging_search_logs($1)
|
|
|
889a9bf |
read_files_pattern($1, openvswitch_log_t, openvswitch_log_t)
|
|
|
889a9bf |
')
|
|
|
889a9bf |
|
|
|
889a9bf |
########################################
|
|
|
889a9bf |
## <summary>
|
|
|
889a9bf |
## Append to openvswitch log files.
|
|
|
889a9bf |
## </summary>
|
|
|
889a9bf |
## <param name="domain">
|
|
|
889a9bf |
## <summary>
|
|
|
889a9bf |
## Domain allowed access.
|
|
|
889a9bf |
## </summary>
|
|
|
889a9bf |
## </param>
|
|
|
889a9bf |
#
|
|
|
889a9bf |
interface(`openvswitch_append_log',`
|
|
|
889a9bf |
gen_require(`
|
|
|
889a9bf |
type openvswitch_log_t;
|
|
|
889a9bf |
')
|
|
|
889a9bf |
|
|
|
889a9bf |
logging_search_logs($1)
|
|
|
889a9bf |
append_files_pattern($1, openvswitch_log_t, openvswitch_log_t)
|
|
|
889a9bf |
')
|
|
|
889a9bf |
|
|
|
889a9bf |
########################################
|
|
|
889a9bf |
## <summary>
|
|
|
889a9bf |
## Manage openvswitch log files
|
|
|
889a9bf |
## </summary>
|
|
|
889a9bf |
## <param name="domain">
|
|
|
889a9bf |
## <summary>
|
|
|
889a9bf |
## Domain allowed access.
|
|
|
889a9bf |
## </summary>
|
|
|
889a9bf |
## </param>
|
|
|
889a9bf |
#
|
|
|
889a9bf |
interface(`openvswitch_manage_log',`
|
|
|
889a9bf |
gen_require(`
|
|
|
889a9bf |
type openvswitch_log_t;
|
|
|
889a9bf |
')
|
|
|
889a9bf |
|
|
|
889a9bf |
logging_search_logs($1)
|
|
|
889a9bf |
manage_dirs_pattern($1, openvswitch_log_t, openvswitch_log_t)
|
|
|
889a9bf |
manage_files_pattern($1, openvswitch_log_t, openvswitch_log_t)
|
|
|
889a9bf |
manage_lnk_files_pattern($1, openvswitch_log_t, openvswitch_log_t)
|
|
|
889a9bf |
')
|
|
|
889a9bf |
|
|
|
889a9bf |
########################################
|
|
|
889a9bf |
## <summary>
|
|
|
889a9bf |
## Search openvswitch lib directories.
|
|
|
889a9bf |
## </summary>
|
|
|
889a9bf |
## <param name="domain">
|
|
|
889a9bf |
## <summary>
|
|
|
889a9bf |
## Domain allowed access.
|
|
|
889a9bf |
## </summary>
|
|
|
889a9bf |
## </param>
|
|
|
889a9bf |
#
|
|
|
889a9bf |
interface(`openvswitch_search_lib',`
|
|
|
889a9bf |
gen_require(`
|
|
|
889a9bf |
type openvswitch_var_lib_t;
|
|
|
889a9bf |
')
|
|
|
889a9bf |
|
|
|
889a9bf |
allow $1 openvswitch_var_lib_t:dir search_dir_perms;
|
|
|
889a9bf |
files_search_var_lib($1)
|
|
|
889a9bf |
')
|
|
|
889a9bf |
|
|
|
889a9bf |
########################################
|
|
|
889a9bf |
## <summary>
|
|
|
889a9bf |
## Read openvswitch lib files.
|
|
|
889a9bf |
## </summary>
|
|
|
889a9bf |
## <param name="domain">
|
|
|
889a9bf |
## <summary>
|
|
|
889a9bf |
## Domain allowed access.
|
|
|
889a9bf |
## </summary>
|
|
|
889a9bf |
## </param>
|
|
|
889a9bf |
#
|
|
|
889a9bf |
interface(`openvswitch_read_lib_files',`
|
|
|
889a9bf |
gen_require(`
|
|
|
889a9bf |
type openvswitch_var_lib_t;
|
|
|
889a9bf |
')
|
|
|
889a9bf |
|
|
|
889a9bf |
files_search_var_lib($1)
|
|
|
889a9bf |
read_files_pattern($1, openvswitch_var_lib_t, openvswitch_var_lib_t)
|
|
|
889a9bf |
')
|
|
|
889a9bf |
|
|
|
889a9bf |
########################################
|
|
|
889a9bf |
## <summary>
|
|
|
889a9bf |
## Manage openvswitch lib files.
|
|
|
889a9bf |
## </summary>
|
|
|
889a9bf |
## <param name="domain">
|
|
|
889a9bf |
## <summary>
|
|
|
889a9bf |
## Domain allowed access.
|
|
|
889a9bf |
## </summary>
|
|
|
889a9bf |
## </param>
|
|
|
889a9bf |
#
|
|
|
889a9bf |
interface(`openvswitch_manage_lib_files',`
|
|
|
889a9bf |
gen_require(`
|
|
|
889a9bf |
type openvswitch_var_lib_t;
|
|
|
889a9bf |
')
|
|
|
889a9bf |
|
|
|
889a9bf |
files_search_var_lib($1)
|
|
|
889a9bf |
manage_files_pattern($1, openvswitch_var_lib_t, openvswitch_var_lib_t)
|
|
|
889a9bf |
')
|
|
|
889a9bf |
|
|
|
889a9bf |
########################################
|
|
|
889a9bf |
## <summary>
|
|
|
889a9bf |
## Manage openvswitch lib directories.
|
|
|
889a9bf |
## </summary>
|
|
|
889a9bf |
## <param name="domain">
|
|
|
889a9bf |
## <summary>
|
|
|
889a9bf |
## Domain allowed access.
|
|
|
889a9bf |
## </summary>
|
|
|
889a9bf |
## </param>
|
|
|
889a9bf |
#
|
|
|
889a9bf |
interface(`openvswitch_manage_lib_dirs',`
|
|
|
889a9bf |
gen_require(`
|
|
|
889a9bf |
type openvswitch_var_lib_t;
|
|
|
889a9bf |
')
|
|
|
889a9bf |
|
|
|
889a9bf |
files_search_var_lib($1)
|
|
|
889a9bf |
manage_dirs_pattern($1, openvswitch_var_lib_t, openvswitch_var_lib_t)
|
|
|
889a9bf |
')
|
|
|
889a9bf |
|
|
|
889a9bf |
########################################
|
|
|
889a9bf |
## <summary>
|
|
|
889a9bf |
## Read openvswitch PID files.
|
|
|
889a9bf |
## </summary>
|
|
|
889a9bf |
## <param name="domain">
|
|
|
889a9bf |
## <summary>
|
|
|
889a9bf |
## Domain allowed access.
|
|
|
889a9bf |
## </summary>
|
|
|
889a9bf |
## </param>
|
|
|
889a9bf |
#
|
|
|
889a9bf |
interface(`openvswitch_read_pid_files',`
|
|
|
889a9bf |
gen_require(`
|
|
|
889a9bf |
type openvswitch_var_run_t;
|
|
|
889a9bf |
')
|
|
|
889a9bf |
|
|
|
889a9bf |
files_search_pids($1)
|
|
|
889a9bf |
read_files_pattern($1, openvswitch_var_run_t, openvswitch_var_run_t)
|
|
|
889a9bf |
')
|
|
|
889a9bf |
|
|
|
889a9bf |
########################################
|
|
|
889a9bf |
## <summary>
|
|
|
889a9bf |
## Execute openvswitch server in the openvswitch domain.
|
|
|
889a9bf |
## </summary>
|
|
|
889a9bf |
## <param name="domain">
|
|
|
889a9bf |
## <summary>
|
|
|
889a9bf |
## Domain allowed to transition.
|
|
|
889a9bf |
## </summary>
|
|
|
889a9bf |
## </param>
|
|
|
889a9bf |
#
|
|
|
889a9bf |
interface(`openvswitch_systemctl',`
|
|
|
889a9bf |
gen_require(`
|
|
|
889a9bf |
type openvswitch_t;
|
|
|
889a9bf |
type openvswitch_unit_file_t;
|
|
|
889a9bf |
')
|
|
|
889a9bf |
|
|
|
889a9bf |
systemd_exec_systemctl($1)
|
|
|
889a9bf |
systemd_read_fifo_file_password_run($1)
|
|
|
889a9bf |
allow $1 openvswitch_unit_file_t:file read_file_perms;
|
|
|
889a9bf |
allow $1 openvswitch_unit_file_t:service manage_service_perms;
|
|
|
889a9bf |
|
|
|
889a9bf |
ps_process_pattern($1, openvswitch_t)
|
|
|
889a9bf |
')
|
|
|
889a9bf |
|
|
|
889a9bf |
|
|
|
889a9bf |
########################################
|
|
|
889a9bf |
## <summary>
|
|
|
889a9bf |
## All of the rules required to administrate
|
|
|
889a9bf |
## an openvswitch environment
|
|
|
889a9bf |
## </summary>
|
|
|
889a9bf |
## <param name="domain">
|
|
|
889a9bf |
## <summary>
|
|
|
889a9bf |
## Domain allowed access.
|
|
|
889a9bf |
## </summary>
|
|
|
889a9bf |
## </param>
|
|
|
889a9bf |
## <rolecap/>
|
|
|
889a9bf |
#
|
|
|
889a9bf |
interface(`openvswitch_admin',`
|
|
|
889a9bf |
gen_require(`
|
|
|
889a9bf |
type openvswitch_t, openvswitch_log_t, openvswitch_var_lib_t;
|
|
|
889a9bf |
type openvswitch_rw_t, openvswitch_var_run_t, openvswitch_unit_file_t;
|
|
|
889a9bf |
')
|
|
|
889a9bf |
|
|
|
889a9bf |
allow $1 openvswitch_t:process { ptrace signal_perms };
|
|
|
889a9bf |
ps_process_pattern($1, openvswitch_t)
|
|
|
889a9bf |
|
|
|
889a9bf |
logging_search_logs($1)
|
|
|
889a9bf |
admin_pattern($1, openvswitch_rw_t)
|
|
|
889a9bf |
|
|
|
889a9bf |
logging_search_logs($1)
|
|
|
889a9bf |
admin_pattern($1, openvswitch_log_t)
|
|
|
889a9bf |
|
|
|
889a9bf |
files_search_var_lib($1)
|
|
|
889a9bf |
admin_pattern($1, openvswitch_var_lib_t)
|
|
|
889a9bf |
|
|
|
889a9bf |
files_search_pids($1)
|
|
|
889a9bf |
admin_pattern($1, openvswitch_var_run_t)
|
|
|
889a9bf |
|
|
|
889a9bf |
openvswitch_systemctl($1)
|
|
|
889a9bf |
admin_pattern($1, openvswitch_unit_file_t)
|
|
|
889a9bf |
allow $1 openvswitch_unit_file_t:service all_service_perms;
|
|
|
889a9bf |
optional_policy(`
|
|
|
889a9bf |
systemd_passwd_agent_exec($1)
|
|
|
889a9bf |
systemd_read_fifo_file_passwd_run($1)
|
|
|
889a9bf |
')
|
|
|
889a9bf |
')
|