Chris PeBenito 17de1b
## <summary>Policy for sendmail.</summary>
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Sendmail 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(`sendmail_stub',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type sendmail_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito c155e0
##	Allow attempts to read and write to
Chris PeBenito c155e0
##	sendmail unnamed pipes.
Chris PeBenito c155e0
## </summary>
Chris PeBenito c155e0
## <param name="domain">
Chris PeBenito c155e0
##	<summary>
Chris PeBenito c155e0
##	Domain to not audit.
Chris PeBenito c155e0
##	</summary>
Chris PeBenito c155e0
## </param>
Chris PeBenito c155e0
#
Chris PeBenito c155e0
interface(`sendmail_rw_pipes',`
Chris PeBenito c155e0
	gen_require(`
Chris PeBenito c155e0
		type sendmail_t;
Chris PeBenito c155e0
	')
Chris PeBenito c155e0
Chris PeBenito c155e0
	allow $1 sendmail_t:fifo_file rw_fifo_file_perms;
Chris PeBenito c155e0
')
Chris PeBenito c155e0
Chris PeBenito c155e0
########################################
Chris PeBenito c155e0
## <summary>
Chris PeBenito 17de1b
##	Domain transition to sendmail.
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(`sendmail_domtrans',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type sendmail_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
	mta_sendmail_domtrans($1, sendmail_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow sendmail_t $1:fd use;
Chris PeBenito 17de1b
	allow sendmail_t $1:fifo_file rw_file_perms;
Chris PeBenito 17de1b
	allow sendmail_t $1:process sigchld;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito c155e0
##	Execute the sendmail program in the sendmail domain.
Chris PeBenito c155e0
## </summary>
Chris PeBenito c155e0
## <param name="domain">
Chris PeBenito c155e0
##	<summary>
Chris PeBenito c155e0
##	Domain allowed access.
Chris PeBenito c155e0
##	</summary>
Chris PeBenito c155e0
## </param>
Chris PeBenito c155e0
## <param name="role">
Chris PeBenito c155e0
##	<summary>
Chris PeBenito c155e0
##	The role to allow the sendmail domain.
Chris PeBenito c155e0
##	</summary>
Chris PeBenito c155e0
## </param>
Chris PeBenito c155e0
## <rolecap/>
Chris PeBenito c155e0
#
Chris PeBenito c155e0
interface(`sendmail_run',`
Chris PeBenito c155e0
	gen_require(`
Chris PeBenito c155e0
		type sendmail_t;
Chris PeBenito c155e0
	')
Chris PeBenito c155e0
Chris PeBenito c155e0
	sendmail_domtrans($1)
Chris PeBenito c155e0
	role $2 types sendmail_t;
Chris PeBenito c155e0
')
Chris PeBenito c155e0
Chris PeBenito c155e0
########################################
Chris PeBenito c155e0
## <summary>
Chris PeBenito 6dd721
##	Send generic signals to sendmail.
Chris PeBenito 6dd721
## </summary>
Chris PeBenito 6dd721
## <param name="domain">
Chris PeBenito 6dd721
##	<summary>
Chris PeBenito 6dd721
##	Domain allowed access.
Chris PeBenito 6dd721
##	</summary>
Chris PeBenito 6dd721
## </param>
Chris PeBenito 6dd721
#
Chris PeBenito 6dd721
interface(`sendmail_signal',`
Chris PeBenito 6dd721
	gen_require(`
Chris PeBenito 6dd721
		type sendmail_t;
Chris PeBenito 6dd721
	')
Chris PeBenito 6dd721
Chris PeBenito 6dd721
	allow $1 sendmail_t:process signal;
Chris PeBenito 6dd721
')
Chris PeBenito 6dd721
Chris PeBenito 6dd721
########################################
Chris PeBenito 6dd721
## <summary>
Chris PeBenito 17de1b
##	Read and write sendmail TCP sockets.
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(`sendmail_rw_tcp_sockets',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type sendmail_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1 sendmail_t:tcp_socket { read write };
Chris PeBenito 17de1b
')
Chris PeBenito c155e0
Chris PeBenito c155e0
########################################
Chris PeBenito c155e0
## <summary>
Chris PeBenito c155e0
##	Do not audit attempts to read and write
Chris PeBenito c155e0
##	sendmail TCP sockets.
Chris PeBenito c155e0
## </summary>
Chris PeBenito c155e0
## <param name="domain">
Chris PeBenito c155e0
##	<summary>
Chris PeBenito c155e0
##	Domain to not audit.
Chris PeBenito c155e0
##	</summary>
Chris PeBenito c155e0
## </param>
Chris PeBenito c155e0
#
Chris PeBenito c155e0
interface(`sendmail_dontaudit_rw_tcp_sockets',`
Chris PeBenito c155e0
	gen_require(`
Chris PeBenito c155e0
		type sendmail_t;
Chris PeBenito c155e0
	')
Chris PeBenito c155e0
Chris PeBenito c155e0
	dontaudit $1 sendmail_t:tcp_socket { read write };
Chris PeBenito c155e0
')
Chris PeBenito c155e0
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Read and write sendmail unix_stream_sockets.
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(`sendmail_rw_unix_stream_sockets',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type sendmail_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito c155e0
	allow $1 sendmail_t:unix_stream_socket { getattr read write ioctl };
Chris PeBenito c155e0
')
Chris PeBenito c155e0
Chris PeBenito c155e0
########################################
Chris PeBenito c155e0
## <summary>
Chris PeBenito c155e0
##	Do not audit attempts to read and write
Chris PeBenito c155e0
##	sendmail unix_stream_sockets.
Chris PeBenito c155e0
## </summary>
Chris PeBenito c155e0
## <param name="domain">
Chris PeBenito c155e0
##	<summary>
Chris PeBenito c155e0
##	Domain allowed access.
Chris PeBenito c155e0
##	</summary>
Chris PeBenito c155e0
## </param>
Chris PeBenito c155e0
#
Chris PeBenito c155e0
interface(`sendmail_dontaudit_rw_unix_stream_sockets',`
Chris PeBenito c155e0
	gen_require(`
Chris PeBenito c155e0
		type sendmail_t;
Chris PeBenito c155e0
	')
Chris PeBenito c155e0
Chris PeBenito c155e0
	dontaudit $1 sendmail_t:unix_stream_socket { getattr read write ioctl };
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito a39a93
##	Read sendmail logs.
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
## <rolecap/>
Chris PeBenito a39a93
#
Chris PeBenito a39a93
interface(`sendmail_read_log',`
Chris PeBenito a39a93
	gen_require(`
Chris PeBenito a39a93
		type sendmail_log_t;
Chris PeBenito a39a93
	')
Chris PeBenito a39a93
Chris PeBenito a39a93
	logging_search_logs($1)
Chris PeBenito a39a93
	read_files_pattern($1, sendmail_log_t, sendmail_log_t)
Chris PeBenito a39a93
')
Chris PeBenito a39a93
Chris PeBenito a39a93
########################################
Chris PeBenito a39a93
## <summary>
Chris PeBenito 17de1b
##	Create, read, write, and delete sendmail logs.
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(`sendmail_manage_log',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type sendmail_log_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	logging_search_logs($1)
Chris PeBenito a39a93
	manage_files_pattern($1, sendmail_log_t, sendmail_log_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Create sendmail logs with the correct 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(`sendmail_create_log',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type sendmail_log_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
	logging_log_filetrans($1, sendmail_log_t, file)
Chris PeBenito 17de1b
')
Chris PeBenito c155e0
Chris PeBenito c155e0
########################################
Chris PeBenito c155e0
## <summary>
Chris PeBenito c155e0
##	Manage sendmail tmp files.
Chris PeBenito c155e0
## </summary>
Chris PeBenito c155e0
## <param name="domain">
Chris PeBenito c155e0
##	<summary>
Chris PeBenito c155e0
##	Domain allowed access.
Chris PeBenito c155e0
##	</summary>
Chris PeBenito c155e0
## </param>
Chris PeBenito c155e0
#
Chris PeBenito c155e0
interface(`sendmail_manage_tmp_files',`
Chris PeBenito c155e0
	gen_require(`
Chris PeBenito c155e0
		type sendmail_tmp_t;
Chris PeBenito c155e0
	')
Chris PeBenito c155e0
Chris PeBenito c155e0
	files_search_tmp($1)
Chris PeBenito c155e0
	manage_files_pattern($1, sendmail_tmp_t, sendmail_tmp_t)
Chris PeBenito c155e0
')
Chris PeBenito c155e0
Chris PeBenito c155e0
########################################
Chris PeBenito c155e0
## <summary>
Chris PeBenito c155e0
##	Execute sendmail in the unconfined sendmail domain, and
Chris PeBenito c155e0
##	allow the specified role the unconfined sendmail domain,
Chris PeBenito c155e0
##	and use the caller's terminal.
Chris PeBenito c155e0
## </summary>
Chris PeBenito c155e0
## <param name="domain">
Chris PeBenito c155e0
##	<summary>
Chris PeBenito c155e0
##	Domain allowed access.
Chris PeBenito c155e0
##	</summary>
Chris PeBenito c155e0
## </param>
Chris PeBenito c155e0
## <param name="role">
Chris PeBenito c155e0
##	<summary>
Chris PeBenito c155e0
##	Role allowed access.
Chris PeBenito c155e0
##	</summary>
Chris PeBenito c155e0
## </param>
Chris PeBenito c155e0
## <rolecap/>
Chris PeBenito c155e0
#
Chris PeBenito c155e0
interface(`sendmail_run_unconfined',`
Chris PeBenito c155e0
	gen_require(`
Chris PeBenito c155e0
		type unconfined_sendmail_t;
Chris PeBenito c155e0
	')
Chris PeBenito c155e0
Chris PeBenito c155e0
	sendmail_domtrans_unconfined($1)
Chris PeBenito c155e0
	role $2 types unconfined_sendmail_t;
Chris PeBenito c155e0
')