|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17ec8c |
policy_module(sendmail, 1.9.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 |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
# Sendmail local policy
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
allow sendmail_t self:capability { setuid setgid net_bind_service sys_nice chown sys_tty_config };
|
|
Chris PeBenito |
17de1b |
allow sendmail_t self:process signal;
|
|
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 |
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 |
17de1b |
corenet_tcp_sendrecv_all_if(sendmail_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_sendrecv_all_nodes(sendmail_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_sendrecv_all_ports(sendmail_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_bind_all_nodes(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 |
17de1b |
|
|
Chris PeBenito |
17de1b |
term_dontaudit_use_console(sendmail_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# for piping mail to a command
|
|
Chris PeBenito |
17de1b |
corecmd_exec_shell(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 |
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)
|
|
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)
|
|
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 |
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)
|
|
Chris PeBenito |
296273 |
userdom_dontaudit_search_user_home_dirs(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 |
17de1b |
mta_rw_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 |
17de1b |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
6b19be |
clamav_search_lib(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 |
17de1b |
postfix_exec_master(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 |
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 |
17de1b |
udev_read_db(sendmail_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
ifdef(`TODO',`
|
|
Chris PeBenito |
17de1b |
allow sendmail_t etc_mail_t:dir rw_dir_perms;
|
|
Chris PeBenito |
c0868a |
allow sendmail_t etc_mail_t:file manage_file_perms;
|
|
Chris PeBenito |
17de1b |
# for the start script to run make -C /etc/mail
|
|
Chris PeBenito |
17de1b |
allow initrc_t etc_mail_t:dir rw_dir_perms;
|
|
Chris PeBenito |
c0868a |
allow initrc_t etc_mail_t:file manage_file_perms;
|
|
Chris PeBenito |
17de1b |
allow system_mail_t initrc_t:fd use;
|
|
Chris PeBenito |
17de1b |
allow system_mail_t initrc_t:fifo_file write;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# When sendmail runs as user_mail_domain, it needs some extra permissions
|
|
Chris PeBenito |
17de1b |
# to update /etc/mail/statistics.
|
|
Chris PeBenito |
17de1b |
allow user_mail_domain etc_mail_t:file rw_file_perms;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# Silently deny attempts to access /root.
|
|
Chris PeBenito |
17de1b |
dontaudit system_mail_t { staff_home_dir_t sysadm_home_dir_t}:dir { getattr search };
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
dontaudit sendmail_t admin_tty_type:chr_file { getattr ioctl };
|
|
Chris PeBenito |
17de1b |
') dnl end TODO
|