All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel J Walsh <dwalsh@redhat.com>
To: "Christopher J. PeBenito" <cpebenito@tresys.com>,
	SE Linux <selinux@tycho.nsa.gov>
Subject: Spamd policy patch
Date: Tue, 20 Feb 2007 11:22:24 -0500	[thread overview]
Message-ID: <45DB2040.3030209@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 179 bytes --]

spamassassin has a new directory under /var/lib that it stores files in.

Communicates with smtp port directly.

Needs to be able to create ~/.spam* files

Needs to signal pyzor.

[-- Attachment #2: nsaserefpolicy_policy_modules_services_spamassassin.patch --]
[-- Type: text/x-patch, Size: 3538 bytes --]

--- nsaserefpolicy/policy/modules/services/spamassassin.fc	2006-11-16 17:15:21.000000000 -0500
+++ serefpolicy-2.5.4/policy/modules/services/spamassassin.fc	2007-02-19 16:01:52.000000000 -0500
@@ -7,6 +7,7 @@
 /usr/sbin/spamd		--	gen_context(system_u:object_r:spamd_exec_t,s0)
 
 /var/spool/spamassassin(/.*)?	gen_context(system_u:object_r:spamd_spool_t,s0)
+/var/lib/spamassassin(/.*)?	gen_context(system_u:object_r:spamd_var_lib_t,s0)
 
 ifdef(`strict_policy',`
 HOME_DIR/\.spamassassin(/.*)?	gen_context(system_u:object_r:ROLE_spamassassin_home_t,s0)
--- nsaserefpolicy/policy/modules/services/spamassassin.if	2007-02-19 11:32:53.000000000 -0500
+++ serefpolicy-2.5.4/policy/modules/services/spamassassin.if	2007-02-19 16:01:52.000000000 -0500
@@ -496,3 +496,44 @@
 
 	dontaudit $1 spamd_tmp_t:sock_file getattr;
 ')
+
+########################################
+## <summary>
+##	Create, read, write, and delete
+##	spamd lib files.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`spamassassin_manage_lib_files',`
+	gen_require(`
+		type spamd_var_lib_t;
+	')
+
+	files_search_var_lib($1)
+	manage_dirs_pattern($1,spamd_var_lib_t,spamd_var_lib_t)
+	manage_files_pattern($1,spamd_var_lib_t,spamd_var_lib_t)
+')
+
+########################################
+## <summary>
+##	read spamd lib files.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`spamassassin_read_lib_files',`
+	gen_require(`
+		type spamd_var_lib_t;
+	')
+
+	files_search_var_lib($1)
+	read_files_pattern($1,spamd_var_lib_t,spamd_var_lib_t)
+')
+
--- nsaserefpolicy/policy/modules/services/spamassassin.te	2007-02-19 11:32:53.000000000 -0500
+++ serefpolicy-2.5.4/policy/modules/services/spamassassin.te	2007-02-19 16:01:52.000000000 -0500
@@ -8,7 +8,7 @@
 
 # spamassassin client executable
 type spamc_exec_t;
-corecmd_executable_file(spamc_exec_t)
+userdom_executable_file(spamc_exec_t)
 
 type spamd_t;
 type spamd_exec_t;
@@ -17,6 +17,10 @@
 type spamd_spool_t;
 files_type(spamd_spool_t)
 
+# var/lib files
+type spamd_var_lib_t;
+files_type(spamd_var_lib_t)
+
 type spamd_tmp_t;
 files_tmp_file(spamd_tmp_t)
 
@@ -24,7 +28,7 @@
 files_pid_file(spamd_var_run_t)
 
 type spamassassin_exec_t;
-corecmd_executable_file(spamassassin_exec_t)
+userdom_executable_file(spamassassin_exec_t)
 
 ########################################
 #
@@ -77,6 +81,7 @@
 corenet_tcp_bind_all_nodes(spamd_t)
 corenet_tcp_bind_spamd_port(spamd_t)
 corenet_tcp_connect_razor_port(spamd_t)
+corenet_tcp_connect_smtp_port(spamd_t)
 corenet_sendrecv_razor_client_packets(spamd_t)
 corenet_sendrecv_spamd_server_packets(spamd_t)
 # spamassassin 3.1 needs this for its
@@ -110,6 +115,10 @@
 # /var/lib/spamassin
 files_read_var_lib_files(spamd_t)
 
+# var/lib files for spamd
+allow spamd_t spamd_var_lib_t:dir r_dir_perms;
+read_files_pattern(spamd_t,spamd_var_lib_t,spamd_var_lib_t)
+
 init_use_fds(spamd_t)
 init_use_script_ptys(spamd_t)
 init_dontaudit_rw_utmp(spamd_t)
@@ -139,6 +148,7 @@
 
 	tunable_policy(`spamd_enable_home_dirs',`
 		userdom_home_filetrans_generic_user_home_dir(spamd_t)
+		userdom_manage_generic_user_home_dirs(spamd_t)
 		userdom_manage_generic_user_home_content_dirs(spamd_t)
 		userdom_manage_generic_user_home_content_files(spamd_t)
 		userdom_manage_generic_user_home_content_symlinks(spamd_t)
@@ -184,6 +194,7 @@
 
 optional_policy(`
 	pyzor_domtrans(spamd_t)
+	pyzor_signal(spamd_t)
 ')
 
 optional_policy(`

             reply	other threads:[~2007-02-20 16:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-20 16:22 Daniel J Walsh [this message]
2007-02-26 17:29 ` Spamd policy patch Christopher J. PeBenito

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45DB2040.3030209@redhat.com \
    --to=dwalsh@redhat.com \
    --cc=cpebenito@tresys.com \
    --cc=selinux@tycho.nsa.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.