Chris PeBenito 17de1b
## <summary>Policy common to all email tranfer agents.</summary>
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	MTA stub interface.  No access allowed.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito f7eaee
## <param name="domain" unused="true">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito f7eaee
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`mta_stub',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type sendmail_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
#######################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Basic mail transfer agent domain template.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <desc>
Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
##	This template creates a derived domain which is
Chris PeBenito 17de1b
##	a email transfer agent, which sends mail on
Chris PeBenito 17de1b
##	behalf of the user.
Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
##	This is the basic types and rules, common
Chris PeBenito 17de1b
##	to the system agent and user agents.
Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
## </desc>
Chris PeBenito 17de1b
## <param name="domain_prefix">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The prefix of the domain (e.g., user
Chris PeBenito 17de1b
##	is the prefix for user_t).
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
template(`mta_base_mail_template',`
Chris PeBenito 17de1b
Chris PeBenito 6b19be
	gen_require(`
Chris PeBenito 6b19be
		attribute user_mail_domain;
Chris PeBenito 6b19be
		type sendmail_exec_t;
Chris PeBenito 6b19be
	')
Chris PeBenito 6b19be
Chris PeBenito 17de1b
	##############################
Chris PeBenito 17de1b
	#
Chris PeBenito 17de1b
	# $1_mail_t declarations
Chris PeBenito 17de1b
	#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	type $1_mail_t, user_mail_domain;
Chris PeBenito 0bfccd
	application_domain($1_mail_t, sendmail_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	type $1_mail_tmp_t;
Chris PeBenito 17de1b
	files_tmp_file($1_mail_tmp_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	##############################
Chris PeBenito 17de1b
	#
Chris PeBenito 17de1b
	# $1_mail_t local policy
Chris PeBenito 17de1b
	#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1_mail_t self:capability { setuid setgid chown };
Chris PeBenito 17de1b
	allow $1_mail_t self:process { signal_perms setrlimit };
Chris PeBenito 17de1b
	allow $1_mail_t self:tcp_socket create_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# re-exec itself
Chris PeBenito 17de1b
	can_exec($1_mail_t, sendmail_exec_t)
Chris PeBenito c0868a
	allow $1_mail_t sendmail_exec_t:lnk_file read_lnk_file_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	kernel_read_kernel_sysctls($1_mail_t)
Chris PeBenito 17de1b
Chris PeBenito 190066
	corenet_all_recvfrom_unlabeled($1_mail_t)
Chris PeBenito 190066
	corenet_all_recvfrom_netlabel($1_mail_t)
Chris PeBenito 668b30
	corenet_tcp_sendrecv_generic_if($1_mail_t)
Chris PeBenito c12621
	corenet_tcp_sendrecv_generic_node($1_mail_t)
Chris PeBenito 17de1b
	corenet_tcp_sendrecv_all_ports($1_mail_t)
Chris PeBenito 17de1b
	corenet_tcp_connect_all_ports($1_mail_t)
Chris PeBenito 17de1b
	corenet_tcp_connect_smtp_port($1_mail_t)
Chris PeBenito 17de1b
	corenet_sendrecv_smtp_client_packets($1_mail_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	corecmd_exec_bin($1_mail_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_read_etc_files($1_mail_t)
Chris PeBenito 17de1b
	files_search_spool($1_mail_t)
Chris PeBenito 17de1b
	# It wants to check for nscd
Chris PeBenito 17de1b
	files_dontaudit_search_pids($1_mail_t)
Chris PeBenito 17de1b
Chris PeBenito 09e216
	auth_use_nsswitch($1_mail_t)
Chris PeBenito 09e216
Chris PeBenito 17de1b
	logging_send_syslog_msg($1_mail_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	miscfiles_read_localization($1_mail_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		postfix_domtrans_user_mail_handler($1_mail_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		procmail_exec($1_mail_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		qmail_domtrans_inject($1_mail_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		gen_require(`
Chris PeBenito 17de1b
			type etc_mail_t, mail_spool_t, mqueue_spool_t;
Chris PeBenito 17de1b
		')
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
		manage_dirs_pattern($1_mail_t, $1_mail_tmp_t, $1_mail_tmp_t)
Chris PeBenito 0bfccd
		manage_files_pattern($1_mail_t, $1_mail_tmp_t, $1_mail_tmp_t)
Chris PeBenito 17de1b
		files_tmp_filetrans($1_mail_t, $1_mail_tmp_t, { file dir })
Chris PeBenito 17de1b
Chris PeBenito 82d277
		allow $1_mail_t etc_mail_t:dir search_dir_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
		# Write to /var/spool/mail and /var/spool/mqueue.
Chris PeBenito 0bfccd
		manage_files_pattern($1_mail_t, mail_spool_t, mail_spool_t)
Chris PeBenito 0bfccd
		manage_files_pattern($1_mail_t, mqueue_spool_t, mqueue_spool_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
		# Check available space.
Chris PeBenito 17de1b
		fs_getattr_xattr_fs($1_mail_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
		files_read_etc_runtime_files($1_mail_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
		# Write to /var/log/sendmail.st
Chris PeBenito 17de1b
		sendmail_manage_log($1_mail_t)
Chris PeBenito 17de1b
		sendmail_create_log($1_mail_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 296273
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 296273
##	Role access for mta
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 296273
## <param name="role">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 296273
##	Role allowed access
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 296273
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 296273
##	User domain for the role
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 296273
interface(`mta_role',`
Chris PeBenito 6b19be
	gen_require(`
Chris PeBenito 6b19be
		attribute mta_user_agent;
Chris PeBenito 296273
		type user_mail_t, sendmail_exec_t;
Chris PeBenito 6b19be
	')
Chris PeBenito 17de1b
Chris PeBenito 296273
	role $1 types { user_mail_t mta_user_agent };
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# Transition from the user domain to the derived domain.
Chris PeBenito 296273
	domtrans_pattern($2, sendmail_exec_t, user_mail_t)
Chris PeBenito 17de1b
	allow $2 sendmail_exec_t:lnk_file { getattr read };
Chris PeBenito 17de1b
Chris PeBenito 296273
	allow mta_user_agent $2:fd use;
Chris PeBenito 296273
	allow mta_user_agent $2:process sigchld;
Chris PeBenito 296273
	allow mta_user_agent $2:fifo_file { read write };
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Make the specified domain usable for a mail server.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="type">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Type to be used as a mail server domain.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 8f3a0a
## <param name="entry_point">
Chris PeBenito 8f3a0a
##	<summary>
Chris PeBenito 8f3a0a
##	Type of the program to be used as an entry point to this domain.
Chris PeBenito 8f3a0a
##	</summary>
Chris PeBenito 8f3a0a
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`mta_mailserver',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		attribute mailserver_domain;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	init_daemon_domain($1,$2)
Chris PeBenito 17de1b
	typeattribute $1 mailserver_domain;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 36095d
##	Make the specified type a MTA executable file.
Chris PeBenito 36095d
## </summary>
Chris PeBenito 36095d
## <param name="type">
Chris PeBenito 36095d
##	<summary>
Chris PeBenito 36095d
##	Type to be used as a mail client.
Chris PeBenito 36095d
##	</summary>
Chris PeBenito 36095d
## </param>
Chris PeBenito 36095d
#
Chris PeBenito 36095d
interface(`mta_agent_executable',`
Chris PeBenito 36095d
	gen_require(`
Chris PeBenito 36095d
		attribute mta_exec_type;
Chris PeBenito 36095d
	')
Chris PeBenito 36095d
Chris PeBenito 36095d
	typeattribute $1 mta_exec_type;
Chris PeBenito 36095d
Chris PeBenito 36095d
	application_executable_file($1)
Chris PeBenito 36095d
')
Chris PeBenito 36095d
Chris PeBenito 36095d
########################################
Chris PeBenito 36095d
## <summary>
Chris PeBenito 36095d
##	Make the specified type by a system MTA.
Chris PeBenito 36095d
## </summary>
Chris PeBenito 36095d
## <param name="type">
Chris PeBenito 36095d
##	<summary>
Chris PeBenito 36095d
##	Type to be used as a mail client.
Chris PeBenito 36095d
##	</summary>
Chris PeBenito 36095d
## </param>
Chris PeBenito 36095d
#
Chris PeBenito 36095d
interface(`mta_system_content',`
Chris PeBenito 36095d
	gen_require(`
Chris PeBenito 36095d
		attribute mailcontent_type;
Chris PeBenito 36095d
	')
Chris PeBenito 36095d
Chris PeBenito 36095d
	typeattribute $1 mailcontent_type;
Chris PeBenito 36095d
')
Chris PeBenito 36095d
Chris PeBenito 36095d
########################################
Chris PeBenito 36095d
## <summary>
Chris PeBenito 17de1b
##	Modified mailserver interface for
Chris PeBenito 17de1b
##	sendmail daemon use.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <desc>
Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
##	A modified MTA mail server interface for
Chris PeBenito 17de1b
##	the sendmail program.  It's design does
Chris PeBenito 17de1b
##	not fit well with policy, and using the
Chris PeBenito 17de1b
##	regular interface causes a type_transition
Chris PeBenito 17de1b
##	conflict if direct running of init scripts
Chris PeBenito 17de1b
##	is enabled.
Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
##	This interface should most likely only be used
Chris PeBenito 17de1b
##	by the sendmail policy.
Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
## </desc>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The type to be used for the mail server.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito b34db7
#
Chris PeBenito 17de1b
interface(`mta_sendmail_mailserver',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		attribute mailserver_domain;
Chris PeBenito 17de1b
		type sendmail_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	init_system_domain($1,sendmail_exec_t)
Chris PeBenito 17de1b
	typeattribute $1 mailserver_domain;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
#######################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Make a type a mailserver type used
Chris PeBenito 17de1b
##	for sending mail.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Mail server domain type used for sending mail.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`mta_mailserver_sender',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		attribute mailserver_sender;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	typeattribute $1 mailserver_sender;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
#######################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Make a type a mailserver type used
Chris PeBenito 17de1b
##	for delivering mail to local users.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Mail server domain type used for delivering mail.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`mta_mailserver_delivery',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		attribute mailserver_delivery;
Chris PeBenito 17de1b
		type mail_spool_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	typeattribute $1 mailserver_delivery;
Chris PeBenito 17de1b
Chris PeBenito c0868a
	allow $1 mail_spool_t:dir list_dir_perms;
Chris PeBenito 0bfccd
	create_files_pattern($1, mail_spool_t, mail_spool_t)
Chris PeBenito 0bfccd
	read_files_pattern($1, mail_spool_t, mail_spool_t)
Chris PeBenito 0bfccd
	create_lnk_files_pattern($1, mail_spool_t, mail_spool_t)
Chris PeBenito 0bfccd
	read_lnk_files_pattern($1, mail_spool_t, mail_spool_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		dovecot_manage_spool($1)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		# so MTA can access /var/lib/mailman/mail/wrapper
Chris PeBenito 17de1b
		files_search_var_lib($1)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
		mailman_domtrans($1)
Chris PeBenito 17de1b
		mailman_read_data_symlinks($1)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
#######################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Make a type a mailserver type used
Chris PeBenito 17de1b
##	for sending mail on behalf of local
Chris PeBenito 17de1b
##	users to the local mail spool.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Mail server domain type used for sending local mail.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`mta_mailserver_user_agent',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		attribute mta_user_agent;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	typeattribute $1 mta_user_agent;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		# apache should set close-on-exec
Chris PeBenito 17de1b
		apache_dontaudit_rw_stream_sockets($1)
Chris PeBenito 17de1b
		apache_dontaudit_rw_sys_script_stream_sockets($1)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Send mail from the system.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`mta_send_mail',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		attribute mta_user_agent;
Chris PeBenito 36095d
		type system_mail_t;
Chris PeBenito 36095d
		attribute mta_exec_type;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 36095d
	allow $1 mta_exec_type:lnk_file read_lnk_file_perms;
Chris PeBenito 36095d
	domtrans_pattern($1, mta_exec_type, system_mail_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow mta_user_agent $1:fd use;
Chris PeBenito 17de1b
	allow mta_user_agent $1:process sigchld;
Chris PeBenito 17de1b
	allow mta_user_agent $1:fifo_file { read write };
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute send mail in a specified domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <desc>
Chris PeBenito ff8f0a
##	

Chris PeBenito 17de1b
##	Execute send mail in a specified domain.
Chris PeBenito ff8f0a
##	

Chris PeBenito ff8f0a
##	

Chris PeBenito ff8f0a
##	No interprocess communication (signals, pipes,
Chris PeBenito ff8f0a
##	etc.) is provided by this interface since
Chris PeBenito ff8f0a
##	the domains are not owned by this module.
Chris PeBenito ff8f0a
##	

Chris PeBenito 17de1b
## </desc>
Chris PeBenito 17de1b
## <param name="source_domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain to transition from.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="target_domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain to transition to.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`mta_sendmail_domtrans',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type sendmail_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_usr($1)
Chris PeBenito 8021cb
	corecmd_read_bin_symlinks($1)
Chris PeBenito 0bfccd
	domain_auto_trans($1, sendmail_exec_t, $2)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute sendmail in the caller domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`mta_sendmail_exec',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type sendmail_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	can_exec($1, sendmail_exec_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Read mail server configuration.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito bbcd3c
## <rolecap/>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`mta_read_config',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type etc_mail_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_etc($1)
Chris PeBenito 17de1b
	allow $1 etc_mail_t:dir list_dir_perms;
Chris PeBenito 0bfccd
	read_files_pattern($1, etc_mail_t, etc_mail_t)
Chris PeBenito 0bfccd
	read_lnk_files_pattern($1, etc_mail_t, etc_mail_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Read mail address aliases.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`mta_read_aliases',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type etc_aliases_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_etc($1)
Chris PeBenito c0868a
	allow $1 etc_aliases_t:file read_file_perms;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito aa7c46
##	Create, read, write, and delete mail address aliases.
Chris PeBenito aa7c46
## </summary>
Chris PeBenito aa7c46
## <param name="domain">
Chris PeBenito aa7c46
##	<summary>
Chris PeBenito aa7c46
##	Domain allowed access.
Chris PeBenito aa7c46
##	</summary>
Chris PeBenito aa7c46
## </param>
Chris PeBenito aa7c46
#
Chris PeBenito aa7c46
interface(`mta_manage_aliases',`
Chris PeBenito aa7c46
	gen_require(`
Chris PeBenito aa7c46
		type etc_aliases_t;
Chris PeBenito aa7c46
	')
Chris PeBenito aa7c46
Chris PeBenito aa7c46
	files_search_etc($1)
Chris PeBenito aa7c46
	manage_files_pattern($1, etc_aliases_t, etc_aliases_t)
Chris PeBenito aa7c46
	manage_lnk_files_pattern($1, etc_aliases_t, etc_aliases_t)
Chris PeBenito aa7c46
')
Chris PeBenito aa7c46
Chris PeBenito aa7c46
########################################
Chris PeBenito aa7c46
## <summary>
Chris PeBenito 17de1b
##	Type transition files created in /etc
Chris PeBenito 17de1b
##	to the mail address aliases type.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`mta_etc_filetrans_aliases',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type etc_aliases_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
	files_etc_filetrans($1, etc_aliases_t, file)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Read and write mail aliases.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito bbcd3c
## <rolecap/>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`mta_rw_aliases',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type etc_aliases_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_etc($1)
Chris PeBenito 17de1b
	allow $1 etc_aliases_t:file { rw_file_perms setattr };
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
#######################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Do not audit attempts to read and write TCP
Chris PeBenito 17de1b
##	sockets of mail delivery domains.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Mail server domain.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`mta_dontaudit_rw_delivery_tcp_sockets',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		attribute mailserver_delivery;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	dontaudit $1 mailserver_delivery:tcp_socket { read write };
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
#######################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 33c7e6
##	Connect to all mail servers over TCP.  (Deprecated)
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Mail server domain.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`mta_tcp_connect_all_mailservers',`
Chris PeBenito 33c7e6
	refpolicywarn(`$0($*) has been deprecated.')
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
#######################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Do not audit attempts to read a symlink
Chris PeBenito 17de1b
##	in the mail spool.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`mta_dontaudit_read_spool_symlinks',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type mail_spool_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	dontaudit $1 mail_spool_t:lnk_file read;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Get the attributes of mail spool files.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`mta_getattr_spool',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type mail_spool_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_spool($1)
Chris PeBenito c0868a
	allow $1 mail_spool_t:dir list_dir_perms;
Chris PeBenito 17de1b
	allow $1 mail_spool_t:lnk_file read;
Chris PeBenito 17de1b
	allow $1 mail_spool_t:file getattr;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Do not audit attempts to get the attributes
Chris PeBenito 17de1b
##	of mail spool files.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain to not audit.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`mta_dontaudit_getattr_spool_files',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type mail_spool_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_dontaudit_search_spool($1)
Chris PeBenito 17de1b
	dontaudit $1 mail_spool_t:dir search;
Chris PeBenito 17de1b
	dontaudit $1 mail_spool_t:lnk_file read;
Chris PeBenito 17de1b
	dontaudit $1 mail_spool_t:file getattr;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
#######################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Create private objects in the 
Chris PeBenito 17de1b
##	mail spool directory.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="private type">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The type of the object to be created.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="object">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The object class of the object being created.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`mta_spool_filetrans',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type mail_spool_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_spool($1)
Chris PeBenito 0bfccd
	filetrans_pattern($1, mail_spool_t, $2, $3)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Read and write the mail spool.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`mta_rw_spool',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type mail_spool_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_spool($1)
Chris PeBenito c0868a
	allow $1 mail_spool_t:dir list_dir_perms;
Chris PeBenito c0868a
	allow $1 mail_spool_t:file setattr;
Chris PeBenito 0bfccd
	rw_files_pattern($1, mail_spool_t, mail_spool_t)
Chris PeBenito 0bfccd
	read_lnk_files_pattern($1, mail_spool_t, mail_spool_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
#######################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Create, read, and write the mail spool.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`mta_append_spool',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type mail_spool_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_spool($1)
Chris PeBenito c0868a
	allow $1 mail_spool_t:dir list_dir_perms;
Chris PeBenito 0bfccd
	create_files_pattern($1, mail_spool_t, mail_spool_t)
Chris PeBenito 0bfccd
	write_files_pattern($1, mail_spool_t, mail_spool_t)
Chris PeBenito 0bfccd
	read_lnk_files_pattern($1, mail_spool_t, mail_spool_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
#######################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Delete from the mail spool.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`mta_delete_spool',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type mail_spool_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_spool($1)
Chris PeBenito 0bfccd
	delete_files_pattern($1, mail_spool_t, mail_spool_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Create, read, write, and delete mail spool files.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`mta_manage_spool',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type mail_spool_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_spool($1)
Chris PeBenito 0bfccd
	manage_dirs_pattern($1, mail_spool_t, mail_spool_t)
Chris PeBenito 0bfccd
	manage_files_pattern($1, mail_spool_t, mail_spool_t)
Chris PeBenito 0bfccd
	manage_lnk_files_pattern($1, mail_spool_t, mail_spool_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito a39a93
########################################
Chris PeBenito a39a93
## <summary>
Chris PeBenito a39a93
##	Search mail queue dirs.
Chris PeBenito a39a93
## </summary>
Chris PeBenito a39a93
## <param name="domain">
Chris PeBenito a39a93
##	<summary>
Chris PeBenito a39a93
##	Domain allowed access.
Chris PeBenito a39a93
##	</summary>
Chris PeBenito a39a93
## </param>
Chris PeBenito a39a93
#
Chris PeBenito a39a93
interface(`mta_search_queue',`
Chris PeBenito a39a93
	gen_require(`
Chris PeBenito a39a93
		type mqueue_spool_t;
Chris PeBenito a39a93
	')
Chris PeBenito a39a93
Chris PeBenito a39a93
	files_search_spool($1)
Chris PeBenito a39a93
	allow $1 mqueue_spool_t:dir search_dir_perms;
Chris PeBenito a39a93
')
Chris PeBenito a39a93
Chris PeBenito 17de1b
#######################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 9ff89c
##	Read the mail queue.
Chris PeBenito 9ff89c
## </summary>
Chris PeBenito 9ff89c
## <param name="domain">
Chris PeBenito 9ff89c
##	<summary>
Chris PeBenito 9ff89c
##	Domain allowed access.
Chris PeBenito 9ff89c
##	</summary>
Chris PeBenito 9ff89c
## </param>
Chris PeBenito 9ff89c
#
Chris PeBenito 9ff89c
interface(`mta_read_queue',`
Chris PeBenito 9ff89c
	gen_require(`
Chris PeBenito 9ff89c
		type mqueue_spool_t;
Chris PeBenito 9ff89c
	')
Chris PeBenito 9ff89c
Chris PeBenito 9ff89c
	read_files_pattern($1, mqueue_spool_t, mqueue_spool_t)
Chris PeBenito 9ff89c
	files_search_spool($1)
Chris PeBenito 9ff89c
')
Chris PeBenito 9ff89c
Chris PeBenito 9ff89c
#######################################
Chris PeBenito 9ff89c
## <summary>
Chris PeBenito 17de1b
##	Do not audit attempts to read and
Chris PeBenito 17de1b
##	write the mail queue.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain to not audit.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`mta_dontaudit_rw_queue',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type mqueue_spool_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito d6d16b
	dontaudit $1 mqueue_spool_t:dir search_dir_perms;
Chris PeBenito 17de1b
	dontaudit $1 mqueue_spool_t:file { getattr read write };
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Create, read, write, and delete
Chris PeBenito 17de1b
##	mail queue files.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`mta_manage_queue',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type mqueue_spool_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_spool($1)
Chris PeBenito 0bfccd
	manage_files_pattern($1, mqueue_spool_t, mqueue_spool_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
#######################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Read sendmail binary.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# cjp: added for postfix
Chris PeBenito 17de1b
interface(`mta_read_sendmail_bin',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type sendmail_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito c0868a
	allow $1 sendmail_exec_t:file read_file_perms;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
#######################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Read and write unix domain stream sockets
Chris PeBenito 17de1b
##	of user mail domains.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`mta_rw_user_mail_stream_sockets',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		attribute user_mail_domain;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1 user_mail_domain:unix_stream_socket rw_socket_perms;
Chris PeBenito 17de1b
')