Chris PeBenito 17ec8c
policy_module(qmail, 1.5.0)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Declarations
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
attribute qmail_user_domains;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type qmail_alias_home_t;
Chris PeBenito 17de1b
files_type(qmail_alias_home_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
qmail_child_domain_template(qmail_clean, qmail_start_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type qmail_etc_t;
Chris PeBenito e0ed76
files_config_file(qmail_etc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type qmail_exec_t;
Chris PeBenito 17de1b
files_type(qmail_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type qmail_inject_t, qmail_user_domains;
Chris PeBenito 17de1b
type qmail_inject_exec_t;
Chris PeBenito 17de1b
domain_type(qmail_inject_t)
Chris PeBenito 0bfccd
domain_entry_file(qmail_inject_t, qmail_inject_exec_t)
Chris PeBenito 17de1b
mta_mailserver_user_agent(qmail_inject_t)
Chris PeBenito 17de1b
role system_r types qmail_inject_t;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
qmail_child_domain_template(qmail_local, qmail_lspawn_t)
Chris PeBenito 17de1b
mta_mailserver_delivery(qmail_local_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
qmail_child_domain_template(qmail_lspawn, qmail_start_t)
Chris PeBenito 17de1b
mta_mailserver_delivery(qmail_lspawn_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
qmail_child_domain_template(qmail_queue, qmail_inject_t)
Chris PeBenito 17de1b
typeattribute qmail_queue_t qmail_user_domains;
Chris PeBenito 17de1b
mta_mailserver_user_agent(qmail_queue_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
qmail_child_domain_template(qmail_remote, qmail_rspawn_t)
Chris PeBenito 17de1b
mta_mailserver_sender(qmail_remote_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
qmail_child_domain_template(qmail_rspawn, qmail_start_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
qmail_child_domain_template(qmail_send, qmail_start_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
qmail_child_domain_template(qmail_smtpd, qmail_tcp_env_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
qmail_child_domain_template(qmail_splogger, qmail_start_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type qmail_spool_t;
Chris PeBenito 17de1b
files_type(qmail_spool_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type qmail_start_t;
Chris PeBenito 17de1b
type qmail_start_exec_t;
Chris PeBenito 0bfccd
init_daemon_domain(qmail_start_t, qmail_start_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type qmail_tcp_env_t;
Chris PeBenito 17de1b
type qmail_tcp_env_exec_t;
Chris PeBenito 0bfccd
application_domain(qmail_tcp_env_t, qmail_tcp_env_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# qmail-clean local policy
Chris PeBenito 17de1b
#   this component cleans up the queue directory
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
read_files_pattern(qmail_clean_t, qmail_spool_t, qmail_spool_t)
Chris PeBenito 0bfccd
delete_files_pattern(qmail_clean_t, qmail_spool_t, qmail_spool_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# qmail-inject local policy
Chris PeBenito 17de1b
#   this component preprocesses mail from stdin and invokes qmail-queue
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 0b36a2
allow qmail_inject_t self:fifo_file write_fifo_file_perms;
Chris PeBenito 17de1b
allow qmail_inject_t self:process signal_perms;
Chris PeBenito 17de1b
Chris PeBenito 0b36a2
allow qmail_inject_t qmail_queue_exec_t:file read_file_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
corecmd_search_bin(qmail_inject_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
files_search_var(qmail_inject_t)
Chris PeBenito 17de1b
Chris PeBenito e0ed76
miscfiles_read_localization(qmail_inject_t)
Chris PeBenito e0ed76
Chris PeBenito 17de1b
qmail_read_config(qmail_inject_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# qmail-local local policy
Chris PeBenito 17de1b
#   this component delivers a mail message
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 0b36a2
allow qmail_local_t self:fifo_file write_file_perms;
Chris PeBenito 17de1b
allow qmail_local_t self:process signal_perms;
Chris PeBenito 17de1b
allow qmail_local_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
manage_dirs_pattern(qmail_local_t, qmail_alias_home_t, qmail_alias_home_t)
Chris PeBenito 0bfccd
manage_files_pattern(qmail_local_t, qmail_alias_home_t, qmail_alias_home_t)
Chris PeBenito 17de1b
Chris PeBenito e0ed76
can_exec(qmail_local_t, qmail_local_exec_t)
Chris PeBenito e0ed76
Chris PeBenito 0b36a2
allow qmail_local_t qmail_queue_exec_t:file read_file_perms;
Chris PeBenito 17de1b
Chris PeBenito c0868a
allow qmail_local_t qmail_spool_t:file read_file_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
kernel_read_system_state(qmail_local_t)
Chris PeBenito 17de1b
Chris PeBenito e0ed76
corecmd_exec_bin(qmail_local_t)
Chris PeBenito 17de1b
corecmd_exec_shell(qmail_local_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
files_read_etc_files(qmail_local_t)
Chris PeBenito 17de1b
files_read_etc_runtime_files(qmail_local_t)
Chris PeBenito 17de1b
Chris PeBenito e0ed76
auth_use_nsswitch(qmail_local_t)
Chris PeBenito e0ed76
Chris PeBenito e0ed76
logging_send_syslog_msg(qmail_local_t)
Chris PeBenito e0ed76
Chris PeBenito 17de1b
mta_append_spool(qmail_local_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
qmail_domtrans_queue(qmail_local_t)
Chris PeBenito 17de1b
Chris PeBenito 5843d0
optional_policy(`
Chris PeBenito 5843d0
	spamassassin_domtrans_client(qmail_local_t)
Chris PeBenito 5843d0
')
Chris PeBenito 5843d0
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# qmail-lspawn local policy
Chris PeBenito 17de1b
#   this component schedules local deliveries
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow qmail_lspawn_t self:capability { setuid setgid };
Chris PeBenito 17de1b
allow qmail_lspawn_t self:process signal_perms;
Chris PeBenito 0b36a2
allow qmail_lspawn_t self:fifo_file rw_fifo_file_perms;
Chris PeBenito 17de1b
allow qmail_lspawn_t self:unix_stream_socket create_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
can_exec(qmail_lspawn_t, qmail_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 0b36a2
allow qmail_lspawn_t qmail_local_exec_t:file read_file_perms;
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
read_files_pattern(qmail_lspawn_t, qmail_spool_t, qmail_spool_t)
Chris PeBenito 17de1b
Chris PeBenito 8021cb
corecmd_search_bin(qmail_lspawn_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
files_read_etc_files(qmail_lspawn_t)
Chris PeBenito 17de1b
files_search_pids(qmail_lspawn_t)
Chris PeBenito 17de1b
files_search_tmp(qmail_lspawn_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# qmail-queue local policy
Chris PeBenito 17de1b
#   this component places a mail in a delivery queue, later to be processed by qmail-send
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow qmail_queue_t qmail_lspawn_t:fd use;
Chris PeBenito 0b36a2
allow qmail_queue_t qmail_lspawn_t:fifo_file write_fifo_file_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow qmail_queue_t qmail_smtpd_t:fd use;
Chris PeBenito 0b36a2
allow qmail_queue_t qmail_smtpd_t:fifo_file read_fifo_file_perms;
Chris PeBenito 17de1b
allow qmail_queue_t qmail_smtpd_t:process sigchld;
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
manage_dirs_pattern(qmail_queue_t, qmail_spool_t, qmail_spool_t)
Chris PeBenito 0bfccd
manage_files_pattern(qmail_queue_t, qmail_spool_t, qmail_spool_t)
Chris PeBenito 0bfccd
rw_fifo_files_pattern(qmail_queue_t, qmail_spool_t, qmail_spool_t)
Chris PeBenito 17de1b
Chris PeBenito e0ed76
corecmd_exec_bin(qmail_queue_t)
Chris PeBenito e0ed76
Chris PeBenito e0ed76
logging_send_syslog_msg(qmail_queue_t)
Chris PeBenito e0ed76
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	daemontools_ipc_domain(qmail_queue_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# qmail-remote local policy
Chris PeBenito 17de1b
#   this component sends mail via SMTP
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow qmail_remote_t self:tcp_socket create_socket_perms;
Chris PeBenito 17de1b
allow qmail_remote_t self:udp_socket create_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
rw_files_pattern(qmail_remote_t, qmail_spool_t, qmail_spool_t)
Chris PeBenito 17de1b
Chris PeBenito 190066
corenet_all_recvfrom_unlabeled(qmail_remote_t)
Chris PeBenito 190066
corenet_all_recvfrom_netlabel(qmail_remote_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_generic_if(qmail_remote_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_generic_if(qmail_remote_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_generic_node(qmail_remote_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_generic_node(qmail_remote_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_smtp_port(qmail_remote_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_dns_port(qmail_remote_t)
Chris PeBenito 17de1b
corenet_tcp_connect_smtp_port(qmail_remote_t)
Chris PeBenito 17de1b
corenet_sendrecv_smtp_client_packets(qmail_remote_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
dev_read_rand(qmail_remote_t)
Chris PeBenito 17de1b
dev_read_urand(qmail_remote_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
sysnet_read_config(qmail_remote_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# qmail-rspawn local policy
Chris PeBenito 17de1b
#   this component scedules remote deliveries
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow qmail_rspawn_t self:process signal_perms;
Chris PeBenito 0b36a2
allow qmail_rspawn_t self:fifo_file read_fifo_file_perms;
Chris PeBenito 17de1b
Chris PeBenito 0b36a2
allow qmail_rspawn_t qmail_remote_exec_t:file read_file_perms;
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
rw_files_pattern(qmail_rspawn_t, qmail_spool_t, qmail_spool_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
corecmd_search_bin(qmail_rspawn_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# qmail-send local policy
Chris PeBenito 17de1b
#   this component delivers mail messages from the queue
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow qmail_send_t self:process signal_perms;
Chris PeBenito 0b36a2
allow qmail_send_t self:fifo_file write_fifo_file_perms;
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
manage_dirs_pattern(qmail_send_t, qmail_spool_t, qmail_spool_t)
Chris PeBenito 0bfccd
manage_files_pattern(qmail_send_t, qmail_spool_t, qmail_spool_t)
Chris PeBenito 0bfccd
read_fifo_files_pattern(qmail_send_t, qmail_spool_t, qmail_spool_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
qmail_domtrans_queue(qmail_send_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	daemontools_ipc_domain(qmail_send_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# qmail-smtpd local policy
Chris PeBenito 17de1b
#   this component receives mails via SMTP
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow qmail_smtpd_t self:process signal_perms;
Chris PeBenito 0b36a2
allow qmail_smtpd_t self:fifo_file write_fifo_file_perms;
Chris PeBenito 17de1b
allow qmail_smtpd_t self:tcp_socket create_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito 0b36a2
allow qmail_smtpd_t qmail_queue_exec_t:file read_file_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
dev_read_rand(qmail_smtpd_t)
Chris PeBenito 17de1b
dev_read_urand(qmail_smtpd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
qmail_domtrans_queue(qmail_smtpd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	daemontools_ipc_domain(qmail_smtpd_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 5843d0
	kerberos_keytab_template(qmail, qmail_smtpd_t)
Chris PeBenito 5843d0
')
Chris PeBenito 5843d0
Chris PeBenito 5843d0
optional_policy(`
Chris PeBenito 17de1b
	ucspitcp_service_domain(qmail_smtpd_t, qmail_smtpd_exec_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# splogger local policy
Chris PeBenito 17de1b
#   this component creates entries in syslog
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow qmail_splogger_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
files_read_etc_files(qmail_splogger_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
init_dontaudit_use_script_fds(qmail_splogger_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
miscfiles_read_localization(qmail_splogger_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# qmail-start local policy
Chris PeBenito 17de1b
#   this component starts up the mail delivery component
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow qmail_start_t self:capability { setgid setuid };
Chris PeBenito 17de1b
dontaudit qmail_start_t self:capability sys_tty_config;
Chris PeBenito 0b36a2
allow qmail_start_t self:fifo_file rw_fifo_file_perms;
Chris PeBenito 17de1b
allow qmail_start_t self:process signal_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
can_exec(qmail_start_t, qmail_start_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
corecmd_search_bin(qmail_start_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
files_search_var(qmail_start_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
qmail_read_config(qmail_start_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	daemontools_service_domain(qmail_start_t, qmail_start_exec_t)
Chris PeBenito 17de1b
	daemontools_ipc_domain(qmail_start_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# tcp-env local policy
Chris PeBenito 17de1b
#   this component sets up TCP-related environment variables
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 0b36a2
allow qmail_tcp_env_t qmail_smtpd_exec_t:file read_file_perms;
Chris PeBenito 17de1b
Chris PeBenito 8021cb
corecmd_search_bin(qmail_tcp_env_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
sysnet_read_config(qmail_tcp_env_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	inetd_tcp_service_domain(qmail_tcp_env_t, qmail_tcp_env_exec_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	ucspitcp_service_domain(qmail_tcp_env_t, qmail_tcp_env_exec_t)
Chris PeBenito 17de1b
')