Chris PeBenito a5ef55
## <summary>Iptables/netfilter userspace logging daemon.</summary>
Chris PeBenito a5ef55
Chris PeBenito a5ef55
########################################
Chris PeBenito a5ef55
## <summary>
Chris PeBenito a5ef55
##	Execute a domain transition to run ulogd.
Chris PeBenito a5ef55
## </summary>
Chris PeBenito a5ef55
## <param name="domain">
Chris PeBenito a5ef55
## <summary>
Chris PeBenito a5ef55
##	Domain allowed to transition.
Chris PeBenito a5ef55
## </summary>
Chris PeBenito a5ef55
## </param>
Chris PeBenito a5ef55
#
Chris PeBenito a5ef55
interface(`ulogd_domtrans',`
Chris PeBenito a5ef55
	gen_require(`
Chris PeBenito a5ef55
		type ulogd_t, ulogd_exec_t;
Chris PeBenito a5ef55
	')
Chris PeBenito a5ef55
Chris PeBenito a5ef55
	domtrans_pattern($1, ulogd_exec_t, ulogd_t)
Chris PeBenito a5ef55
')
Chris PeBenito a5ef55
Chris PeBenito a5ef55
########################################
Chris PeBenito a5ef55
## <summary>
Chris PeBenito a5ef55
##	Allow the specified domain to read
Chris PeBenito a5ef55
##	ulogd configuration files.
Chris PeBenito a5ef55
## </summary>
Chris PeBenito a5ef55
## <param name="domain">
Chris PeBenito a5ef55
##	<summary>
Chris PeBenito a5ef55
##	Domain allowed access.
Chris PeBenito a5ef55
##	</summary>
Chris PeBenito a5ef55
## </param>
Chris PeBenito a5ef55
## <rolecap/>
Chris PeBenito a5ef55
#
Chris PeBenito a5ef55
interface(`ulogd_read_config',`
Chris PeBenito a5ef55
	gen_require(`
Chris PeBenito a5ef55
		type ulogd_etc_t;
Chris PeBenito a5ef55
	')
Chris PeBenito a5ef55
Chris PeBenito a5ef55
	files_search_etc($1)
Chris PeBenito a5ef55
	read_files_pattern($1, ulogd_etc_t, ulogd_etc_t)
Chris PeBenito a5ef55
')
Chris PeBenito a5ef55
Chris PeBenito a5ef55
########################################
Chris PeBenito a5ef55
## <summary>
Chris PeBenito a5ef55
##	Allow the specified domain to read ulogd's log files.
Chris PeBenito a5ef55
## </summary>
Chris PeBenito a5ef55
## <param name="domain">
Chris PeBenito a5ef55
##	<summary>
Chris PeBenito a5ef55
##	Domain allowed access.
Chris PeBenito a5ef55
##	</summary>
Chris PeBenito a5ef55
## </param>
Chris PeBenito a5ef55
## <rolecap/>
Chris PeBenito a5ef55
#
Chris PeBenito a5ef55
interface(`ulogd_read_log',`
Chris PeBenito a5ef55
	gen_require(`
Chris PeBenito a5ef55
		type ulogd_var_log_t;
Chris PeBenito a5ef55
	')
Chris PeBenito a5ef55
Chris PeBenito a5ef55
	logging_search_logs($1)
Chris PeBenito a5ef55
	allow $1 ulogd_var_log_t:dir list_dir_perms;
Chris PeBenito a5ef55
	read_files_pattern($1, ulogd_var_log_t, ulogd_var_log_t)
Chris PeBenito a5ef55
')
Chris PeBenito a5ef55
Chris PeBenito 455155
#######################################
Chris PeBenito 455155
## <summary>
Chris PeBenito 455155
##      Allow the specified domain to search ulogd's log files.
Chris PeBenito 455155
## </summary>
Chris PeBenito 455155
## <param name="domain">
Chris PeBenito 455155
## <summary>
Chris PeBenito 455155
##      Domain allowed to transition.
Chris PeBenito 455155
## </summary>
Chris PeBenito 455155
## </param>
Chris PeBenito 455155
#
Chris PeBenito 455155
interface(`ulogd_search_log',`
Chris PeBenito 455155
        gen_require(`
Chris PeBenito 455155
                type ulogd_var_log_t;
Chris PeBenito 455155
        ')
Chris PeBenito 455155
Chris PeBenito 455155
        logging_search_logs($1)
Chris PeBenito 455155
        allow $1 ulogd_var_log_t:dir search_dir_perms;
Chris PeBenito 455155
')
Chris PeBenito 455155
Chris PeBenito a5ef55
########################################
Chris PeBenito a5ef55
## <summary>
Chris PeBenito a5ef55
##	Allow the specified domain to append to ulogd's log files.
Chris PeBenito a5ef55
## </summary>
Chris PeBenito a5ef55
## <param name="domain">
Chris PeBenito a5ef55
##	<summary>
Chris PeBenito a5ef55
##	Domain allowed access.
Chris PeBenito a5ef55
##	</summary>
Chris PeBenito a5ef55
## </param>
Chris PeBenito a5ef55
## <rolecap/>
Chris PeBenito a5ef55
#
Chris PeBenito a5ef55
interface(`ulogd_append_log',`
Chris PeBenito a5ef55
	gen_require(`
Chris PeBenito a5ef55
		type ulogd_var_log_t;
Chris PeBenito a5ef55
	')
Chris PeBenito a5ef55
Chris PeBenito a5ef55
	logging_search_logs($1)
Chris PeBenito a5ef55
	allow $1 ulogd_var_log_t:dir list_dir_perms;
Chris PeBenito a5ef55
	allow $1 ulogd_var_log_t:file append_file_perms;
Chris PeBenito a5ef55
')
Chris PeBenito a5ef55
Chris PeBenito a5ef55
########################################
Chris PeBenito a5ef55
## <summary>
Chris PeBenito a5ef55
##	All of the rules required to administrate 
Chris PeBenito a5ef55
##	an ulogd environment
Chris PeBenito a5ef55
## </summary>
Chris PeBenito a5ef55
## <param name="domain">
Chris PeBenito a5ef55
##	<summary>
Chris PeBenito a5ef55
##	Domain allowed access.
Chris PeBenito a5ef55
##	</summary>
Chris PeBenito a5ef55
## </param>
Chris PeBenito a5ef55
## <param name="role">
Chris PeBenito a5ef55
##	<summary>
Chris PeBenito a5ef55
##	The role to be allowed to manage the syslog domain.
Chris PeBenito a5ef55
##	</summary>
Chris PeBenito a5ef55
## </param>
Chris PeBenito a5ef55
## <rolecap/>
Chris PeBenito a5ef55
#
Chris PeBenito a5ef55
interface(`ulogd_admin',`
Chris PeBenito a5ef55
	gen_require(`
Chris PeBenito a5ef55
		type ulogd_t, ulogd_etc_t;
Chris PeBenito a5ef55
		type ulogd_var_log_t, ulogd_initrc_exec_t;
Chris PeBenito a5ef55
		type ulogd_modules_t;
Chris PeBenito a5ef55
	')
Chris PeBenito a5ef55
Chris PeBenito a5ef55
	allow $1 ulogd_t:process { ptrace signal_perms };
Chris PeBenito a5ef55
	ps_process_pattern($1, ulogd_t)
Chris PeBenito a5ef55
Chris PeBenito a5ef55
	init_labeled_script_domtrans($1, ulogd_initrc_exec_t)
Chris PeBenito a5ef55
	domain_system_change_exemption($1)
Chris PeBenito a5ef55
	role_transition $2 ulogd_initrc_exec_t system_r;
Chris PeBenito a5ef55
	allow $2 system_r;
Chris PeBenito a5ef55
Chris PeBenito a5ef55
	files_search_etc($1)
Chris PeBenito a5ef55
	admin_pattern($1, ulogd_etc_t)
Chris PeBenito a5ef55
Chris PeBenito a5ef55
	logging_list_logs($1)
Chris PeBenito a5ef55
	admin_pattern($1, ulogd_var_log_t)
Chris PeBenito a5ef55
Chris PeBenito a5ef55
	files_search_usr($1)
Chris PeBenito a5ef55
	admin_pattern($1, ulogd_modules_t)
Chris PeBenito a5ef55
')