Skip to contentSkip to conversation

pyzor/spam changes in policy

DISCUSSION Christopher J. PeBenito 2 participants 4 messages Mar 7, 2007 – Mar 8, 2007 1 message not in the archive SELinux security module

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 3 lines · On Mon, 2007-02-26 at 12:35 -0500, [email protected] wrote:

New directory for spamassin /var/lib/
spam needs to send signals to pyzor
pyzor uses tmp files

Merged most, exceptions:

Review

Quoted 9 lines
(quoted diff) +9 -0
+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)
+')

Removed the dirs part. If there is an interface needed that has both, then there should be a more abstract interface.

Review line 154

Quoted 8 lines
(quoted diff) +1 -0
@@ -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)

I don't understand why spamd_t would be creating new top level home diretories, for example the /home/myuser dir.

Review line 198

Quoted 6 lines
(quoted diff) +1 -0
@@ -184,6 +194,7 @@
 
 optional_policy(`
 	pyzor_domtrans(spamd_t)
+	pyzor_signal(spamd_t)
 ')

Dropped this and the following, because the interface looks wrong ($1 is the object).

Quoted 17 lines
(quoted diff) +17 -0
+########################################
+## <summary>
+##	Send generic signals to pyzor
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`pyzor_signal',`
+	gen_require(`
+		type pyzor_t;
+	')
+
+	allow pyzor_t $1:process signal;
+')
Signature · 10 lines
Chris PeBenito
Tresys Technology, LLC
(410) 290-1411 x150



--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#2 lore raw
Quoted 27 lines · Christopher J. PeBenito
Quoted 4 lines · On Mon, 2007-02-26 at 12:35 -0500, [email protected] wrote:

New directory for spamassin /var/lib/
spam needs to send signals to pyzor
pyzor uses tmp files

Merged most, exceptions:

Review

Quoted 10 lines
(quoted diff) +9 -0
+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)
+')

Removed the dirs part. If there is an interface needed that has both, then there should be a more abstract interface.

Quoted 2 lines
(quoted diff) +0 -0
@@ -139,6 +148,7 @@
 
Quoted 12 lines

Review line 154

Quoted 7 lines
(quoted diff) +1 -0
 	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)

I don't understand why spamd_t would be creating new top level home diretories, for example the /home/myuser dir.

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=203290

Quoted 22 lines

Review line 199

Quoted 7 lines
(quoted diff) +1 -0
@@ -184,6 +194,7 @@
 
 optional_policy(`
 	pyzor_domtrans(spamd_t)
+	pyzor_signal(spamd_t)
 ')
 

Dropped this and the following, because the interface looks wrong ($1 is the object).

Quoted 10 lines
(quoted diff) +10 -0
+########################################
+## <summary>
+##	Send generic signals to pyzor
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
Quoted 10 lines

Review

Quoted 8 lines
(quoted diff) +7 -0
+interface(`pyzor_signal',`
+	gen_require(`
+		type pyzor_t;
+	')
+
+	allow pyzor_t $1:process signal;
+')

This should be reversed, New patch

policy/modules/services/spamassassin.te +2 -0
@@ -85,6 +85,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
@@ -147,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)
policy/modules/services/pyzor.te +3 -0
@@ -44,6 +44,8 @@
 manage_dirs_pattern(pyzor_t,pyzor_tmp_t,pyzor_tmp_t)
 files_tmp_filetrans(pyzor_t, pyzor_tmp_t, { file dir })
 
+fs_search_auto_mountpoints(pyzor_t)
+
 kernel_read_kernel_sysctls(pyzor_t)  
 kernel_read_system_state(pyzor_t)
 
@@ -77,6 +79,7 @@
 ')
 
 optional_policy(`
+	spamassassin_signal_spamd(pyzor_t)
 	spamassassin_read_spamd_tmp_files(pyzor_t)
 ')
 
#3 lore raw
Quoted 16 lines · Daniel J Walsh
Quoted 15 lines · Christopher J. PeBenito

policy/modules/services/spamassassin.te line 154

Quoted 9 lines · On Mon, 2007-02-26 at 12:35 -0500, [email protected] wrote:
policy/modules/services/spamassassin.te +1 -0
@@ -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)

I don't understand why spamd_t would be creating new top level home diretories, for example the /home/myuser dir.

Quoted 1 line

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=203290

I think this would be the correct fix:

@@ -146,10 +146,10 @@
files_dontaudit_read_root_files(spamd_t)

tunable_policy(spamd_enable_home_dirs',
- userdom_home_filetrans_generic_user_home_dir(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)
+ userdom_generic_user_home_dir_filetrans_generic_user_home_content(spamd_t,dir)

        ')

')

since it is creating the ~/.spamassassin dir the filetrans user_home_dir_t -> user_home_t was missing. The filetrans that was in there did home_root_t -> user_home_dir_t.

Signature · 9 lines
Chris PeBenito
Tresys Technology, LLC
(410) 290-1411 x150


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#4 lore raw
Quoted 38 lines · Christopher J. PeBenito
Quoted 19 lines · Daniel J Walsh
Quoted 4 lines · Christopher J. PeBenito
Quoted 2 lines · On Mon, 2007-02-26 at 12:35 -0500, [email protected] wrote:
(quoted diff) +0 -0
@@ -139,6 +148,7 @@
 
Quoted 13 lines

policy/modules/services/spamassassin.te line 154

Quoted 8 lines
policy/modules/services/spamassassin.te +1 -0
 	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)

I don't understand why spamd_t would be creating new top level home diretories, for example the /home/myuser dir.

Quoted 2 lines

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=203290

I think this would be the correct fix:

(quoted diff) +1 -1
@@ -146,10 +146,10 @@
        files_dontaudit_read_root_files(spamd_t)
 
        tunable_policy(`spamd_enable_home_dirs',`
-               userdom_home_filetrans_generic_user_home_dir(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)
+               userdom_generic_user_home_dir_filetrans_generic_user_home_content(spamd_t,dir)
        ')
 ')
 
Quoted 5 lines

since it is creating the ~/.spamassassin dir the filetrans user_home_dir_t -> user_home_t was missing. The filetrans that was in there did home_root_t -> user_home_dir_t.

Thats ok with me.

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.