## Console network traffic monitor.
########################################
##
## Execute a domain transition to run vnstat.
##
##
##
## Domain allowed to transition.
##
##
#
interface(`vnstatd_domtrans_vnstat',`
gen_require(`
type vnstat_t, vnstat_exec_t;
')
corecmd_search_bin($1)
domtrans_pattern($1, vnstat_exec_t, vnstat_t)
')
########################################
##
## Execute vnstat in the vnstat domain,
## and allow the specified role
## the vnstat domain.
##
##
##
## Domain allowed to transition.
##
##
##
##
## Role allowed access.
##
##
#
interface(`vnstatd_run_vnstat',`
gen_require(`
attribute_role vnstat_roles;
')
vnstatd_domtrans_vnstat($1)
roleattribute $2 vnstat_roles;
')
########################################
##
## Execute a domain transition to run vnstatd.
##
##
##
## Domain allowed to transition.
##
##
#
interface(`vnstatd_domtrans',`
refpolicywarn(`$0($*) has been deprecated')
gen_require(`
type vnstatd_t, vnstatd_exec_t;
')
corecmd_search_bin($1)
domtrans_pattern($1, vnstatd_exec_t, vnstatd_t)
')
########################################
##
## Search vnstatd lib directories.
##
##
##
## Domain allowed access.
##
##
#
interface(`vnstatd_search_lib',`
refpolicywarn(`$0($*) has been deprecated')
gen_require(`
type vnstatd_var_lib_t;
')
files_search_var_lib($1)
allow $1 vnstatd_var_lib_t:dir search_dir_perms;
')
########################################
##
## Create, read, write, and delete
## vnstatd lib directories.
##
##
##
## Domain allowed access.
##
##
#
interface(`vnstatd_manage_lib_dirs',`
refpolicywarn(`$0($*) has been deprecated')
gen_require(`
type vnstatd_var_lib_t;
')
files_search_var_lib($1)
manage_dirs_pattern($1, vnstatd_var_lib_t, vnstatd_var_lib_t)
')
########################################
##
## Read vnstatd lib files.
##
##
##
## Domain allowed access.
##
##
#
interface(`vnstatd_read_lib_files',`
refpolicywarn(`$0($*) has been deprecated')
gen_require(`
type vnstatd_var_lib_t;
')
files_search_var_lib($1)
read_files_pattern($1, vnstatd_var_lib_t, vnstatd_var_lib_t)
')
########################################
##
## Create, read, write, and delete
## vnstatd lib files.
##
##
##
## Domain allowed access.
##
##
#
interface(`vnstatd_manage_lib_files',`
refpolicywarn(`$0($*) has been deprecated')
gen_require(`
type vnstatd_var_lib_t;
')
files_search_var_lib($1)
manage_files_pattern($1, vnstatd_var_lib_t, vnstatd_var_lib_t)
')
########################################
##
## All of the rules required to
## administrate an vnstatd environment.
##
##
##
## Domain allowed access.
##
##
##
##
## Role allowed access.
##
##
##
#
interface(`vnstatd_admin',`
gen_require(`
type vnstatd_t, vnstatd_initrc_exec_t;
type vnstatd_pid_t, vnstatd_unit_t, vnstatd_var_lib_t;
')
admin_process_pattern($1, vnstatd_t)
init_startstop_service($1, $2, vnstatd_t, vnstatd_initrc_exec_t, vnstatd_unit_t)
files_search_pids($1)
admin_pattern($1, vnstatd_pid_t)
files_list_var_lib($1)
admin_pattern($1, vnstatd_var_lib_t)
vnstatd_run_vnstat($1, $2)
')