Chris PeBenito 29af4c
policy_module(sendmail, 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 sendmail_log_t;
Chris PeBenito 17de1b
logging_log_file(sendmail_log_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type sendmail_tmp_t;
Chris PeBenito 17de1b
files_tmp_file(sendmail_tmp_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type sendmail_var_run_t;
Chris PeBenito 17de1b
files_pid_file(sendmail_var_run_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type sendmail_t;
Chris PeBenito 17de1b
mta_sendmail_mailserver(sendmail_t)
Chris PeBenito 17de1b
mta_mailserver_delivery(sendmail_t)
Chris PeBenito 17de1b
mta_mailserver_sender(sendmail_t)
Chris PeBenito 17de1b
Dan Walsh 3eaa99
type sendmail_initrc_exec_t;
Dan Walsh 3eaa99
init_script_file(sendmail_initrc_exec_t)
Dan Walsh 3eaa99
Chris PeBenito c155e0
type unconfined_sendmail_t;
Chris PeBenito c155e0
application_domain(unconfined_sendmail_t, sendmail_exec_t)
Chris PeBenito c155e0
role system_r types unconfined_sendmail_t;
Chris PeBenito c155e0
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Sendmail local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito c155e0
allow sendmail_t self:capability { dac_override setuid setgid net_bind_service sys_nice chown sys_tty_config };
Chris PeBenito 9ea85e
allow sendmail_t self:process { setsched setpgid setrlimit signal signull };
Chris PeBenito c0868a
allow sendmail_t self:fifo_file rw_fifo_file_perms;
Chris PeBenito 17de1b
allow sendmail_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 17de1b
allow sendmail_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 17de1b
allow sendmail_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito 17de1b
allow sendmail_t self:udp_socket create_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito c0868a
allow sendmail_t sendmail_log_t:dir setattr;
Chris PeBenito 0bfccd
manage_files_pattern(sendmail_t, sendmail_log_t, sendmail_log_t)
Chris PeBenito 0bfccd
logging_log_filetrans(sendmail_t, sendmail_log_t, { file dir })
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
manage_dirs_pattern(sendmail_t, sendmail_tmp_t, sendmail_tmp_t)
Chris PeBenito 0bfccd
manage_files_pattern(sendmail_t, sendmail_tmp_t, sendmail_tmp_t)
Chris PeBenito 8708d9
files_tmp_filetrans(sendmail_t, sendmail_tmp_t, { file dir })
Chris PeBenito 8708d9
Chris PeBenito 8708d9
allow sendmail_t sendmail_var_run_t:file manage_file_perms;
Chris PeBenito 0bfccd
files_pid_filetrans(sendmail_t, sendmail_var_run_t, file)
Chris PeBenito 8708d9
Chris PeBenito c155e0
kernel_read_network_state(sendmail_t)
Chris PeBenito 17de1b
kernel_read_kernel_sysctls(sendmail_t)
Chris PeBenito 17de1b
# for piping mail to a command
Chris PeBenito 17de1b
kernel_read_system_state(sendmail_t)
Chris PeBenito 17de1b
Chris PeBenito 190066
corenet_all_recvfrom_unlabeled(sendmail_t)
Chris PeBenito 190066
corenet_all_recvfrom_netlabel(sendmail_t)
Chris PeBenito 668b30
corenet_tcp_sendrecv_generic_if(sendmail_t)
Chris PeBenito c12621
corenet_tcp_sendrecv_generic_node(sendmail_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_ports(sendmail_t)
Chris PeBenito c12621
corenet_tcp_bind_generic_node(sendmail_t)
Chris PeBenito 17de1b
corenet_tcp_bind_smtp_port(sendmail_t)
Chris PeBenito 17de1b
corenet_tcp_connect_all_ports(sendmail_t)
Chris PeBenito 17de1b
corenet_sendrecv_smtp_server_packets(sendmail_t)
Chris PeBenito 17de1b
corenet_sendrecv_smtp_client_packets(sendmail_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
dev_read_urand(sendmail_t)
Chris PeBenito 17de1b
dev_read_sysfs(sendmail_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
fs_getattr_all_fs(sendmail_t)
Chris PeBenito 17de1b
fs_search_auto_mountpoints(sendmail_t)
Chris PeBenito c155e0
fs_rw_anon_inodefs_files(sendmail_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
term_dontaudit_use_console(sendmail_t)
Chris PeBenito 9ea85e
term_dontaudit_use_generic_ptys(sendmail_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# for piping mail to a command
Chris PeBenito 17de1b
corecmd_exec_shell(sendmail_t)
Chris PeBenito c155e0
corecmd_exec_bin(sendmail_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
domain_use_interactive_fds(sendmail_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
files_read_etc_files(sendmail_t)
Chris PeBenito c155e0
files_read_usr_files(sendmail_t)
Chris PeBenito 17de1b
files_search_spool(sendmail_t)
Chris PeBenito 17de1b
# for piping mail to a command
Chris PeBenito 17de1b
files_read_etc_runtime_files(sendmail_t)
Dan Walsh 3eaa99
files_read_all_tmp_files(sendmail_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
init_use_fds(sendmail_t)
Chris PeBenito 17de1b
init_use_script_ptys(sendmail_t)
Chris PeBenito 17de1b
# sendmail wants to read /var/run/utmp if the controlling tty is /dev/console
Chris PeBenito 17de1b
init_read_utmp(sendmail_t)
Chris PeBenito 17de1b
init_dontaudit_write_utmp(sendmail_t)
Dan Walsh 3eaa99
init_rw_script_tmp_files(sendmail_t)
Chris PeBenito 17de1b
Chris PeBenito 09e216
auth_use_nsswitch(sendmail_t)
Chris PeBenito 09e216
Chris PeBenito 17de1b
# Read /usr/lib/sasl2/.*
Chris PeBenito 17de1b
libs_read_lib_files(sendmail_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
logging_send_syslog_msg(sendmail_t)
Chris PeBenito c155e0
logging_dontaudit_write_generic_logs(sendmail_t)
Chris PeBenito 17de1b
Chris PeBenito a2f444
miscfiles_read_certs(sendmail_t)
Chris PeBenito 17de1b
miscfiles_read_localization(sendmail_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
userdom_dontaudit_use_unpriv_user_fds(sendmail_t)
Dan Walsh 3eaa99
userdom_read_user_home_content_files(sendmail_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
mta_read_config(sendmail_t)
Chris PeBenito 17de1b
mta_etc_filetrans_aliases(sendmail_t)
Chris PeBenito 17de1b
# Write to /etc/aliases and /etc/mail.
Chris PeBenito c155e0
mta_manage_aliases(sendmail_t)
Chris PeBenito 17de1b
# Write to /var/spool/mail and /var/spool/mqueue.
Chris PeBenito 17de1b
mta_manage_queue(sendmail_t)
Chris PeBenito 17de1b
mta_manage_spool(sendmail_t)
Chris PeBenito c155e0
mta_sendmail_exec(sendmail_t)
Chris PeBenito c155e0
Chris PeBenito c155e0
optional_policy(`
Chris PeBenito c155e0
	cron_read_pipes(sendmail_t)
Chris PeBenito c155e0
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 6b19be
	clamav_search_lib(sendmail_t)
Chris PeBenito c155e0
	clamav_stream_connect(sendmail_t)
Chris PeBenito c155e0
')
Chris PeBenito c155e0
Chris PeBenito c155e0
optional_policy(`
Chris PeBenito c155e0
	cyrus_stream_connect(sendmail_t)
Chris PeBenito c155e0
')
Chris PeBenito c155e0
Chris PeBenito c155e0
optional_policy(`
Chris PeBenito c155e0
	exim_domtrans(sendmail_t)
Chris PeBenito c155e0
')
Chris PeBenito c155e0
Chris PeBenito c155e0
optional_policy(`
Chris PeBenito c155e0
	fail2ban_read_lib_files(sendmail_t)
Chris PeBenito 9ea85e
	fail2ban_rw_stream_sockets(sendmail_t)
Chris PeBenito c155e0
')
Chris PeBenito c155e0
Chris PeBenito c155e0
optional_policy(`
Chris PeBenito c155e0
	kerberos_keytab_template(sendmail, sendmail_t)
Chris PeBenito 6b19be
')
Chris PeBenito 6b19be
Chris PeBenito 6b19be
optional_policy(`
Chris PeBenito b9e523
	milter_stream_connect_all(sendmail_t)
Chris PeBenito b9e523
')
Chris PeBenito b9e523
Chris PeBenito b9e523
optional_policy(`
Chris PeBenito c155e0
	munin_dontaudit_search_lib(sendmail_t)
Chris PeBenito c155e0
')
Chris PeBenito c155e0
Chris PeBenito c155e0
optional_policy(`
Dan Walsh 3eaa99
	postfix_domtrans_postdrop(sendmail_t)
Chris PeBenito c155e0
	postfix_domtrans_master(sendmail_t)
Dan Walsh 3eaa99
	postfix_domtrans_postqueue(sendmail_t)
Chris PeBenito 17de1b
	postfix_read_config(sendmail_t)
Chris PeBenito 17de1b
	postfix_search_spool(sendmail_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	procmail_domtrans(sendmail_t)
Chris PeBenito c155e0
	procmail_rw_tmp_files(sendmail_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	seutil_sigchld_newrole(sendmail_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito c155e0
	sasl_connect(sendmail_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito c155e0
optional_policy(`
Dan Walsh 3eaa99
	spamd_stream_connect(sendmail_t)
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
optional_policy(`
Chris PeBenito c155e0
	udev_read_db(sendmail_t)
Chris PeBenito c155e0
')
Chris PeBenito 17de1b
Chris PeBenito c155e0
optional_policy(`
Chris PeBenito c155e0
	uucp_domtrans_uux(sendmail_t)
Chris PeBenito c155e0
')
Chris PeBenito 17de1b
Chris PeBenito c155e0
########################################
Chris PeBenito c155e0
#
Chris PeBenito c155e0
# Unconfined sendmail local policy
Chris PeBenito c155e0
# Allow unconfined domain to run newalias and have transitions work
Chris PeBenito c155e0
#
Chris PeBenito 17de1b
Chris PeBenito c155e0
optional_policy(`
Chris PeBenito c155e0
	mta_etc_filetrans_aliases(unconfined_sendmail_t)
Dan Walsh 3eaa99
	unconfined_domain_noaudit(unconfined_sendmail_t)
Chris PeBenito c155e0
')