Chris PeBenito 17de1b
Chris PeBenito 12e9ea
policy_module(amavis,1.4.1)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Declarations
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type amavis_t;
Chris PeBenito 17de1b
type amavis_exec_t;
Chris PeBenito 17de1b
domain_type(amavis_t)
Chris PeBenito 17de1b
init_daemon_domain(amavis_t, amavis_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# configuration files
Chris PeBenito 17de1b
type amavis_etc_t;
Chris PeBenito 17de1b
files_type(amavis_etc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# pid files
Chris PeBenito 17de1b
type amavis_var_run_t;
Chris PeBenito 17de1b
files_pid_file(amavis_var_run_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# var/lib files
Chris PeBenito 17de1b
type amavis_var_lib_t;
Chris PeBenito 17de1b
files_type(amavis_var_lib_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# log files
Chris PeBenito 17de1b
type amavis_var_log_t;
Chris PeBenito 17de1b
logging_log_file(amavis_var_log_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# tmp files
Chris PeBenito 17de1b
type amavis_tmp_t;
Chris PeBenito 17de1b
files_tmp_file(amavis_tmp_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# virus quarantine
Chris PeBenito 17de1b
type amavis_quarantine_t;
Chris PeBenito 17de1b
files_type(amavis_quarantine_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type amavis_spool_t;
Chris PeBenito 17de1b
files_type(amavis_spool_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# amavis local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow amavis_t self:capability { kill chown dac_override setgid setuid };
Chris PeBenito 17de1b
dontaudit amavis_t self:capability sys_tty_config;
Chris PeBenito 17de1b
allow amavis_t self:process { signal sigchld signull };
Chris PeBenito c0868a
allow amavis_t self:fifo_file rw_fifo_file_perms;
Chris PeBenito 17de1b
allow amavis_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 17de1b
allow amavis_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 17de1b
allow amavis_t self:tcp_socket { listen accept };
Chris PeBenito 747ab1
allow amavis_t self:netlink_route_socket r_netlink_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# configuration files
Chris PeBenito c0868a
allow amavis_t amavis_etc_t:dir list_dir_perms;
Chris PeBenito c0868a
read_files_pattern(amavis_t,amavis_etc_t,amavis_etc_t)
Chris PeBenito c0868a
read_lnk_files_pattern(amavis_t,amavis_etc_t,amavis_etc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# mail quarantine
Chris PeBenito c0868a
manage_dirs_pattern(amavis_t,amavis_quarantine_t,amavis_quarantine_t)
Chris PeBenito c0868a
manage_files_pattern(amavis_t,amavis_quarantine_t,amavis_quarantine_t)
Chris PeBenito c0868a
manage_sock_files_pattern(amavis_t,amavis_quarantine_t,amavis_quarantine_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# Spool Files
Chris PeBenito c0868a
manage_dirs_pattern(amavis_t,amavis_spool_t,amavis_spool_t)
Chris PeBenito c0868a
manage_files_pattern(amavis_t,amavis_spool_t,amavis_spool_t)
Chris PeBenito c0868a
manage_sock_files_pattern(amavis_t,amavis_spool_t,amavis_spool_t)
Chris PeBenito c0868a
filetrans_pattern(amavis_t,amavis_spool_t,amavis_var_run_t,sock_file)
Chris PeBenito a5e213
files_search_spool(amavis_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# tmp files
Chris PeBenito c0868a
manage_files_pattern(amavis_t,amavis_tmp_t,amavis_tmp_t)
Chris PeBenito c0868a
allow amavis_t amavis_tmp_t:dir setattr;
Chris PeBenito 17de1b
files_tmp_filetrans(amavis_t,amavis_tmp_t,file)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# var/lib files for amavis
Chris PeBenito c0868a
manage_dirs_pattern(amavis_t,amavis_var_lib_t,amavis_var_lib_t)
Chris PeBenito c0868a
manage_files_pattern(amavis_t,amavis_var_lib_t,amavis_var_lib_t)
Chris PeBenito c0868a
manage_sock_files_pattern(amavis_t,amavis_var_lib_t,amavis_var_lib_t)
Chris PeBenito 747ab1
files_search_var_lib(amavis_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# log files
Chris PeBenito c0868a
allow amavis_t amavis_var_log_t:dir setattr;
Chris PeBenito c0868a
manage_files_pattern(amavis_t,amavis_var_log_t,amavis_var_log_t)
Chris PeBenito c0868a
manage_sock_files_pattern(amavis_t,amavis_var_log_t,amavis_var_log_t)
Chris PeBenito 17de1b
logging_log_filetrans(amavis_t,amavis_var_log_t,{ sock_file file dir })
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# pid file
Chris PeBenito c0868a
manage_files_pattern(amavis_t,amavis_var_run_t,amavis_var_run_t)
Chris PeBenito c0868a
manage_sock_files_pattern(amavis_t,amavis_var_run_t,amavis_var_run_t)
Chris PeBenito 17de1b
files_pid_filetrans(amavis_t,amavis_var_run_t, { file sock_file })
Chris PeBenito 17de1b
Chris PeBenito 17de1b
kernel_read_kernel_sysctls(amavis_t)
Chris PeBenito 17de1b
# amavis tries to access /proc/self/stat, /etc/shadow and /root - perl...
Chris PeBenito 17de1b
kernel_dontaudit_list_proc(amavis_t)
Chris PeBenito 17de1b
kernel_dontaudit_read_proc_symlinks(amavis_t)
Chris PeBenito 17de1b
kernel_dontaudit_read_system_state(amavis_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# find perl
Chris PeBenito 17de1b
corecmd_exec_bin(amavis_t)
Chris PeBenito 17de1b
Chris PeBenito 190066
corenet_all_recvfrom_unlabeled(amavis_t)
Chris PeBenito 190066
corenet_all_recvfrom_netlabel(amavis_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_if(amavis_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_nodes(amavis_t)
Chris PeBenito 17de1b
corenet_tcp_bind_all_nodes(amavis_t)
Chris PeBenito 17de1b
corenet_udp_bind_all_nodes(amavis_t)
Chris PeBenito 17de1b
# amavis uses well-defined ports
Chris PeBenito 17de1b
corenet_tcp_sendrecv_amavisd_recv_port(amavis_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_amavisd_send_port(amavis_t)
Chris PeBenito 17de1b
# just the other side not. ;-)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_ports(amavis_t)
Chris PeBenito 17de1b
# connect to backchannel port
Chris PeBenito 17de1b
corenet_tcp_connect_amavisd_send_port(amavis_t)
Chris PeBenito 17de1b
# bind to incoming port
Chris PeBenito 17de1b
corenet_tcp_bind_amavisd_recv_port(amavis_t)
Chris PeBenito 17de1b
corenet_udp_bind_generic_port(amavis_t)
Chris PeBenito a5e213
corenet_tcp_connect_razor_port(amavis_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
dev_read_rand(amavis_t)
Chris PeBenito 17de1b
dev_read_urand(amavis_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
domain_use_interactive_fds(amavis_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
files_read_etc_files(amavis_t)
Chris PeBenito 17de1b
files_read_etc_runtime_files(amavis_t)
Chris PeBenito 17de1b
files_read_usr_files(amavis_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
auth_dontaudit_read_shadow(amavis_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
init_stream_connect_script(amavis_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
libs_use_ld_so(amavis_t)
Chris PeBenito 17de1b
libs_use_shared_libs(amavis_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
logging_send_syslog_msg(amavis_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
miscfiles_read_localization(amavis_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
sysnet_dns_name_resolve(amavis_t)
Chris PeBenito 13d7ce
sysnet_use_ldap(amavis_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
userdom_dontaudit_search_sysadm_home_dirs(amavis_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# Cron handling
Chris PeBenito 17de1b
cron_use_fds(amavis_t)
Chris PeBenito 17de1b
cron_use_system_job_fds(amavis_t)
Chris PeBenito 17de1b
cron_rw_pipes(amavis_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
mta_read_config(amavis_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	clamav_stream_connect(amavis_t)
Chris PeBenito 17de1b
	clamav_domtrans_clamscan(amavis_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	dcc_domtrans_client(amavis_t)
Chris PeBenito 17de1b
	dcc_stream_connect_dccifd(amavis_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito a5e213
	postfix_read_config(amavis_t)
Chris PeBenito a5e213
')
Chris PeBenito a5e213
Chris PeBenito a5e213
optional_policy(`
Chris PeBenito 17de1b
	pyzor_domtrans(amavis_t)
Chris PeBenito 6dd721
	pyzor_signal(amavis_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	razor_domtrans(amavis_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	spamassassin_exec(amavis_t)
Chris PeBenito 17de1b
	spamassassin_exec_client(amavis_t)
Chris PeBenito 747ab1
	spamassassin_read_lib_files(amavis_t)
Chris PeBenito 17de1b
')