Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# Razor - Razor is a collaborative, networked system to detect and
Chris PeBenito 31b7c0
#         block spam using identifying digests of messages.
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# Author:  David Hampton <hampton@employees.org>
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
##########
Chris PeBenito 31b7c0
# common definitions for razord and all flavors of razor
Chris PeBenito 31b7c0
##########
Chris PeBenito 31b7c0
define(`razor_base_domain',`
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# Razor is one executable and several symlinks
Chris PeBenito 31b7c0
allow $1_t razor_exec_t:{ file lnk_file } { getattr read };
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# Networking
Chris PeBenito 31b7c0
can_network_client_tcp($1_t, razor_port_t)
Chris PeBenito 31b7c0
can_resolve($1_t);
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
general_proc_read_access($1_t)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# Read system config file
Chris PeBenito 31b7c0
r_dir_file($1_t, razor_etc_t)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# Update razor common files
Chris PeBenito 31b7c0
file_type_auto_trans($1_t, var_log_t, razor_log_t, file)
Chris PeBenito 31b7c0
create_dir_file($1_t, razor_log_t)
Chris PeBenito 31b7c0
allow $1_t var_lib_t:dir search;
Chris PeBenito 31b7c0
create_dir_file($1_t, razor_var_lib_t)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow $1_t bin_t:dir { getattr search };
Chris PeBenito 31b7c0
allow $1_t bin_t:file getattr;
Chris PeBenito 31b7c0
allow $1_t lib_t:file { getattr read };
Chris PeBenito 31b7c0
allow $1_t { var_t var_run_t }:dir search;
Chris PeBenito 31b7c0
uses_shlib($1_t)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# Razor forks other programs to do part of its work.
Chris PeBenito 31b7c0
general_domain_access($1_t)
Chris PeBenito 31b7c0
can_exec($1_t, bin_t)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# mktemp and other randoms
Chris PeBenito 31b7c0
allow $1_t { random_device_t urandom_device_t }:chr_file r_file_perms;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# Allow access to various files in the /etc/directory including mtab
Chris PeBenito 31b7c0
# and nsswitch
Chris PeBenito 31b7c0
allow $1_t { etc_t etc_runtime_t }:file { getattr read };
Chris PeBenito 31b7c0
read_locale($1_t)
Chris PeBenito 31b7c0
')
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# Define a user domain for a razor
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# Note: expects to be called with an argument of user, sysadm
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
define(`razor_domain',`
Chris PeBenito 31b7c0
type $1_razor_t, domain, privlog, nscd_client_domain;
Chris PeBenito 31b7c0
role $1_r types $1_razor_t;
Chris PeBenito 31b7c0
domain_auto_trans($1_t, razor_exec_t, $1_razor_t)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
razor_base_domain($1_razor)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# Per-user config/data files
Chris PeBenito 31b7c0
home_domain($1, razor)
Chris PeBenito 31b7c0
file_type_auto_trans($1_razor_t, $1_home_dir_t, $1_razor_home_t, dir)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
tmp_domain($1_razor)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow $1_razor_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# Allow razor to be run by hand.  Needed by any action other than
Chris PeBenito 31b7c0
# invocation from a spam filter.
Chris PeBenito 31b7c0
can_access_pty($1_razor_t, $1)
Chris PeBenito 31b7c0
allow $1_razor_t sshd_t:fd use;
Chris PeBenito 31b7c0
')