[selinux-policy: 1039/3172] add fetchmail

Daniel J Walsh dwalsh at fedoraproject.org
Thu Oct 7 20:34:44 UTC 2010


commit a089b6d0c9d5e2f2d83e35ecc4a0bf619711633c
Author: Chris PeBenito <cpebenito at tresys.com>
Date:   Thu Dec 8 15:58:12 2005 +0000

    add fetchmail

 refpolicy/Changelog                            |    1 +
 refpolicy/policy/modules/services/fetchmail.fc |   19 +++++
 refpolicy/policy/modules/services/fetchmail.if |    1 +
 refpolicy/policy/modules/services/fetchmail.te |   99 ++++++++++++++++++++++++
 refpolicy/policy/modules/services/mta.if       |   31 ++++++++
 5 files changed, 151 insertions(+), 0 deletions(-)
---
diff --git a/refpolicy/Changelog b/refpolicy/Changelog
index 8d12200..324f1a1 100644
--- a/refpolicy/Changelog
+++ b/refpolicy/Changelog
@@ -1,4 +1,5 @@
 - Added modules:
+	fetchmail
 	sysstat
 
 * Wed Dec 07 2005 Chris PeBenito <selinux at tresys.com> - 20051207
diff --git a/refpolicy/policy/modules/services/fetchmail.fc b/refpolicy/policy/modules/services/fetchmail.fc
new file mode 100644
index 0000000..455c620
--- /dev/null
+++ b/refpolicy/policy/modules/services/fetchmail.fc
@@ -0,0 +1,19 @@
+
+#
+# /etc
+#
+
+/etc/fetchmailrc		--	gen_context(system_u:object_r:fetchmail_etc_t,s0)
+
+#
+# /usr
+#
+
+/usr/bin/fetchmail		--	gen_context(system_u:object_r:fetchmail_exec_t,s0)
+
+#
+# /var
+#
+
+/var/run/fetchmail/.*		--	gen_context(system_u:object_r:fetchmail_var_run_t,s0)
+/var/mail/\.fetchmail-UIDL-cache --	gen_context(system_u:object_r:fetchmail_uidl_cache_t,s0)
diff --git a/refpolicy/policy/modules/services/fetchmail.if b/refpolicy/policy/modules/services/fetchmail.if
new file mode 100644
index 0000000..fde49b7
--- /dev/null
+++ b/refpolicy/policy/modules/services/fetchmail.if
@@ -0,0 +1 @@
+## <summary>Remote-mail retrieval and forwarding utility</summary>
diff --git a/refpolicy/policy/modules/services/fetchmail.te b/refpolicy/policy/modules/services/fetchmail.te
new file mode 100644
index 0000000..d5ea203
--- /dev/null
+++ b/refpolicy/policy/modules/services/fetchmail.te
@@ -0,0 +1,99 @@
+
+policy_module(fetchmail,1.0.0)
+
+########################################
+#
+# Declarations
+#
+type fetchmail_t;
+type fetchmail_exec_t;
+init_daemon_domain(fetchmail_t,fetchmail_exec_t)
+
+type fetchmail_var_run_t;
+files_pid_file(fetchmail_var_run_t)
+
+type fetchmail_etc_t;
+files_type(fetchmail_etc_t)
+
+type fetchmail_uidl_cache_t;
+files_type(fetchmail_uidl_cache_t)
+
+########################################
+#
+# Local policy
+#
+
+dontaudit fetchmail_t self:capability sys_tty_config;
+allow fetchmail_t self:process { signal_perms setrlimit };
+allow fetchmail_t self:unix_dgram_socket create_socket_perms;
+allow fetchmail_t self:unix_stream_socket create_stream_socket_perms;
+allow fetchmail_t self:tcp_socket create_socket_perms;
+allow fetchmail_t self:udp_socket create_socket_perms;
+
+allow fetchmail_t fetchmail_etc_t:file r_file_perms;
+
+allow fetchmail_t fetchmail_uidl_cache_t:file create_file_perms;
+mta_create_spool(fetchmail_t,fetchmail_uidl_cache_t)
+
+allow fetchmail_t fetchmail_var_run_t:file create_file_perms;
+allow fetchmail_t fetchmail_var_run_t:dir rw_dir_perms;
+files_create_pid(fetchmail_t,fetchmail_var_run_t)
+
+kernel_read_kernel_sysctl(fetchmail_t)
+kernel_list_proc(fetchmail_t)
+kernel_read_proc_symlinks(fetchmail_t)
+
+corenet_non_ipsec_sendrecv(fetchmail_t)
+corenet_tcp_sendrecv_generic_if(fetchmail_t)
+corenet_udp_sendrecv_generic_if(fetchmail_t)
+corenet_raw_sendrecv_generic_if(fetchmail_t)
+corenet_tcp_sendrecv_all_nodes(fetchmail_t)
+corenet_udp_sendrecv_all_nodes(fetchmail_t)
+corenet_raw_sendrecv_all_nodes(fetchmail_t)
+corenet_tcp_sendrecv_dns_port(fetchmail_t)
+corenet_udp_sendrecv_dns_port(fetchmail_t)
+corenet_tcp_sendrecv_pop_port(fetchmail_t)
+corenet_tcp_sendrecv_smtp_port(fetchmail_t)
+corenet_tcp_bind_all_nodes(fetchmail_t)
+corenet_udp_bind_all_nodes(fetchmail_t)
+corenet_tcp_connect_all_ports(fetchmail_t)
+
+dev_read_sysfs(fetchmail_t)
+
+files_read_etc_files(fetchmail_t)
+
+fs_getattr_all_fs(fetchmail_t)
+fs_search_auto_mountpoints(fetchmail_t)
+
+term_dontaudit_use_console(fetchmail_t)
+
+domain_use_wide_inherit_fd(fetchmail_t)
+
+init_use_fd(fetchmail_t)
+init_use_script_pty(fetchmail_t)
+
+libs_use_ld_so(fetchmail_t)
+libs_use_shared_libs(fetchmail_t)
+
+logging_send_syslog_msg(fetchmail_t)
+
+miscfiles_read_localization(fetchmail_t)
+
+sysnet_read_config(fetchmail_t)
+
+userdom_dontaudit_use_unpriv_user_fd(fetchmail_t)
+userdom_dontaudit_search_sysadm_home_dir(fetchmail_t)
+
+ifdef(`targeted_policy',`
+	term_dontaudit_use_unallocated_tty(fetchmail_t)
+	term_dontaudit_use_generic_pty(fetchmail_t)
+	files_dontaudit_read_root_file(fetchmail_t)
+')
+
+optional_policy(`selinuxutil',`
+	seutil_sigchld_newrole(fetchmail_t)
+')
+
+optional_policy(`udev',`
+	udev_read_db(fetchmail_t)
+')
diff --git a/refpolicy/policy/modules/services/mta.if b/refpolicy/policy/modules/services/mta.if
index bf2bb0f..c4ec347 100644
--- a/refpolicy/policy/modules/services/mta.if
+++ b/refpolicy/policy/modules/services/mta.if
@@ -581,6 +581,37 @@ interface(`mta_getattr_spool',`
 ')
 
 #######################################
+## <summary>
+##	Create private objects in the 
+##	mail spool directory.
+## </summary>
+## <param name="domain">
+##	Domain allowed access.
+## </param>
+## <param name="private type">
+##	The type of the object to be created.
+## </param>
+## <param name="object" optional="true">
+##	The object class of the object being created.  If
+##	no class is specified, file will be used.
+## </param>
+#
+interface(`mta_create_spool',`
+	gen_require(`
+		type mail_spool_t;
+	')
+
+	files_search_spool($1)
+	allow $1 mail_spool_t:dir rw_dir_perms;
+
+	ifelse(`$3',`',`
+		type_transition $1 mail_spool_t:file $2;
+	',`
+		type_transition $1 mail_spool_t:$3 $2;
+	')
+')
+
+#######################################
 #
 # mta_rw_spool(domain)
 #


More information about the scm-commits mailing list