Skip to contentSkip to conversation

rwho patch

PATCH Daniel J Walsh 2 participants 2 messages Apr 17, 2007 – Apr 30, 2007 SELinux security module

lore
Share & tools
lore
#0 lore raw

Created by Nalin Dahyabhai

policy/modules/services/rwho.fc +3 -0
@@ -0,0 +1,3 @@
+
+/usr/sbin/rwhod		--	gen_context(system_u:object_r:rwho_exec_t,s0)
+/var/spool/rwho(/.*)?		gen_context(system_u:object_r:rwho_spool_t,s0)
policy/modules/services/rwho.if +84 -0

84 lines not on this page · raw message

policy/modules/services/rwho.te +65 -0

65 lines not on this page · raw message

policy/modules/kernel/corenetwork.te.in +1 -0
@@ -132,6 +138,7 @@
 network_port(router, udp,520,s0)
 network_port(rsh, tcp,514,s0)
 network_port(rsync, tcp,873,s0, udp,873,s0)
+network_port(rwho, udp,513,s0)
 network_port(smbd, tcp,139,s0, tcp,445,s0)
 network_port(smtp, tcp,25,s0, tcp,465,s0, tcp,587,s0)
 network_port(snmp, udp,161,s0, udp,162,s0, tcp,199,s0)
#1 lore raw
Quoted 1 line · Daniel J Walsh

Created by Nalin Dahyabhai

Merged with some cleanup.

Quoted 182 lines

differences
between files
attachment
(rwho.patch)

policy/modules/services/rwho.fc 2007-04-17 15:22:46.000000000 -0400 renamed from policy/modules/services/rwho.fc 1969-12-31 19:00:00.000000000 -0500 +3 -0
@@ -0,0 +1,3 @@
+
+/usr/sbin/rwhod                --      gen_context(system_u:object_r:rwho_exec_t,s0)
+/var/spool/rwho(/.*)?          gen_context(system_u:object_r:rwho_spool_t,s0)
policy/modules/services/rwho.if 2007-04-17 15:09:15.000000000 -0400 renamed from policy/modules/services/rwho.if 1969-12-31 19:00:00.000000000 -0500 +84 -0
@@ -0,0 +1,84 @@
+
+## <summary>policy for rwho</summary>
+
+########################################
+## <summary>
+##     Execute a domain transition to run rwho.
+## </summary>
+## <param name="domain">
+## <summary>
+##     Domain allowed to transition.
+## </summary>
+## </param>
+#
+interface(`rwho_domtrans',`
+       gen_require(`
+               type rwho_t, rwho_exec_t;
+       ')
+
+       domain_auto_trans($1,rwho_exec_t,rwho_t)
+
+       allow rwho_t $1:fd use;
+       allow rwho_t $1:fifo_file rw_file_perms;
+       allow rwho_t $1:process sigchld;
+')
+
+########################################
+## <summary>
+##     Search rwho spool directories.
+## </summary>
+## <param name="domain">
+##     <summary>
+##     Domain allowed access.
+##     </summary>
+## </param>
+#
+interface(`rwho_search_spool',`
+       gen_require(`
+               type rwho_spool_t;
+       ')
+
+       allow $1 rwho_spool_t:dir search_dir_perms;
+       files_search_spool($1)
+')
+
+########################################
+## <summary>
+##     Read rwho spool files.
+## </summary>
+## <param name="domain">
+##     <summary>
+##     Domain allowed access.
+##     </summary>
+## </param>
+#
+interface(`rwho_read_spool_files',`
+       gen_require(`
+               type rwho_spool_t;
+       ')
+
+       allow $1 rwho_spool_t:file r_file_perms;
+       allow $1 rwho_spool_t:dir list_dir_perms;
+       files_search_spool($1)
+')
+
+########################################
+## <summary>
+##     Create, read, write, and delete
+##     rwho spool files.
+## </summary>
+## <param name="domain">
+##     <summary>
+##     Domain allowed access.
+##     </summary>
+## </param>
+#
+interface(`rwho_manage_spool_files',`
+       gen_require(`
+               type rwho_spool_t;
+       ')
+
+       allow $1 rwho_spool_t:file manage_file_perms;
+       allow $1 rwho_spool_t:dir rw_dir_perms;
+       files_search_spool($1)
+')
policy/modules/services/rwho.te 2007-04-17 15:21:00.000000000 -0400 renamed from policy/modules/services/rwho.te 1969-12-31 19:00:00.000000000 -0500 +65 -0
@@ -0,0 +1,65 @@
+policy_module(rwho,1.0.0)
+
+########################################
+#
+# Declarations
+#
+
+type rwho_t;
+type rwho_exec_t;
+domain_type(rwho_t)
+init_daemon_domain(rwho_t, rwho_exec_t)
+
+# var/spool files
+type rwho_spool_t;
+files_type(rwho_spool_t)
+
+########################################
+#
+# rwho local policy
+#
+
+#============= rwho_t ==============
+allow rwho_t self:capability sys_chroot;
+allow rwho_t self:unix_dgram_socket create;
+allow rwho_t self:fifo_file rw_file_perms;
+allow rwho_t self:unix_stream_socket create_stream_socket_perms;
+allow rwho_t self:udp_socket create_socket_perms;
+
+# var/spool files for rwho
+allow rwho_t rwho_spool_t:dir manage_dir_perms;
+allow rwho_t rwho_spool_t:file manage_file_perms;
+files_spool_filetrans(rwho_t,rwho_spool_t, { file dir })
+
+domain_use_interactive_fds(rwho_t)
+
+files_read_etc_files(rwho_t)
+
+init_read_utmp(rwho_t)
+init_dontaudit_write_utmp(rwho_t)
+init_use_fds(rwho_t)
+init_use_script_ptys(rwho_t)
+
+kernel_read_system_state(rwho_t)
+
+libs_use_ld_so(rwho_t)
+libs_use_shared_libs(rwho_t)
+
+miscfiles_read_localization(rwho_t)
+
+# Default Networking
+corenet_non_ipsec_sendrecv(rwho_t)
+corenet_udp_sendrecv_all_if(rwho_t)
+corenet_udp_sendrecv_all_nodes(rwho_t)
+corenet_udp_sendrecv_all_ports(rwho_t)
+corenet_udp_bind_all_nodes(rwho_t)
+corenet_udp_bind_rwho_port(rwho_t)
+
+sysnet_dns_name_resolve(rwho_t)
+
+ifdef(`targeted_policy',`
+       term_dontaudit_use_unallocated_ttys(rwho_t)
+       term_dontaudit_use_generic_ptys(rwho_t)
+')
+
+
policy/modules/kernel/corenetwork.te.in 2007-04-17 15:19:50.000000000 -0400 renamed from policy/modules/kernel/corenetwork.te.in 2007-04-11 15:52:53.000000000 -0400 +1 -0
@@ -132,6 +138,7 @@
 network_port(router, udp,520,s0)
 network_port(rsh, tcp,514,s0)
 network_port(rsync, tcp,873,s0, udp,873,s0)
+network_port(rwho, udp,513,s0)
 network_port(smbd, tcp,139,s0, tcp,445,s0)
 network_port(smtp, tcp,25,s0, tcp,465,s0, tcp,587,s0)
 network_port(snmp, udp,161,s0, udp,162,s0, tcp,199,s0)
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.