|
Chris PeBenito |
29af4c |
policy_module(amavis, 1.11.0)
|
|
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 |
967fd1 |
files_config_file(amavis_etc_t)
|
|
Chris PeBenito |
967fd1 |
|
|
Chris PeBenito |
967fd1 |
type amavis_initrc_exec_t;
|
|
Chris PeBenito |
967fd1 |
init_script_file(amavis_initrc_exec_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 |
0bfccd |
read_files_pattern(amavis_t, amavis_etc_t, amavis_etc_t)
|
|
Chris PeBenito |
0bfccd |
read_lnk_files_pattern(amavis_t, amavis_etc_t, amavis_etc_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
967fd1 |
can_exec(amavis_t, amavis_exec_t)
|
|
Chris PeBenito |
967fd1 |
|
|
Chris PeBenito |
17de1b |
# mail quarantine
|
|
Chris PeBenito |
0bfccd |
manage_dirs_pattern(amavis_t, amavis_quarantine_t, amavis_quarantine_t)
|
|
Chris PeBenito |
0bfccd |
manage_files_pattern(amavis_t, amavis_quarantine_t, amavis_quarantine_t)
|
|
Chris PeBenito |
0bfccd |
manage_sock_files_pattern(amavis_t, amavis_quarantine_t, amavis_quarantine_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# Spool Files
|
|
Chris PeBenito |
0bfccd |
manage_dirs_pattern(amavis_t, amavis_spool_t, amavis_spool_t)
|
|
Chris PeBenito |
0bfccd |
manage_files_pattern(amavis_t, amavis_spool_t, amavis_spool_t)
|
|
Chris PeBenito |
ee6608 |
manage_lnk_files_pattern(amavis_t, amavis_spool_t, amavis_spool_t)
|
|
Chris PeBenito |
0bfccd |
manage_sock_files_pattern(amavis_t, amavis_spool_t, amavis_spool_t)
|
|
Chris PeBenito |
0bfccd |
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 |
0bfccd |
manage_files_pattern(amavis_t, amavis_tmp_t, amavis_tmp_t)
|
|
Chris PeBenito |
c0868a |
allow amavis_t amavis_tmp_t:dir setattr;
|
|
Chris PeBenito |
3f67f7 |
files_tmp_filetrans(amavis_t, amavis_tmp_t, file)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# var/lib files for amavis
|
|
Chris PeBenito |
0bfccd |
manage_dirs_pattern(amavis_t, amavis_var_lib_t, amavis_var_lib_t)
|
|
Chris PeBenito |
0bfccd |
manage_files_pattern(amavis_t, amavis_var_lib_t, amavis_var_lib_t)
|
|
Chris PeBenito |
0bfccd |
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 |
0bfccd |
manage_files_pattern(amavis_t, amavis_var_log_t, amavis_var_log_t)
|
|
Chris PeBenito |
0bfccd |
manage_sock_files_pattern(amavis_t, amavis_var_log_t, amavis_var_log_t)
|
|
Chris PeBenito |
0bfccd |
logging_log_filetrans(amavis_t, amavis_var_log_t, { sock_file file dir })
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# pid file
|
|
Dan Walsh |
3eaa99 |
manage_dirs_pattern(amavis_t, amavis_var_run_t, amavis_var_run_t)
|
|
Chris PeBenito |
0bfccd |
manage_files_pattern(amavis_t, amavis_var_run_t, amavis_var_run_t)
|
|
Chris PeBenito |
0bfccd |
manage_sock_files_pattern(amavis_t, amavis_var_run_t, amavis_var_run_t)
|
|
Dan Walsh |
3eaa99 |
files_pid_filetrans(amavis_t, amavis_var_run_t, { file sock_file dir })
|
|
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 |
668b30 |
corenet_tcp_sendrecv_generic_if(amavis_t)
|
|
Chris PeBenito |
c12621 |
corenet_tcp_sendrecv_generic_node(amavis_t)
|
|
Chris PeBenito |
c12621 |
corenet_tcp_bind_generic_node(amavis_t)
|
|
Chris PeBenito |
c12621 |
corenet_udp_bind_generic_node(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 |
ee6608 |
corenet_dontaudit_udp_bind_all_ports(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 |
5894c3 |
fs_getattr_xattr_fs(amavis_t)
|
|
Chris PeBenito |
5894c3 |
|
|
Chris PeBenito |
17de1b |
auth_dontaudit_read_shadow(amavis_t)
|
|
Chris PeBenito |
17de1b |
|
|
Jeremy Solt |
6a0354 |
# uses uptime which reads utmp - redhat bug 561383
|
|
Jeremy Solt |
6a0354 |
init_read_utmp(amavis_t)
|
|
Chris PeBenito |
17de1b |
init_stream_connect_script(amavis_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
logging_send_syslog_msg(amavis_t)
|
|
Chris PeBenito |
17de1b |
|
|
Jeremy Solt |
6a0354 |
miscfiles_read_certs(amavis_t)
|
|
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 |
296273 |
userdom_dontaudit_search_user_home_dirs(amavis_t)
|
|
Chris PeBenito |
296273 |
|
|
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 |
')
|