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">
Dominick Grift dcf874
##	<summary>
Chris PeBenito a5ef55
##	Domain allowed to transition.
Dominick Grift dcf874
##	</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 3f67f7
##	Allow the specified domain to search ulogd's log files.
Chris PeBenito 455155
## </summary>
Chris PeBenito 455155
## <param name="domain">
Dominick Grift dcf874
##	<summary>
Dominick Grift 288845
##	Domain allowed access.
Dominick Grift dcf874
##	</summary>
Chris PeBenito 455155
## </param>
Chris PeBenito 455155
#
Chris PeBenito 455155
interface(`ulogd_search_log',`
Chris PeBenito 3f67f7
	gen_require(`
Chris PeBenito 3f67f7
		type ulogd_var_log_t;
Chris PeBenito 3f67f7
	')
Chris PeBenito 455155
Chris PeBenito 3f67f7
	logging_search_logs($1)
Chris PeBenito 3f67f7
	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(`
Dominick Grift 2f94f4
		type ulogd_t, ulogd_etc_t, ulogd_modules_t;
Chris PeBenito a5ef55
		type ulogd_var_log_t, ulogd_initrc_exec_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
')