Chris PeBenito 6d4dbd
## <summary>Virtual host metrics daemon</summary>
Chris PeBenito 6d4dbd
Chris PeBenito 6d4dbd
########################################
Chris PeBenito 6d4dbd
## <summary>
Chris PeBenito 6d4dbd
##	Execute a domain transition to run vhostmd.
Chris PeBenito 6d4dbd
## </summary>
Chris PeBenito 6d4dbd
## <param name="domain">
Chris PeBenito 6d4dbd
## <summary>
Chris PeBenito 6d4dbd
##	Domain allowed to transition.
Chris PeBenito 6d4dbd
## </summary>
Chris PeBenito 6d4dbd
## </param>
Chris PeBenito 6d4dbd
#
Chris PeBenito 6d4dbd
interface(`vhostmd_domtrans',`
Chris PeBenito 6d4dbd
	gen_require(`
Chris PeBenito 6d4dbd
		type vhostmd_t, vhostmd_exec_t;
Chris PeBenito 6d4dbd
	')
Chris PeBenito 6d4dbd
Chris PeBenito 6d4dbd
	domtrans_pattern($1, vhostmd_exec_t, vhostmd_t)
Chris PeBenito 6d4dbd
')
Chris PeBenito 6d4dbd
Chris PeBenito 6d4dbd
########################################
Chris PeBenito 6d4dbd
## <summary>
Chris PeBenito 6d4dbd
##	Execute vhostmd server in the vhostmd domain.
Chris PeBenito 6d4dbd
## </summary>
Chris PeBenito 6d4dbd
## <param name="domain">
Chris PeBenito 6d4dbd
##	<summary>
Chris PeBenito 6d4dbd
##	The type of the process performing this action.
Chris PeBenito 6d4dbd
##	</summary>
Chris PeBenito 6d4dbd
## </param>
Chris PeBenito 6d4dbd
#
Chris PeBenito 6d4dbd
interface(`vhostmd_initrc_domtrans',`
Chris PeBenito 6d4dbd
	gen_require(`
Chris PeBenito 6d4dbd
		type vhostmd_initrc_exec_t;
Chris PeBenito 6d4dbd
	')
Chris PeBenito 6d4dbd
Chris PeBenito 6d4dbd
	init_labeled_script_domtrans($1, vhostmd_initrc_exec_t)
Chris PeBenito 6d4dbd
')
Chris PeBenito 6d4dbd
Chris PeBenito 6d4dbd
########################################
Chris PeBenito 6d4dbd
## <summary>
Chris PeBenito 6d4dbd
##	Allow domain to read, vhostmd tmpfs files
Chris PeBenito 6d4dbd
## </summary>
Chris PeBenito 6d4dbd
## <param name="domain">
Chris PeBenito 6d4dbd
##	<summary>
Chris PeBenito 6d4dbd
##	Domain to not audit.
Chris PeBenito 6d4dbd
##	</summary>
Chris PeBenito 6d4dbd
## </param>
Chris PeBenito 6d4dbd
#
Chris PeBenito 6d4dbd
interface(`vhostmd_read_tmpfs_files',`
Chris PeBenito 6d4dbd
	gen_require(`
Chris PeBenito 6d4dbd
		type vhostmd_tmpfs_t;
Chris PeBenito 6d4dbd
	')
Chris PeBenito 6d4dbd
Chris PeBenito 6d4dbd
	allow $1 vhostmd_tmpfs_t:file read_file_perms;
Chris PeBenito 6d4dbd
	files_search_tmp($1)
Chris PeBenito 6d4dbd
')
Chris PeBenito 6d4dbd
Chris PeBenito 6d4dbd
########################################
Chris PeBenito 6d4dbd
## <summary>
Chris PeBenito 6d4dbd
##	Do not audit attempts to read,
Chris PeBenito 6d4dbd
##	vhostmd tmpfs files
Chris PeBenito 6d4dbd
## </summary>
Chris PeBenito 6d4dbd
## <param name="domain">
Chris PeBenito 6d4dbd
##	<summary>
Chris PeBenito 6d4dbd
##	Domain to not audit.
Chris PeBenito 6d4dbd
##	</summary>
Chris PeBenito 6d4dbd
## </param>
Chris PeBenito 6d4dbd
#
Chris PeBenito 6d4dbd
interface(`vhostmd_dontaudit_read_tmpfs_files',`
Chris PeBenito 6d4dbd
	gen_require(`
Chris PeBenito 6d4dbd
		type vhostmd_tmpfs_t;
Chris PeBenito 6d4dbd
	')
Chris PeBenito 6d4dbd
Chris PeBenito 6d4dbd
	dontaudit $1 vhostmd_tmpfs_t:file read_file_perms;
Chris PeBenito 6d4dbd
')
Chris PeBenito 6d4dbd
Chris PeBenito 6d4dbd
#######################################
Chris PeBenito 6d4dbd
## <summary>
Chris PeBenito 6d4dbd
##	Allow domain to read and write vhostmd tmpfs files
Chris PeBenito 6d4dbd
## </summary>
Chris PeBenito 6d4dbd
## <param name="domain">
Chris PeBenito 6d4dbd
##	<summary>
Chris PeBenito 6d4dbd
##	Domain to not audit.
Chris PeBenito 6d4dbd
##	</summary>
Chris PeBenito 6d4dbd
## </param>
Chris PeBenito 6d4dbd
#
Chris PeBenito 6d4dbd
interface(`vhostmd_rw_tmpfs_files',`
Chris PeBenito 6d4dbd
	gen_require(`
Chris PeBenito 6d4dbd
		type vhostmd_tmpfs_t;
Chris PeBenito 6d4dbd
	')
Chris PeBenito 6d4dbd
Chris PeBenito 6d4dbd
	rw_files_pattern($1, vhostmd_tmpfs_t, vhostmd_tmpfs_t)
Chris PeBenito 6d4dbd
	files_search_tmp($1)
Chris PeBenito 6d4dbd
')
Chris PeBenito 6d4dbd
Chris PeBenito 6d4dbd
########################################
Chris PeBenito 6d4dbd
## <summary>
Chris PeBenito 6d4dbd
##	Create, read, write, and delete vhostmd tmpfs files.
Chris PeBenito 6d4dbd
## </summary>
Chris PeBenito 6d4dbd
## <param name="domain">
Chris PeBenito 6d4dbd
##	<summary>
Chris PeBenito 6d4dbd
##	Domain to not audit.
Chris PeBenito 6d4dbd
##	</summary>
Chris PeBenito 6d4dbd
## </param>
Chris PeBenito 6d4dbd
#
Chris PeBenito 6d4dbd
interface(`vhostmd_manage_tmpfs_files',`
Chris PeBenito 6d4dbd
	gen_require(`
Chris PeBenito 6d4dbd
		type vhostmd_tmpfs_t;
Chris PeBenito 6d4dbd
	')
Chris PeBenito 6d4dbd
Chris PeBenito 6d4dbd
	manage_files_pattern($1, vhostmd_tmpfs_t, vhostmd_tmpfs_t)
Chris PeBenito 6d4dbd
	files_search_tmp($1)
Chris PeBenito 6d4dbd
')
Chris PeBenito 6d4dbd
Chris PeBenito 6d4dbd
########################################
Chris PeBenito 6d4dbd
## <summary>
Chris PeBenito 6d4dbd
##	Read vhostmd PID files.
Chris PeBenito 6d4dbd
## </summary>
Chris PeBenito 6d4dbd
## <param name="domain">
Chris PeBenito 6d4dbd
##	<summary>
Chris PeBenito 6d4dbd
##	Domain allowed access.
Chris PeBenito 6d4dbd
##	</summary>
Chris PeBenito 6d4dbd
## </param>
Chris PeBenito 6d4dbd
#
Chris PeBenito 6d4dbd
interface(`vhostmd_read_pid_files',`
Chris PeBenito 6d4dbd
	gen_require(`
Chris PeBenito 6d4dbd
		type vhostmd_var_run_t;
Chris PeBenito 6d4dbd
	')
Chris PeBenito 6d4dbd
Chris PeBenito 6d4dbd
	files_search_pids($1)
Chris PeBenito 6d4dbd
	allow $1 vhostmd_var_run_t:file read_file_perms;
Chris PeBenito 6d4dbd
')
Chris PeBenito 6d4dbd
Chris PeBenito 6d4dbd
########################################
Chris PeBenito 6d4dbd
## <summary>
Chris PeBenito 6d4dbd
##	Manage vhostmd var_run files.
Chris PeBenito 6d4dbd
## </summary>
Chris PeBenito 6d4dbd
## <param name="domain">
Chris PeBenito 6d4dbd
##	<summary>
Chris PeBenito 6d4dbd
##	Domain allowed access.
Chris PeBenito 6d4dbd
##	</summary>
Chris PeBenito 6d4dbd
## </param>
Chris PeBenito 6d4dbd
#
Chris PeBenito 6d4dbd
interface(`vhostmd_manage_pid_files',`
Chris PeBenito 6d4dbd
	gen_require(`
Chris PeBenito 6d4dbd
		type vhostmd_var_run_t;
Chris PeBenito 6d4dbd
	')
Chris PeBenito 6d4dbd
Chris PeBenito 6d4dbd
	 manage_files_pattern($1, vhostmd_var_run_t, vhostmd_var_run_t)
Chris PeBenito 6d4dbd
')
Chris PeBenito 6d4dbd
Chris PeBenito 6d4dbd
########################################
Chris PeBenito 6d4dbd
## <summary>
Chris PeBenito 6d4dbd
##	Connect to vhostmd over an unix domain stream socket.
Chris PeBenito 6d4dbd
## </summary>
Chris PeBenito 6d4dbd
## <param name="domain">
Chris PeBenito 6d4dbd
##	<summary>
Chris PeBenito 6d4dbd
##	Domain allowed access.
Chris PeBenito 6d4dbd
##	</summary>
Chris PeBenito 6d4dbd
## </param>
Chris PeBenito 6d4dbd
#
Chris PeBenito 6d4dbd
interface(`vhostmd_stream_connect',`
Chris PeBenito 6d4dbd
	gen_require(`
Chris PeBenito 6d4dbd
		type vhostmd_t, vhostmd_var_run_t;
Chris PeBenito 6d4dbd
	')
Chris PeBenito 6d4dbd
Chris PeBenito 6d4dbd
	files_search_pids($1)
Chris PeBenito 6d4dbd
	stream_connect_pattern($1, vhostmd_var_run_t, vhostmd_var_run_t, vhostmd_t)
Chris PeBenito 6d4dbd
')
Chris PeBenito 6d4dbd
Chris PeBenito 6d4dbd
#######################################
Chris PeBenito 6d4dbd
## <summary>
Chris PeBenito 6d4dbd
##	Dontaudit read and write to vhostmd
Chris PeBenito 6d4dbd
##	over an unix domain stream socket.
Chris PeBenito 6d4dbd
## </summary>
Chris PeBenito 6d4dbd
## <param name="domain">
Chris PeBenito 6d4dbd
##	<summary>
Chris PeBenito 6d4dbd
##	Domain allowed access.
Chris PeBenito 6d4dbd
##	</summary>
Chris PeBenito 6d4dbd
## </param>
Chris PeBenito 6d4dbd
#
Chris PeBenito 6d4dbd
interface(`vhostmd_dontaudit_rw_stream_connect',`
Chris PeBenito 6d4dbd
	gen_require(`
Chris PeBenito 6d4dbd
		type vhostmd_t;
Chris PeBenito 6d4dbd
	')
Chris PeBenito 6d4dbd
Chris PeBenito 6d4dbd
	dontaudit $1 vhostmd_t:unix_stream_socket { read write };
Chris PeBenito 6d4dbd
')
Chris PeBenito 6d4dbd
Chris PeBenito 6d4dbd
########################################
Chris PeBenito 6d4dbd
## <summary>
Chris PeBenito 6d4dbd
##	All of the rules required to administrate
Chris PeBenito 6d4dbd
##	an vhostmd environment
Chris PeBenito 6d4dbd
## </summary>
Chris PeBenito 6d4dbd
## <param name="domain">
Chris PeBenito 6d4dbd
##	<summary>
Chris PeBenito 6d4dbd
##	Domain allowed access.
Chris PeBenito 6d4dbd
##	</summary>
Chris PeBenito 6d4dbd
## </param>
Chris PeBenito 6d4dbd
## <param name="role">
Chris PeBenito 6d4dbd
##	<summary>
Chris PeBenito 6d4dbd
##	Role allowed access.
Chris PeBenito 6d4dbd
##	</summary>
Chris PeBenito 6d4dbd
## </param>
Chris PeBenito 6d4dbd
## <rolecap/>
Chris PeBenito 6d4dbd
#
Chris PeBenito 6d4dbd
interface(`vhostmd_admin',`
Chris PeBenito 6d4dbd
	gen_require(`
Chris PeBenito 6d4dbd
		type vhostmd_t, vhostmd_initrc_exec_t;
Chris PeBenito 6d4dbd
	')
Chris PeBenito 6d4dbd
Chris PeBenito 6d4dbd
	allow $1 vhostmd_t:process { ptrace signal_perms getattr };
Chris PeBenito 6d4dbd
	ps_process_pattern($1, vhostmd_t)
Chris PeBenito 6d4dbd
Chris PeBenito 6d4dbd
	vhostmd_initrc_domtrans($1)
Chris PeBenito 6d4dbd
	domain_system_change_exemption($1)
Chris PeBenito 6d4dbd
	role_transition $2 vhostmd_initrc_exec_t system_r;
Chris PeBenito 6d4dbd
	allow $2 system_r;
Chris PeBenito 6d4dbd
Chris PeBenito 6d4dbd
	vhostmd_manage_tmpfs_files($1)
Chris PeBenito 6d4dbd
Chris PeBenito 6d4dbd
	vhostmd_manage_pid_files($1)
Chris PeBenito 6d4dbd
Chris PeBenito 6d4dbd
')