2005-05-16 21:11:26 +00:00
|
|
|
|
2010-05-20 12:36:38 +00:00
|
|
|
policy_module(sendmail, 1.10.2)
|
2005-05-16 21:11:26 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
|
|
|
type sendmail_log_t;
|
2005-06-13 17:35:46 +00:00
|
|
|
logging_log_file(sendmail_log_t)
|
2005-05-16 21:11:26 +00:00
|
|
|
|
|
|
|
type sendmail_tmp_t;
|
2005-06-13 17:35:46 +00:00
|
|
|
files_tmp_file(sendmail_tmp_t)
|
2005-05-16 21:11:26 +00:00
|
|
|
|
|
|
|
type sendmail_var_run_t;
|
2005-06-13 17:35:46 +00:00
|
|
|
files_pid_file(sendmail_var_run_t)
|
2005-05-16 21:11:26 +00:00
|
|
|
|
2006-01-06 22:51:40 +00:00
|
|
|
type sendmail_t;
|
|
|
|
mta_sendmail_mailserver(sendmail_t)
|
|
|
|
mta_mailserver_delivery(sendmail_t)
|
|
|
|
mta_mailserver_sender(sendmail_t)
|
2005-10-28 18:57:23 +00:00
|
|
|
|
2010-01-08 15:37:37 +00:00
|
|
|
type unconfined_sendmail_t;
|
|
|
|
application_domain(unconfined_sendmail_t, sendmail_exec_t)
|
|
|
|
role system_r types unconfined_sendmail_t;
|
|
|
|
|
2005-05-16 21:11:26 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Sendmail local policy
|
|
|
|
#
|
|
|
|
|
2010-01-08 15:37:37 +00:00
|
|
|
allow sendmail_t self:capability { dac_override setuid setgid net_bind_service sys_nice chown sys_tty_config };
|
2010-05-20 12:36:38 +00:00
|
|
|
allow sendmail_t self:process { setsched setpgid setrlimit signal signull };
|
2006-12-12 20:08:08 +00:00
|
|
|
allow sendmail_t self:fifo_file rw_fifo_file_perms;
|
2005-06-09 15:32:23 +00:00
|
|
|
allow sendmail_t self:unix_stream_socket create_stream_socket_perms;
|
|
|
|
allow sendmail_t self:unix_dgram_socket create_socket_perms;
|
2006-01-06 22:51:40 +00:00
|
|
|
allow sendmail_t self:tcp_socket create_stream_socket_perms;
|
2006-01-17 17:50:10 +00:00
|
|
|
allow sendmail_t self:udp_socket create_socket_perms;
|
2005-05-16 21:11:26 +00:00
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
allow sendmail_t sendmail_log_t:dir setattr;
|
2008-07-23 21:38:39 +00:00
|
|
|
manage_files_pattern(sendmail_t, sendmail_log_t, sendmail_log_t)
|
|
|
|
logging_log_filetrans(sendmail_t, sendmail_log_t, { file dir })
|
2005-11-09 15:51:22 +00:00
|
|
|
|
2008-07-23 21:38:39 +00:00
|
|
|
manage_dirs_pattern(sendmail_t, sendmail_tmp_t, sendmail_tmp_t)
|
|
|
|
manage_files_pattern(sendmail_t, sendmail_tmp_t, sendmail_tmp_t)
|
2006-09-22 17:14:35 +00:00
|
|
|
files_tmp_filetrans(sendmail_t, sendmail_tmp_t, { file dir })
|
|
|
|
|
|
|
|
allow sendmail_t sendmail_var_run_t:file manage_file_perms;
|
2008-07-23 21:38:39 +00:00
|
|
|
files_pid_filetrans(sendmail_t, sendmail_var_run_t, file)
|
2006-09-22 17:14:35 +00:00
|
|
|
|
2010-01-08 15:37:37 +00:00
|
|
|
kernel_read_network_state(sendmail_t)
|
2006-01-31 16:49:43 +00:00
|
|
|
kernel_read_kernel_sysctls(sendmail_t)
|
2005-08-30 20:47:41 +00:00
|
|
|
# for piping mail to a command
|
|
|
|
kernel_read_system_state(sendmail_t)
|
2005-05-16 21:11:26 +00:00
|
|
|
|
2007-06-27 15:23:21 +00:00
|
|
|
corenet_all_recvfrom_unlabeled(sendmail_t)
|
|
|
|
corenet_all_recvfrom_netlabel(sendmail_t)
|
2009-01-06 20:24:10 +00:00
|
|
|
corenet_tcp_sendrecv_generic_if(sendmail_t)
|
2009-01-09 19:48:02 +00:00
|
|
|
corenet_tcp_sendrecv_generic_node(sendmail_t)
|
2005-06-10 01:01:13 +00:00
|
|
|
corenet_tcp_sendrecv_all_ports(sendmail_t)
|
2009-01-09 19:48:02 +00:00
|
|
|
corenet_tcp_bind_generic_node(sendmail_t)
|
2005-06-10 01:01:13 +00:00
|
|
|
corenet_tcp_bind_smtp_port(sendmail_t)
|
2005-09-12 21:40:56 +00:00
|
|
|
corenet_tcp_connect_all_ports(sendmail_t)
|
2006-05-26 20:29:51 +00:00
|
|
|
corenet_sendrecv_smtp_server_packets(sendmail_t)
|
|
|
|
corenet_sendrecv_smtp_client_packets(sendmail_t)
|
2005-05-16 21:11:26 +00:00
|
|
|
|
2005-06-13 16:22:32 +00:00
|
|
|
dev_read_urand(sendmail_t)
|
2005-07-12 20:34:24 +00:00
|
|
|
dev_read_sysfs(sendmail_t)
|
2005-05-16 21:11:26 +00:00
|
|
|
|
2005-06-10 01:01:13 +00:00
|
|
|
fs_getattr_all_fs(sendmail_t)
|
2005-06-27 16:30:55 +00:00
|
|
|
fs_search_auto_mountpoints(sendmail_t)
|
2010-01-08 15:37:37 +00:00
|
|
|
fs_rw_anon_inodefs_files(sendmail_t)
|
2005-05-16 21:11:26 +00:00
|
|
|
|
2005-06-10 01:01:13 +00:00
|
|
|
term_dontaudit_use_console(sendmail_t)
|
2010-05-20 12:36:38 +00:00
|
|
|
term_dontaudit_use_generic_ptys(sendmail_t)
|
2005-05-16 21:11:26 +00:00
|
|
|
|
2005-08-30 20:47:41 +00:00
|
|
|
# for piping mail to a command
|
|
|
|
corecmd_exec_shell(sendmail_t)
|
2010-01-08 15:37:37 +00:00
|
|
|
corecmd_exec_bin(sendmail_t)
|
2005-08-30 20:47:41 +00:00
|
|
|
|
2006-02-20 21:33:25 +00:00
|
|
|
domain_use_interactive_fds(sendmail_t)
|
2005-05-16 21:11:26 +00:00
|
|
|
|
2005-06-29 14:26:41 +00:00
|
|
|
files_read_etc_files(sendmail_t)
|
2010-01-08 15:37:37 +00:00
|
|
|
files_read_usr_files(sendmail_t)
|
2005-06-13 17:35:46 +00:00
|
|
|
files_search_spool(sendmail_t)
|
2005-08-30 20:47:41 +00:00
|
|
|
# for piping mail to a command
|
|
|
|
files_read_etc_runtime_files(sendmail_t)
|
2005-05-16 21:11:26 +00:00
|
|
|
|
2006-03-02 23:41:11 +00:00
|
|
|
init_use_fds(sendmail_t)
|
2006-02-02 21:08:12 +00:00
|
|
|
init_use_script_ptys(sendmail_t)
|
2005-06-27 16:30:55 +00:00
|
|
|
# sendmail wants to read /var/run/utmp if the controlling tty is /dev/console
|
2006-01-18 18:08:39 +00:00
|
|
|
init_read_utmp(sendmail_t)
|
|
|
|
init_dontaudit_write_utmp(sendmail_t)
|
2005-05-16 21:11:26 +00:00
|
|
|
|
2007-12-06 16:04:14 +00:00
|
|
|
auth_use_nsswitch(sendmail_t)
|
|
|
|
|
2005-05-16 21:11:26 +00:00
|
|
|
# Read /usr/lib/sasl2/.*
|
2006-02-02 21:08:12 +00:00
|
|
|
libs_read_lib_files(sendmail_t)
|
2005-05-16 21:11:26 +00:00
|
|
|
|
2005-06-27 16:30:55 +00:00
|
|
|
logging_send_syslog_msg(sendmail_t)
|
2010-01-08 15:37:37 +00:00
|
|
|
logging_dontaudit_write_generic_logs(sendmail_t)
|
2005-06-27 16:30:55 +00:00
|
|
|
|
2007-08-27 17:00:18 +00:00
|
|
|
miscfiles_read_certs(sendmail_t)
|
2005-05-16 21:11:26 +00:00
|
|
|
miscfiles_read_localization(sendmail_t)
|
|
|
|
|
2006-02-20 21:33:25 +00:00
|
|
|
userdom_dontaudit_use_unpriv_user_fds(sendmail_t)
|
2008-11-05 16:10:46 +00:00
|
|
|
userdom_dontaudit_search_user_home_dirs(sendmail_t)
|
2005-07-12 20:34:24 +00:00
|
|
|
|
2006-01-17 17:50:10 +00:00
|
|
|
mta_read_config(sendmail_t)
|
2006-02-21 18:40:44 +00:00
|
|
|
mta_etc_filetrans_aliases(sendmail_t)
|
2005-05-16 21:11:26 +00:00
|
|
|
# Write to /etc/aliases and /etc/mail.
|
2010-01-08 15:37:37 +00:00
|
|
|
mta_manage_aliases(sendmail_t)
|
2005-05-16 21:11:26 +00:00
|
|
|
# Write to /var/spool/mail and /var/spool/mqueue.
|
2005-06-13 17:35:46 +00:00
|
|
|
mta_manage_queue(sendmail_t)
|
|
|
|
mta_manage_spool(sendmail_t)
|
2010-01-08 15:37:37 +00:00
|
|
|
mta_sendmail_exec(sendmail_t)
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
cron_read_pipes(sendmail_t)
|
|
|
|
')
|
2005-05-16 21:11:26 +00:00
|
|
|
|
2007-02-16 23:01:42 +00:00
|
|
|
optional_policy(`
|
|
|
|
clamav_search_lib(sendmail_t)
|
2010-01-08 15:37:37 +00:00
|
|
|
clamav_stream_connect(sendmail_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
cyrus_stream_connect(sendmail_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
exim_domtrans(sendmail_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
fail2ban_read_lib_files(sendmail_t)
|
2010-05-20 12:36:38 +00:00
|
|
|
fail2ban_rw_stream_sockets(sendmail_t)
|
2010-01-08 15:37:37 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
kerberos_keytab_template(sendmail, sendmail_t)
|
2007-02-16 23:01:42 +00:00
|
|
|
')
|
|
|
|
|
2008-11-24 15:06:58 +00:00
|
|
|
optional_policy(`
|
|
|
|
milter_stream_connect_all(sendmail_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2010-01-08 15:37:37 +00:00
|
|
|
munin_dontaudit_search_lib(sendmail_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
postfix_domtrans_master(sendmail_t)
|
2005-10-23 20:18:36 +00:00
|
|
|
postfix_read_config(sendmail_t)
|
|
|
|
postfix_search_spool(sendmail_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2006-01-06 22:51:40 +00:00
|
|
|
procmail_domtrans(sendmail_t)
|
2010-01-08 15:37:37 +00:00
|
|
|
procmail_rw_tmp_files(sendmail_t)
|
2006-01-06 22:51:40 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-06-29 14:26:41 +00:00
|
|
|
seutil_sigchld_newrole(sendmail_t)
|
2005-05-16 21:11:26 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2010-01-08 15:37:37 +00:00
|
|
|
sasl_connect(sendmail_t)
|
2005-05-16 21:11:26 +00:00
|
|
|
')
|
|
|
|
|
2010-01-08 15:37:37 +00:00
|
|
|
optional_policy(`
|
|
|
|
udev_read_db(sendmail_t)
|
|
|
|
')
|
2005-05-16 21:11:26 +00:00
|
|
|
|
2010-01-08 15:37:37 +00:00
|
|
|
optional_policy(`
|
|
|
|
uucp_domtrans_uux(sendmail_t)
|
|
|
|
')
|
2005-05-16 21:11:26 +00:00
|
|
|
|
2010-01-08 15:37:37 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Unconfined sendmail local policy
|
|
|
|
# Allow unconfined domain to run newalias and have transitions work
|
|
|
|
#
|
2005-05-16 21:11:26 +00:00
|
|
|
|
2010-01-08 15:37:37 +00:00
|
|
|
optional_policy(`
|
|
|
|
mta_etc_filetrans_aliases(unconfined_sendmail_t)
|
|
|
|
unconfined_domain(unconfined_sendmail_t)
|
|
|
|
')
|