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