Chris PeBenito 17de1b
## <summary>TOR, the onion router</summary>
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute a domain transition to run TOR.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed to transition.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`tor_domtrans',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type tor_t, tor_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito c0868a
	domtrans_pattern($1,tor_exec_t,tor_t)
Chris PeBenito 17de1b
')
Chris PeBenito 7a5e2d
Chris PeBenito 7a5e2d
########################################
Chris PeBenito 7a5e2d
## <summary>
Chris PeBenito 7a5e2d
##	All of the rules required to administrate 
Chris PeBenito 7a5e2d
##	an tor environment
Chris PeBenito 7a5e2d
## </summary>
Chris PeBenito 7a5e2d
## <param name="domain">
Chris PeBenito 7a5e2d
##	<summary>
Chris PeBenito 7a5e2d
##	Domain allowed access.
Chris PeBenito 7a5e2d
##	</summary>
Chris PeBenito 7a5e2d
## </param>
Chris PeBenito 7a5e2d
## <rolecap/>
Chris PeBenito 7a5e2d
#
Chris PeBenito 7a5e2d
interface(`tor_admin',`
Chris PeBenito 7a5e2d
	gen_require(`
Chris PeBenito 8f3a0a
		type tor_t, tor_var_log_t, tor_etc_t;
Chris PeBenito 7a5e2d
		type tor_var_lib_t, tor_var_run_t;
Chris PeBenito 7a5e2d
	')
Chris PeBenito 7a5e2d
Chris PeBenito 7a5e2d
	allow $1 tor_t:process { ptrace signal_perms getattr };
Chris PeBenito 7a5e2d
	ps_process_pattern($1, tor_t)
Chris PeBenito 7a5e2d
	        
Chris PeBenito 7a5e2d
	logging_list_logs($1)
Chris PeBenito 8f3a0a
	manage_files_pattern($1, tor_var_log_t, tor_var_log_t)
Chris PeBenito 7a5e2d
Chris PeBenito 7a5e2d
	files_list_etc($1)
Chris PeBenito 7a5e2d
	manage_files_pattern($1, tor_etc_t, tor_etc_t)
Chris PeBenito 7a5e2d
Chris PeBenito 7a5e2d
	files_list_var_lib($1)
Chris PeBenito 7a5e2d
	manage_files_pattern($1, tor_var_lib_t, tor_var_lib_t)
Chris PeBenito 7a5e2d
Chris PeBenito 7a5e2d
	files_list_pids($1)
Chris PeBenito 7a5e2d
	manage_files_pattern($1, tor_var_run_t, tor_var_run_t)
Chris PeBenito 7a5e2d
')