Chris PeBenito 650e75
Chris PeBenito d3d270
policy_module(sendmail,1.2.0)
Chris PeBenito 650e75
Chris PeBenito 650e75
########################################
Chris PeBenito 650e75
#
Chris PeBenito 650e75
# Declarations
Chris PeBenito 650e75
#
Chris PeBenito 650e75
Chris PeBenito 650e75
type sendmail_log_t;
Chris PeBenito c9428d
logging_log_file(sendmail_log_t)
Chris PeBenito 650e75
Chris PeBenito 650e75
type sendmail_tmp_t;
Chris PeBenito c9428d
files_tmp_file(sendmail_tmp_t)
Chris PeBenito 650e75
Chris PeBenito 650e75
type sendmail_var_run_t;
Chris PeBenito c9428d
files_pid_file(sendmail_var_run_t)
Chris PeBenito 650e75
Chris PeBenito bf080a
type sendmail_t;
Chris PeBenito bf080a
mta_sendmail_mailserver(sendmail_t)
Chris PeBenito bf080a
mta_mailserver_delivery(sendmail_t)
Chris PeBenito bf080a
mta_mailserver_sender(sendmail_t)
Chris PeBenito dc8f17
Chris PeBenito 650e75
########################################
Chris PeBenito 650e75
#
Chris PeBenito 650e75
# Sendmail local policy
Chris PeBenito 650e75
#
Chris PeBenito 650e75
Chris PeBenito 650e75
allow sendmail_t self:capability { setuid setgid net_bind_service sys_nice chown sys_tty_config };
Chris PeBenito bf080a
allow sendmail_t self:process signal;
Chris PeBenito 0a10b1
allow sendmail_t self:fifo_file rw_file_perms;
Chris PeBenito 0a10b1
allow sendmail_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 0a10b1
allow sendmail_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito bf080a
allow sendmail_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito 93727e
allow sendmail_t self:udp_socket create_socket_perms;
Chris PeBenito 650e75
Chris PeBenito d3f715
allow sendmail_t sendmail_log_t:file create_file_perms;
Chris PeBenito d3f715
allow sendmail_t sendmail_log_t:dir { rw_dir_perms setattr };
Chris PeBenito 103fe2
logging_log_filetrans(sendmail_t,sendmail_log_t,{ file dir })
Chris PeBenito d3f715
Chris PeBenito 445522
kernel_read_kernel_sysctls(sendmail_t)
Chris PeBenito 246839
# for piping mail to a command
Chris PeBenito 246839
kernel_read_system_state(sendmail_t)
Chris PeBenito 650e75
Chris PeBenito 0fd9dc
corenet_tcp_sendrecv_all_if(sendmail_t)
Chris PeBenito 0fd9dc
corenet_raw_sendrecv_all_if(sendmail_t)
Chris PeBenito 0fd9dc
corenet_udp_sendrecv_all_if(sendmail_t)
Chris PeBenito 0fd9dc
corenet_tcp_sendrecv_all_nodes(sendmail_t)
Chris PeBenito 0fd9dc
corenet_raw_sendrecv_all_nodes(sendmail_t)
Chris PeBenito 0fd9dc
corenet_udp_sendrecv_all_nodes(sendmail_t)
Chris PeBenito 0fd9dc
corenet_tcp_sendrecv_all_ports(sendmail_t)
Chris PeBenito 0fd9dc
corenet_udp_sendrecv_all_ports(sendmail_t)
Chris PeBenito bd7037
corenet_non_ipsec_sendrecv(sendmail_t)
Chris PeBenito 0fd9dc
corenet_tcp_bind_all_nodes(sendmail_t)
Chris PeBenito 0fd9dc
corenet_udp_bind_all_nodes(sendmail_t)
Chris PeBenito 0fd9dc
corenet_tcp_bind_smtp_port(sendmail_t)
Chris PeBenito 2705f9
corenet_tcp_connect_all_ports(sendmail_t)
Chris PeBenito 650e75
Karl MacMillan f0c985
dev_read_urand(sendmail_t)
Chris PeBenito b24f35
dev_read_sysfs(sendmail_t)
Chris PeBenito 650e75
Chris PeBenito 0fd9dc
fs_getattr_all_fs(sendmail_t)
Chris PeBenito ab940a
fs_search_auto_mountpoints(sendmail_t)
Chris PeBenito 650e75
Chris PeBenito 0fd9dc
term_dontaudit_use_console(sendmail_t)
Chris PeBenito 650e75
Chris PeBenito 246839
# for piping mail to a command
Chris PeBenito 246839
corecmd_exec_shell(sendmail_t)
Chris PeBenito b0d224
corecmd_search_sbin(sendmail_t)
Chris PeBenito 246839
Chris PeBenito 15722e
domain_use_interactive_fds(sendmail_t)
Chris PeBenito 650e75
Chris PeBenito 8fd367
files_read_etc_files(sendmail_t)
Chris PeBenito c9428d
files_search_spool(sendmail_t)
Chris PeBenito 246839
# for piping mail to a command
Chris PeBenito 246839
files_read_etc_runtime_files(sendmail_t)
Chris PeBenito 650e75
Chris PeBenito 1c1ac6
init_use_fds(sendmail_t)
Chris PeBenito 1815ba
init_use_script_ptys(sendmail_t)
Chris PeBenito ab940a
# sendmail wants to read /var/run/utmp if the controlling tty is /dev/console
Chris PeBenito 68228b
init_read_utmp(sendmail_t)
Chris PeBenito 68228b
init_dontaudit_write_utmp(sendmail_t)
Chris PeBenito 650e75
Chris PeBenito c9428d
libs_use_ld_so(sendmail_t)
Chris PeBenito c9428d
libs_use_shared_libs(sendmail_t)
Chris PeBenito 650e75
# Read /usr/lib/sasl2/.*
Chris PeBenito 1815ba
libs_read_lib_files(sendmail_t)
Chris PeBenito 650e75
Chris PeBenito ab940a
logging_send_syslog_msg(sendmail_t)
Chris PeBenito ab940a
Chris PeBenito 650e75
miscfiles_read_localization(sendmail_t)
Chris PeBenito 650e75
Chris PeBenito ab940a
sysnet_read_config(sendmail_t)
Chris PeBenito ab940a
Chris PeBenito 15722e
userdom_dontaudit_use_unpriv_user_fds(sendmail_t)
Chris PeBenito 103fe2
userdom_dontaudit_search_sysadm_home_dirs(sendmail_t)
Chris PeBenito b24f35
Chris PeBenito 93727e
mta_read_config(sendmail_t)
Chris PeBenito 103fe2
mta_etc_filetrans_aliases(sendmail_t)
Chris PeBenito 650e75
# Write to /etc/aliases and /etc/mail.
Chris PeBenito c9428d
mta_rw_aliases(sendmail_t)
Chris PeBenito 650e75
# Write to /var/spool/mail and /var/spool/mqueue.
Chris PeBenito c9428d
mta_manage_queue(sendmail_t)
Chris PeBenito c9428d
mta_manage_spool(sendmail_t)
Chris PeBenito 650e75
Chris PeBenito 142e9f
ifdef(`targeted_policy',`
Chris PeBenito 955019
	unconfined_domain(sendmail_t)
Chris PeBenito 1815ba
	term_dontaudit_use_unallocated_ttys(sendmail_t)
Chris PeBenito 1815ba
	term_dontaudit_use_generic_ptys(sendmail_t)
Chris PeBenito 9e04f5
	files_dontaudit_read_root_files(sendmail_t)
Chris PeBenito f3936d
',`
Chris PeBenito f3936d
	allow sendmail_t sendmail_tmp_t:dir create_dir_perms;
Chris PeBenito f3936d
	allow sendmail_t sendmail_tmp_t:file create_file_perms;
Chris PeBenito 103fe2
	files_tmp_filetrans(sendmail_t, sendmail_tmp_t, { file dir })
Chris PeBenito f3936d
Chris PeBenito bf080a
	allow sendmail_t sendmail_var_run_t:file { getattr create read write append setattr unlink lock };
Chris PeBenito 1c1ac6
	files_pid_filetrans(sendmail_t,sendmail_var_run_t,file)
Chris PeBenito 650e75
')
Chris PeBenito 650e75
Chris PeBenito 132880
optional_policy(`nis',`
Chris PeBenito ab940a
	nis_use_ypbind(sendmail_t)
Chris PeBenito ab940a
')
Chris PeBenito ab940a
Chris PeBenito 132880
optional_policy(`nscd',`
Chris PeBenito 1815ba
	nscd_socket_use(sendmail_t)
Chris PeBenito 493d6c
')
Chris PeBenito 493d6c
Chris PeBenito 132880
optional_policy(`postfix',`
Chris PeBenito 04926d
	postfix_read_config(sendmail_t)
Chris PeBenito 04926d
	postfix_search_spool(sendmail_t)
Chris PeBenito 04926d
')
Chris PeBenito 04926d
Chris PeBenito bf080a
optional_policy(`procmail',`
Chris PeBenito bf080a
	procmail_domtrans(sendmail_t)
Chris PeBenito bf080a
')
Chris PeBenito bf080a
Chris PeBenito 132880
optional_policy(`selinuxutil',`
Chris PeBenito 8fd367
	seutil_sigchld_newrole(sendmail_t)
Chris PeBenito 650e75
')
Chris PeBenito 650e75
Chris PeBenito 132880
optional_policy(`udev',`
Chris PeBenito c9428d
	udev_read_db(sendmail_t)
Chris PeBenito 650e75
')
Chris PeBenito 650e75
Chris PeBenito 650e75
ifdef(`TODO',`
Chris PeBenito 650e75
allow sendmail_t etc_mail_t:dir rw_dir_perms;
Chris PeBenito 650e75
allow sendmail_t etc_mail_t:file create_file_perms;
Chris PeBenito 650e75
# for the start script to run make -C /etc/mail
Chris PeBenito 650e75
allow initrc_t etc_mail_t:dir rw_dir_perms;
Chris PeBenito 650e75
allow initrc_t etc_mail_t:file create_file_perms;
Chris PeBenito 650e75
allow system_mail_t initrc_t:fd use;
Chris PeBenito 650e75
allow system_mail_t initrc_t:fifo_file write;
Chris PeBenito 650e75
Chris PeBenito 650e75
# When sendmail runs as user_mail_domain, it needs some extra permissions
Chris PeBenito 650e75
# to update /etc/mail/statistics.
Chris PeBenito 650e75
allow user_mail_domain etc_mail_t:file rw_file_perms;
Chris PeBenito 650e75
Chris PeBenito 650e75
# Silently deny attempts to access /root.
Chris PeBenito 650e75
dontaudit system_mail_t { staff_home_dir_t sysadm_home_dir_t}:dir { getattr search };
Chris PeBenito 650e75
Chris PeBenito 650e75
dontaudit sendmail_t admin_tty_type:chr_file { getattr ioctl };
Chris PeBenito 650e75
') dnl end TODO