Chris PeBenito 17de1b
Chris PeBenito 465510
policy_module(mailman,1.1.6)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Declarations
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
mailman_domain_template(cgi)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type mailman_data_t;
Chris PeBenito 17de1b
files_type(mailman_data_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type mailman_archive_t;
Chris PeBenito 17de1b
files_type(mailman_archive_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type mailman_log_t;
Chris PeBenito 17de1b
logging_log_file(mailman_log_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type mailman_lock_t;
Chris PeBenito 17de1b
files_lock_file(mailman_lock_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
mailman_domain_template(mail)
Chris PeBenito 17de1b
init_daemon_domain(mailman_mail_t,mailman_mail_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
mailman_domain_template(queue)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Mailman CGI local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 465510
# cjp: the template invocation for cgi should be
Chris PeBenito 17de1b
# in the below optional policy; however, there are no
Chris PeBenito 17de1b
# optionals for file contexts yet, so it is promoted
Chris PeBenito 17de1b
# to global scope until such facilities exist.
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 465510
	allow mailman_cgi_t self:netlink_route_socket r_netlink_socket_perms;
Chris PeBenito 465510
Chris PeBenito 465510
	dev_read_urand(mailman_cgi_t)
Chris PeBenito 465510
Chris PeBenito 17de1b
	allow mailman_cgi_t mailman_archive_t:dir create_dir_perms;
Chris PeBenito 17de1b
	allow mailman_cgi_t mailman_archive_t:lnk_file create_lnk_perms;
Chris PeBenito 17de1b
	allow mailman_cgi_t mailman_archive_t:file create_file_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	kernel_tcp_recvfrom(mailman_cgi_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	term_use_controlling_term(mailman_cgi_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_spool(mailman_cgi_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	mta_tcp_connect_all_mailservers(mailman_cgi_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	apache_sigchld(mailman_cgi_t)
Chris PeBenito 17de1b
	apache_use_fds(mailman_cgi_t)
Chris PeBenito 17de1b
	apache_dontaudit_append_log(mailman_cgi_t)
Chris PeBenito 17de1b
	apache_search_sys_script_state(mailman_cgi_t)
Chris PeBenito 465510
Chris PeBenito 465510
	optional_policy(`
Chris PeBenito 465510
		nscd_socket_use(mailman_cgi_t)
Chris PeBenito 465510
	')
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Mailman mail local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow mailman_mail_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
mta_dontaudit_rw_delivery_tcp_sockets(mailman_mail_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
ifdef(`TODO',`
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	allow mailman_mail_t qmail_spool_t:file { read ioctl getattr };
Chris PeBenito 17de1b
	# do we really need this?
Chris PeBenito 17de1b
	allow mailman_mail_t qmail_lspawn_t:fifo_file write;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Mailman queue local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow mailman_queue_t self:capability { setgid setuid };
Chris PeBenito 17de1b
allow mailman_queue_t self:process signal;
Chris PeBenito 17de1b
allow mailman_queue_t self:fifo_file rw_file_perms;
Chris PeBenito 17de1b
allow mailman_queue_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 17de1b
allow mailman_queue_t self:netlink_route_socket r_netlink_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow mailman_queue_t mailman_archive_t:dir create_dir_perms;
Chris PeBenito 17de1b
allow mailman_queue_t mailman_archive_t:file create_file_perms;
Chris PeBenito 17de1b
allow mailman_queue_t mailman_archive_t:lnk_file create_lnk_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
kernel_read_proc_symlinks(mailman_queue_t)
Chris PeBenito 17de1b
kernel_tcp_recvfrom(mailman_queue_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
auth_domtrans_chk_passwd(mailman_queue_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
files_dontaudit_search_pids(mailman_queue_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# for su
Chris PeBenito 17de1b
seutil_dontaudit_search_config(mailman_queue_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# some of the following could probably be changed to dontaudit, someone who
Chris PeBenito 17de1b
# knows mailman well should test this out and send the changes
Chris PeBenito 17de1b
userdom_search_sysadm_home_dirs(mailman_queue_t)
Chris PeBenito 17de1b
userdom_getattr_sysadm_home_dirs(mailman_queue_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
mta_tcp_connect_all_mailservers(mailman_queue_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
su_exec(mailman_queue_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	cron_system_entry(mailman_queue_t,mailman_queue_exec_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	nscd_socket_use(mailman_queue_t)
Chris PeBenito 17de1b
')