## Virtual network service for Openstack.
########################################
##
## Transition to neutron.
##
##
##
## Domain allowed to transition.
##
##
#
interface(`neutron_domtrans',`
gen_require(`
type neutron_t, neutron_exec_t;
')
corecmd_search_bin($1)
domtrans_pattern($1, neutron_exec_t, neutron_t)
')
########################################
##
## Allow read/write neutron pipes
##
##
##
## Domain allowed access.
##
##
#
interface(`neutron_rw_inherited_pipes',`
gen_require(`
type neutron_t;
')
allow $1 neutron_t:fifo_file rw_inherited_fifo_file_perms;
')
########################################
##
## Send sigchld to neutron.
##
##
##
## Domain allowed access.
##
##
#
#
interface(`neutron_sigchld',`
gen_require(`
type neutron_t;
')
allow $1 neutron_t:process sigchld;
')
########################################
##
## Read neutron's log files.
##
##
##
## Domain allowed access.
##
##
##
#
interface(`neutron_read_log',`
gen_require(`
type neutron_log_t;
')
logging_search_logs($1)
read_files_pattern($1, neutron_log_t, neutron_log_t)
')
########################################
##
## Append to neutron log files.
##
##
##
## Domain allowed access.
##
##
#
interface(`neutron_append_log',`
gen_require(`
type neutron_log_t;
')
logging_search_logs($1)
append_files_pattern($1, neutron_log_t, neutron_log_t)
')
########################################
##
## Manage neutron log files
##
##
##
## Domain allowed access.
##
##
#
interface(`neutron_manage_log',`
gen_require(`
type neutron_log_t;
')
logging_search_logs($1)
manage_dirs_pattern($1, neutron_log_t, neutron_log_t)
manage_files_pattern($1, neutron_log_t, neutron_log_t)
manage_lnk_files_pattern($1, neutron_log_t, neutron_log_t)
')
########################################
##
## Search neutron lib directories.
##
##
##
## Domain allowed access.
##
##
#
interface(`neutron_search_lib',`
gen_require(`
type neutron_var_lib_t;
')
allow $1 neutron_var_lib_t:dir search_dir_perms;
files_search_var_lib($1)
')
########################################
##
## Read neutron lib files.
##
##
##
## Domain allowed access.
##
##
#
interface(`neutron_read_lib_files',`
gen_require(`
type neutron_var_lib_t;
')
files_search_var_lib($1)
read_files_pattern($1, neutron_var_lib_t, neutron_var_lib_t)
')
########################################
##
## Manage neutron lib files.
##
##
##
## Domain allowed access.
##
##
#
interface(`neutron_manage_lib_files',`
gen_require(`
type neutron_var_lib_t;
')
files_search_var_lib($1)
manage_files_pattern($1, neutron_var_lib_t, neutron_var_lib_t)
manage_sock_files_pattern($1, neutron_var_lib_t, neutron_var_lib_t)
')
########################################
##
## Manage neutron lib directories.
##
##
##
## Domain allowed access.
##
##
#
interface(`neutron_manage_lib_dirs',`
gen_require(`
type neutron_var_lib_t;
')
files_search_var_lib($1)
manage_dirs_pattern($1, neutron_var_lib_t, neutron_var_lib_t)
')
########################################
##
## Read and write neutron fifo files.
##
##
##
## Domain allowed access.
##
##
#
interface(`neutron_rw_fifo_file',`
gen_require(`
type neutron_t;
')
allow $1 neutron_t:fifo_file rw_inherited_fifo_file_perms;
')
#####################################
##
## Connect to neutron over a unix domain
## stream socket.
##
##
##
## Domain allowed access.
##
##
#
interface(`neutron_stream_connect',`
gen_require(`
type neutron_t;
type neutron_var_lib_t;
')
files_search_pids($1)
stream_connect_pattern($1, neutron_var_lib_t, neutron_var_lib_t, neutron_t )
')
########################################
##
## Execute neutron server in the neutron domain.
##
##
##
## Domain allowed to transition.
##
##
#
interface(`neutron_systemctl',`
gen_require(`
type neutron_t;
type neutron_unit_file_t;
')
systemd_exec_systemctl($1)
init_reload_services($1)
systemd_read_fifo_file_passwd_run($1)
allow $1 neutron_unit_file_t:file read_file_perms;
allow $1 neutron_unit_file_t:service manage_service_perms;
ps_process_pattern($1, neutron_t)
')
#######################################
##
## Read neutron process state files.
##
##
##
## Domain allowed access.
##
##
#
interface(`neutron_read_state',`
gen_require(`
type neutron_t;
')
allow $1 neutron_t:dir search_dir_perms;
allow $1 neutron_t:file read_file_perms;
allow $1 neutron_t:lnk_file read_lnk_file_perms;
')
########################################
##
## All of the rules required to administrate
## an neutron environment
##
##
##
## Domain allowed access.
##
##
#
interface(`neutron_admin',`
gen_require(`
type neutron_t;
type neutron_log_t;
type neutron_var_lib_t;
type neutron_unit_file_t;
')
allow $1 neutron_t:process { ptrace signal_perms };
ps_process_pattern($1, neutron_t)
logging_search_logs($1)
admin_pattern($1, neutron_log_t)
files_search_var_lib($1)
admin_pattern($1, neutron_var_lib_t)
neutron_systemctl($1)
admin_pattern($1, neutron_unit_file_t)
allow $1 neutron_unit_file_t:service all_service_perms;
optional_policy(`
systemd_passwd_agent_exec($1)
systemd_read_fifo_file_passwd_run($1)
')
')