From f7d413af27d2dab2c9c5ce18966bb8b4ed238cb8 Mon Sep 17 00:00:00 2001 From: Jeremy Solt Date: Tue, 16 Mar 2010 09:56:58 -0400 Subject: [PATCH] fail2ban_stream_connect and fail2ban_rw_stream_sockets from Dan Walsh Did not include dontaudit_leaks interface Modified fail2ban_rw_stream_sockets to use rw_stream_socket_perms set --- policy/modules/services/fail2ban.if | 38 +++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/policy/modules/services/fail2ban.if b/policy/modules/services/fail2ban.if index aa53435a4..83d0241b2 100644 --- a/policy/modules/services/fail2ban.if +++ b/policy/modules/services/fail2ban.if @@ -98,6 +98,26 @@ interface(`fail2ban_read_pid_files',` allow $1 fail2ban_var_run_t:file read_file_perms; ') +##################################### +## +## Connect to fail2ban over a unix domain +## stream socket. +## +## +## +## Domain allowed access. +## +## +# +interface(`fail2ban_stream_connect',` + gen_require(` + type fail2ban_t, fail2ban_var_run_t; + ') + + files_search_pids($1) + stream_connect_pattern($1, fail2ban_var_run_t, fail2ban_var_run_t, fail2ban_t) +') + ######################################## ## ## All of the rules required to administrate @@ -135,3 +155,21 @@ interface(`fail2ban_admin',` files_list_pids($1) admin_pattern($1, fail2ban_var_run_t) ') + +######################################## +## +## Read and write to an fail2ban unix stream socket. +## +## +## +## Domain allowed access. +## +## +# +interface(`fail2ban_rw_stream_sockets',` + gen_require(` + type fail2ban_t; + ') + + allow $1 fail2ban_t:unix_stream_socket rw_stream_socket_perms; +')