[selinux-policy: 1411/3172] add sxid, bug 1661

Daniel J Walsh dwalsh at fedoraproject.org
Thu Oct 7 21:07:22 UTC 2010


commit b6cc2f91f4c5451ae936c6d278f4834bf0c2b856
Author: Chris PeBenito <cpebenito at tresys.com>
Date:   Mon May 1 20:36:13 2006 +0000

    add sxid, bug 1661

 refpolicy/Changelog                      |    1 +
 refpolicy/policy/modules/admin/sxid.fc   |    6 ++
 refpolicy/policy/modules/admin/sxid.if   |   21 ++++++
 refpolicy/policy/modules/admin/sxid.te   |  111 ++++++++++++++++++++++++++++++
 refpolicy/policy/modules/services/mta.te |    6 ++-
 5 files changed, 144 insertions(+), 1 deletions(-)
---
diff --git a/refpolicy/Changelog b/refpolicy/Changelog
index 003d307..cdf13c2 100644
--- a/refpolicy/Changelog
+++ b/refpolicy/Changelog
@@ -74,6 +74,7 @@
 	snort
 	soundserver
 	speedtouch
+	sxid
 	thunderbird
 	tor (Erich Schubert)
 	transproxy
diff --git a/refpolicy/policy/modules/admin/sxid.fc b/refpolicy/policy/modules/admin/sxid.fc
new file mode 100644
index 0000000..a512da7
--- /dev/null
+++ b/refpolicy/policy/modules/admin/sxid.fc
@@ -0,0 +1,6 @@
+/usr/bin/sxid		--	gen_require(system_u:object_r:sxid_exec_t,s0)
+/usr/sbin/checksecurity\.se --	gen_require(system_u:object_r:sxid_exec_t,s0)
+
+/var/log/setuid.*	--	gen_require(system_u:object_r:sxid_log_t,s0)
+/var/log/setuid\.today.* --	gen_require(system_u:object_r:sxid_log_t,s0)
+/var/log/sxid\.log.*	--	gen_require(system_u:object_r:sxid_log_t,s0)
diff --git a/refpolicy/policy/modules/admin/sxid.if b/refpolicy/policy/modules/admin/sxid.if
new file mode 100644
index 0000000..36c3a48
--- /dev/null
+++ b/refpolicy/policy/modules/admin/sxid.if
@@ -0,0 +1,21 @@
+## <summary>SUID/SGID program monitoring</summary>
+
+########################################
+## <summary>
+##	Allow the specified domain to read
+##	sxid log files.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`sxid_read_log',`
+	gen_require(`
+		type sxid_log_t;
+	')
+
+	logging_search_logs($1)
+	allow $1 sxid_log_t:file r_file_perms;
+')
diff --git a/refpolicy/policy/modules/admin/sxid.te b/refpolicy/policy/modules/admin/sxid.te
new file mode 100644
index 0000000..1c9f289
--- /dev/null
+++ b/refpolicy/policy/modules/admin/sxid.te
@@ -0,0 +1,111 @@
+
+policy_module(sxid,1.0.0)
+
+########################################
+#
+# Declarations
+#
+
+type sxid_t;
+type sxid_exec_t;
+domain_type(sxid_t)
+domain_entry_file(sxid_t,sxid_exec_t)
+
+type sxid_log_t;
+logging_log_file(sxid_log_t)
+
+type sxid_tmp_t;
+files_tmp_file(sxid_tmp_t)
+
+########################################
+#
+# Local policy
+#
+
+allow sxid_t self:capability { dac_override dac_read_search fsetid };
+dontaudit sxid_t self:capability { setuid setgid sys_tty_config };
+allow sxid_t self:process signal_perms;
+allow sxid_t self:fifo_file rw_file_perms;
+allow sxid_t self:tcp_socket create_stream_socket_perms;
+allow sxid_t self:udp_socket create_socket_perms;
+
+allow sxid_t sxid_log_t:file create_file_perms;
+logging_log_filetrans(sxid_t,sxid_log_t,file)
+
+allow sxid_t sxid_tmp_t:dir create_dir_perms;
+allow sxid_t sxid_tmp_t:file create_file_perms;
+files_tmp_filetrans(sxid_t, sxid_tmp_t, { file dir })
+
+kernel_read_system_state(sxid_t)
+kernel_read_kernel_sysctls(sxid_t)
+
+corecmd_exec_bin(sxid_t)
+corecmd_exec_sbin(sxid_t)
+corecmd_exec_shell(sxid_t)
+
+corenet_tcp_sendrecv_generic_if(sxid_t)
+corenet_udp_sendrecv_generic_if(sxid_t)
+corenet_raw_sendrecv_generic_if(sxid_t)
+corenet_tcp_sendrecv_all_nodes(sxid_t)
+corenet_udp_sendrecv_all_nodes(sxid_t)
+corenet_raw_sendrecv_all_nodes(sxid_t)
+corenet_tcp_sendrecv_all_ports(sxid_t)
+corenet_udp_sendrecv_all_ports(sxid_t)
+corenet_non_ipsec_sendrecv(sxid_t)
+corenet_tcp_bind_all_nodes(sxid_t)
+corenet_udp_bind_all_nodes(sxid_t)
+
+dev_read_sysfs(sxid_t)
+dev_getattr_all_blk_files(sxid_t)
+dev_getattr_all_blk_files(sxid_t)
+
+domain_use_interactive_fds(sxid_t)
+
+files_list_all(sxid_t)
+files_getattr_all_symlinks(sxid_t)
+files_getattr_all_pipes(sxid_t)
+files_getattr_all_sockets(sxid_t)
+
+fs_getattr_xattr_fs(sxid_t)
+fs_search_auto_mountpoints(sxid_t)
+fs_list_all(sxid_t)
+
+term_dontaudit_use_console(sxid_t)
+
+auth_read_all_files_except_shadow(sxid_t)
+
+init_use_fds(sxid_t)
+init_use_script_ptys(sxid_t)
+
+libs_use_ld_so(sxid_t)
+libs_use_shared_libs(sxid_t)
+
+logging_send_syslog_msg(sxid_t)
+
+miscfiles_read_localization(sxid_t)
+
+mount_exec(sxid_t)
+
+sysnet_read_config(sxid_t)
+
+userdom_dontaudit_use_unpriv_user_fds(sxid_t)
+
+cron_system_entry(sxid_t,sxid_exec_t)
+
+ifdef(`targeted_policy',`
+	term_dontaudit_use_unallocated_ttys(sxid_t)
+	term_dontaudit_use_generic_ptys(sxid_t)
+	files_dontaudit_read_root_files(sxid_t)
+')
+
+optional_policy(`
+	mta_send_mail(sxid_t)
+')
+
+optional_policy(`
+	seutil_sigchld_newrole(sxid_t)
+')
+
+optional_policy(`
+	udev_read_db(sxid_t)
+')
diff --git a/refpolicy/policy/modules/services/mta.te b/refpolicy/policy/modules/services/mta.te
index 0fef637..35bf0cd 100644
--- a/refpolicy/policy/modules/services/mta.te
+++ b/refpolicy/policy/modules/services/mta.te
@@ -1,5 +1,5 @@
 
-policy_module(mta,1.3.3)
+policy_module(mta,1.3.4)
 
 ########################################
 #
@@ -167,6 +167,10 @@ optional_policy(`
 ')
 
 optional_policy(`
+	sxid_read_log(system_mail_t)
+')
+
+optional_policy(`
 	userdom_dontaudit_use_unpriv_users_ptys(system_mail_t)
 
 	optional_policy(`


More information about the scm-commits mailing list