Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# Razor - Vipul's Razor is a distributed, collaborative, spam
Chris PeBenito 31b7c0
#         detection and filtering network.
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# Author:  David Hampton <hampton@employees.org>
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# NOTE: This policy will work with either the ATrpms provided config
Chris PeBenito 31b7c0
# file in /etc/razor, or with the default of dumping everything into
Chris PeBenito 31b7c0
# $HOME/.razor.
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
##########
Chris PeBenito 31b7c0
# Razor query application - from system_r applictions
Chris PeBenito 31b7c0
##########
Chris PeBenito 31b7c0
type razor_t, domain, privlog, daemon;
Chris PeBenito 31b7c0
type razor_exec_t, file_type, sysadmfile, exec_type;
Chris PeBenito 31b7c0
role system_r types razor_t;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
razor_base_domain(razor)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# Razor config file directory.  When invoked as razor-admin, it can
Chris PeBenito 31b7c0
# update files in this directory.
Chris PeBenito 31b7c0
etcdir_domain(razor)
Chris PeBenito 31b7c0
create_dir_file(razor_t, razor_etc_t);
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# Shared razor files updated freuently
Chris PeBenito 31b7c0
var_lib_domain(razor)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# Log files
Chris PeBenito 31b7c0
log_domain(razor)
Chris PeBenito 31b7c0
allow razor_t var_log_t:dir search;
Chris PeBenito 31b7c0
ifdef(`logrotate.te', `
Chris PeBenito 31b7c0
allow logrotate_t razor_log_t:file r_file_perms;
Chris PeBenito 31b7c0
')
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
##########
Chris PeBenito 31b7c0
##########
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# Some spam filters executes the razor code directly.  Allow them access here.
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
define(`razor_access',`
Chris PeBenito 31b7c0
r_dir_file($1, razor_etc_t)
Chris PeBenito 31b7c0
allow $1 var_log_t:dir search;
Chris PeBenito 31b7c0
allow $1 razor_log_t:file ra_file_perms;
Chris PeBenito 31b7c0
r_dir_file($1, razor_var_lib_t)
Chris PeBenito 31b7c0
r_dir_file($1, sysadm_razor_home_t)
Chris PeBenito 31b7c0
can_network_client_tcp($1, razor_port_t)
Chris PeBenito 31b7c0
allow $1 razor_port_t:tcp_socket name_connect;
Chris PeBenito 31b7c0
')
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
ifdef(`spamd.te', `razor_access(spamd_t)');
Chris PeBenito 31b7c0
ifdef(`amavis.te', `razor_access(amavisd_t)');