Skip to contentSkip to conversation

logwatch tries to look at avahi, avahi needs to use winbind

PATCH [email protected] 2 participants 4 messages Apr 20, 2007 – May 3, 2007 SELinux security module

lore
Share & tools
lore
#0 lore raw
policy/modules/admin/logwatch.te +4 -0
@@ -95,6 +95,10 @@
 ')
 
 optional_policy(`
+	avahi_dontaudit_search_pid(logwatch_t)
+')
+
+optional_policy(`
 	bind_read_config(logwatch_t)
 	bind_read_zone(logwatch_t)
 ')
policy/modules/services/avahi.if +19 -0
@@ -39,3 +39,22 @@
 	files_search_pids($1)
 	stream_connect_pattern($1,avahi_var_run_t,avahi_var_run_t,avahi_t)
 ')
+
+########################################
+## <summary>
+##	Do not audit attempts to search the AVAHI pid directory.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`avahi_dontaudit_search_pid',`
+	gen_require(`
+		type avahi_var_run_t;
+	')
+
+	dontaudit $1 avahi_var_run_t:dir search_dir_perms;
+')
+
policy/modules/services/avahi.te +4 -0
@@ -105,3 +105,7 @@
 optional_policy(`
 	udev_read_db(avahi_t)
 ')
+
+optional_policy(`
+	samba_stream_connect_winbind(avahi_t)
+')

--
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.

#1 lore raw
Quoted 41 lines · On Fri, 2007-04-20 at 14:54 -0400, [email protected] wrote:
policy/modules/admin/logwatch.te +4 -0
@@ -95,6 +95,10 @@
 ')
 
 optional_policy(`
+	avahi_dontaudit_search_pid(logwatch_t)
+')
+
+optional_policy(`
 	bind_read_config(logwatch_t)
 	bind_read_zone(logwatch_t)
 ')
policy/modules/services/avahi.if +19 -0
@@ -39,3 +39,22 @@
 	files_search_pids($1)
 	stream_connect_pattern($1,avahi_var_run_t,avahi_var_run_t,avahi_t)
 ')
+
+########################################
+## <summary>
+##	Do not audit attempts to search the AVAHI pid directory.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`avahi_dontaudit_search_pid',`
+	gen_require(`
+		type avahi_var_run_t;
+	')
+
+	dontaudit $1 avahi_var_run_t:dir search_dir_perms;
+')
+

policy/modules/services/avahi.te line 111

Quoted 7 lines
policy/modules/services/avahi.te +4 -0
@@ -105,3 +105,7 @@
 optional_policy(`
 	udev_read_db(avahi_t)
 ')
+
+optional_policy(`
+	samba_stream_connect_winbind(avahi_t)
+')

Merged except for this last part. I can't find any reference in the avahi code or wiki for it connecting to windbind.

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.
#2 lore raw
Quoted 46 lines · Christopher J. PeBenito
Quoted 44 lines · On Fri, 2007-04-20 at 14:54 -0400, [email protected] wrote:
policy/modules/admin/logwatch.te +4 -0
@@ -95,6 +95,10 @@
 ')
 
 optional_policy(`
+	avahi_dontaudit_search_pid(logwatch_t)
+')
+
+optional_policy(`
 	bind_read_config(logwatch_t)
 	bind_read_zone(logwatch_t)
 ')
policy/modules/services/avahi.if +19 -0
@@ -39,3 +39,22 @@
 	files_search_pids($1)
 	stream_connect_pattern($1,avahi_var_run_t,avahi_var_run_t,avahi_t)
 ')
+
+########################################
+## <summary>
+##	Do not audit attempts to search the AVAHI pid directory.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`avahi_dontaudit_search_pid',`
+	gen_require(`
+		type avahi_var_run_t;
+	')
+
+	dontaudit $1 avahi_var_run_t:dir search_dir_perms;
+')
+
policy/modules/services/avahi.te +0 -0
@@ -105,3 +105,7 @@
 optional_policy(`
 	udev_read_db(avahi_t)
 ')
Quoted 10 lines

policy/modules/services/avahi.te line 111

Quoted 5 lines
policy/modules/services/avahi.te +4 -0
+
+optional_policy(`
+	samba_stream_connect_winbind(avahi_t)
+')

Merged except for this last part. I can't find any reference in the avahi code or wiki for it connecting to windbind.

Right, turns out avahi uses nsswitch, and this is causing the avc. Attached patch to switch to using nsswitch.

policy/modules/services/avahi.te +3 -6
@@ -24,7 +24,6 @@
 allow avahi_t self:fifo_file { read write };
 allow avahi_t self:unix_stream_socket { connectto create_stream_socket_perms };
 allow avahi_t self:unix_dgram_socket create_socket_perms;
-allow avahi_t self:netlink_route_socket r_netlink_socket_perms;
 allow avahi_t self:tcp_socket create_stream_socket_perms;
 allow avahi_t self:udp_socket create_socket_perms;
 
@@ -73,10 +72,8 @@
 logging_send_syslog_msg(avahi_t)
 
 miscfiles_read_localization(avahi_t)
-miscfiles_read_certs(avahi_t)
 
 sysnet_read_config(avahi_t)
-sysnet_use_ldap(avahi_t)
 
 userdom_dontaudit_use_unpriv_user_fds(avahi_t)
 userdom_dontaudit_search_sysadm_home_dirs(avahi_t)
@@ -95,13 +92,13 @@
 ')
 
 optional_policy(`
-	nis_use_ypbind(avahi_t)
+	seutil_sigchld_newrole(avahi_t)
 ')
 
 optional_policy(`
-	seutil_sigchld_newrole(avahi_t)
+	udev_read_db(avahi_t)
 ')
 
 optional_policy(`
-	udev_read_db(avahi_t)
+	auth_use_nsswitch(avahi_t)
 ')
#3 lore raw
Quoted 17 lines · Daniel J Walsh
Quoted 15 lines · Christopher J. PeBenito

policy/modules/services/avahi.te line 111

Quoted 11 lines · On Fri, 2007-04-20 at 14:54 -0400, [email protected] wrote:
policy/modules/services/avahi.te +4 -0
@@ -105,3 +105,7 @@
 optional_policy(`
 	udev_read_db(avahi_t)
 ')
+
+optional_policy(`
+	samba_stream_connect_winbind(avahi_t)
+')

Merged except for this last part. I can't find any reference in the avahi code or wiki for it connecting to windbind.

Quoted 2 lines

Right, turns out avahi uses nsswitch, and this is causing the avc. Attached patch to switch to using nsswitch.

Merged, except I made it unconditional, since I see usage of getpwnam() and getgrnam() in main.c of avahi-daemon.

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.