diff options
Diffstat (limited to 'policy/modules/services/openvswitch.if')
-rw-r--r-- | policy/modules/services/openvswitch.if | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/policy/modules/services/openvswitch.if b/policy/modules/services/openvswitch.if new file mode 100644 index 000000000..f0133ed3f --- /dev/null +++ b/policy/modules/services/openvswitch.if @@ -0,0 +1,80 @@ +## <summary>Multilayer virtual switch.</summary> + +######################################## +## <summary> +## Execute openvswitch in the openvswitch domain. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed to transition. +## </summary> +## </param> +# +interface(`openvswitch_domtrans',` + gen_require(` + type openvswitch_t, openvswitch_exec_t; + ') + + corecmd_search_bin($1) + domtrans_pattern($1, openvswitch_exec_t, openvswitch_t) +') + +######################################## +## <summary> +## Read openvswitch pid files. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`openvswitch_read_pid_files',` + gen_require(` + type openvswitch_var_run_t; + ') + + files_search_pids($1) + read_files_pattern($1, openvswitch_var_run_t, openvswitch_var_run_t) +') + +######################################## +## <summary> +## All of the rules required to +## administrate an openvswitch environment. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +## <param name="role"> +## <summary> +## Role allowed access. +## </summary> +## </param> +## <rolecap/> +# +interface(`openvswitch_admin',` + gen_require(` + type openvswitch_t, openvswitch_initrc_exec_t, openvswitch_conf_t; + type openvswitch_var_lib_t, openvswitch_log_t, openvswitch_var_run_t; + ') + + allow $1 openvswitch_t:process { ptrace signal_perms }; + ps_process_pattern($1, openvswitch_t) + + init_startstop_service($1, $2, openvswitch_t, openvswitch_initrc_exec_t) + + files_search_etc($1) + admin_pattern($1, openvswitch_conf_t) + + files_search_var_lib($1) + admin_pattern($1, openvswitch_var_lib_t) + + logging_search_logs($1) + admin_pattern($1, openvswitch_log_t) + + files_search_pids($1) + admin_pattern($1, openvswitch_var_run_t) +') |