Chris PeBenito cd3ee9
## <summary>Update firewall filtering to ban IP addresses with too many password failures.</summary>
Chris PeBenito cd3ee9
Chris PeBenito cd3ee9
########################################
Chris PeBenito cd3ee9
## <summary>
Chris PeBenito cd3ee9
##	Execute a domain transition to run fail2ban.
Chris PeBenito cd3ee9
## </summary>
Chris PeBenito cd3ee9
## <param name="domain">
Chris PeBenito cd3ee9
## <summary>
Chris PeBenito cd3ee9
##	Domain allowed to transition.
Chris PeBenito cd3ee9
## </summary>
Chris PeBenito cd3ee9
## </param>
Chris PeBenito cd3ee9
#
Chris PeBenito cd3ee9
interface(`fail2ban_domtrans',`
Chris PeBenito cd3ee9
	gen_require(`
Chris PeBenito cd3ee9
		type fail2ban_t, fail2ban_exec_t;
Chris PeBenito cd3ee9
	')
Chris PeBenito cd3ee9
Chris PeBenito cd3ee9
	domtrans_pattern($1,fail2ban_exec_t,fail2ban_t)
Chris PeBenito cd3ee9
')
Chris PeBenito cd3ee9
Chris PeBenito cd3ee9
########################################
Chris PeBenito cd3ee9
## <summary>
Chris PeBenito cd3ee9
##	Allow the specified domain to read fail2ban's log files.
Chris PeBenito cd3ee9
## </summary>
Chris PeBenito cd3ee9
## <param name="domain">
Chris PeBenito cd3ee9
##	<summary>
Chris PeBenito cd3ee9
##	Domain allowed access.
Chris PeBenito cd3ee9
##	</summary>
Chris PeBenito cd3ee9
## </param>
Chris PeBenito cd3ee9
## <rolecap/>
Chris PeBenito cd3ee9
#
Chris PeBenito cd3ee9
interface(`fail2ban_read_log',`
Chris PeBenito cd3ee9
	gen_require(`
Chris PeBenito cd3ee9
		type fail2ban_log_t;
Chris PeBenito cd3ee9
	')
Chris PeBenito cd3ee9
Chris PeBenito cd3ee9
	logging_search_logs($1)
Chris PeBenito cd3ee9
	allow $1 fail2ban_log_t:dir list_dir_perms;
Chris PeBenito cd3ee9
	allow $1 fail2ban_log_t:file { read getattr lock };
Chris PeBenito cd3ee9
')
Chris PeBenito cd3ee9
Chris PeBenito cd3ee9
########################################
Chris PeBenito cd3ee9
## <summary>
Chris PeBenito cd3ee9
##	Allow the specified domain to append
Chris PeBenito cd3ee9
##	fail2ban log files.
Chris PeBenito cd3ee9
## </summary>
Chris PeBenito cd3ee9
## <param name="domain">
Chris PeBenito cd3ee9
## 	<summary>
Chris PeBenito cd3ee9
##	Domain allowed to transition.
Chris PeBenito cd3ee9
## 	</summary>
Chris PeBenito cd3ee9
## </param>
Chris PeBenito cd3ee9
#
Chris PeBenito cd3ee9
interface(`fail2ban_append_log',`
Chris PeBenito cd3ee9
	gen_require(`
Chris PeBenito cd3ee9
		type fail2ban_log_t;
Chris PeBenito cd3ee9
	')
Chris PeBenito cd3ee9
Chris PeBenito cd3ee9
	logging_search_logs($1)
Chris PeBenito cd3ee9
	allow $1 fail2ban_log_t:dir list_dir_perms;
Chris PeBenito cd3ee9
	allow $1 fail2ban_log_t:file append_file_perms;
Chris PeBenito cd3ee9
')
Chris PeBenito cd3ee9
Chris PeBenito cd3ee9
########################################
Chris PeBenito cd3ee9
## <summary>
Chris PeBenito cd3ee9
##	Read fail2ban PID files.
Chris PeBenito cd3ee9
## </summary>
Chris PeBenito cd3ee9
## <param name="domain">
Chris PeBenito cd3ee9
##	<summary>
Chris PeBenito cd3ee9
##	Domain allowed access.
Chris PeBenito cd3ee9
##	</summary>
Chris PeBenito cd3ee9
## </param>
Chris PeBenito cd3ee9
#
Chris PeBenito cd3ee9
interface(`fail2ban_read_pid_files',`
Chris PeBenito cd3ee9
	gen_require(`
Chris PeBenito cd3ee9
		type fail2ban_var_run_t;
Chris PeBenito cd3ee9
	')
Chris PeBenito cd3ee9
Chris PeBenito cd3ee9
	files_search_pids($1)
Chris PeBenito cd3ee9
	allow $1 fail2ban_var_run_t:file read_file_perms;
Chris PeBenito cd3ee9
')