Skip to contentSkip to conversation

openct modifications

PATCH [email protected] 2 participants 2 messages May 30, 2007 – Jun 11, 2007 SELinux security module

lore
Share & tools
lore
#0 lore raw

correct path to executable
Additional interfaces
openct execs itself and needs access to smartcards and usb devices

policy/modules/services/openct.fc +1 -0
@@ -2,6 +2,7 @@
 # /usr
 #
 /usr/sbin/openct-control	 --	gen_context(system_u:object_r:openct_exec_t,s0)
+/usr/sbin/ifdhandler		--	gen_context(system_u:object_r:openct_exec_t,s0)
 
 #
 # /var
policy/modules/services/openct.if +81 -0

82 lines not on this page · raw message

policy/modules/services/openct.te +6 -0
@@ -21,9 +21,13 @@
 dontaudit openct_t self:capability sys_tty_config;
 allow openct_t self:process signal_perms;
 
+can_exec(openct_t,openct_exec_t)
+
 manage_files_pattern(openct_t,openct_var_run_t,openct_var_run_t)
 files_pid_filetrans(openct_t,openct_var_run_t,file)
 
+corecmd_search_bin(openct_t)
+
 kernel_read_kernel_sysctls(openct_t)
 kernel_list_proc(openct_t)
 kernel_read_proc_symlinks(openct_t)
@@ -31,6 +35,8 @@
 dev_read_sysfs(openct_t)
 # openct asks for this
 dev_rw_usbfs(openct_t)
+dev_rw_smartcard(openct_t)
+dev_rw_generic_usb_dev(openct_t)
 
 domain_use_interactive_fds(openct_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 116 lines · On Wed, 2007-05-30 at 10:38 -0400, [email protected] wrote:

correct path to executable
Additional interfaces
openct execs itself and needs access to smartcards and usb devices

policy/modules/services/openct.fc +1 -0
@@ -2,6 +2,7 @@
 # /usr
 #
 /usr/sbin/openct-control	 --	gen_context(system_u:object_r:openct_exec_t,s0)
+/usr/sbin/ifdhandler		--	gen_context(system_u:object_r:openct_exec_t,s0)
 
 #
 # /var
policy/modules/services/openct.if +81 -0
@@ -1 +1,82 @@
 ## <summary>Service for handling smart card readers.</summary>
+
+########################################
+## <summary>
+##	Execute a domain transition to run openct.
+## </summary>
+## <param name="domain">
+## <summary>
+##	Domain allowed to transition.
+## </summary>
+## </param>
+#
+interface(`openct_domtrans',`
+	gen_require(`
+		type openct_t, openct_exec_t;
+	')
+
+	domain_auto_trans($1,openct_exec_t,openct_t)
+
+	allow openct_t $1:fd use;
+	allow openct_t $1:fifo_file rw_file_perms;
+	allow openct_t $1:process sigchld;
+')
+
+########################################
+## <summary>
+##	Read openct PID files.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`openct_read_pid_files',`
+	gen_require(`
+		type openct_var_run_t;
+	')
+
+	files_search_pids($1)
+	allow $1 openct_var_run_t:dir search_dir_perms;
+	allow $1 openct_var_run_t:file r_file_perms;
+')
+
+########################################
+## <summary>
+##	Connect to openct over an unix stream socket.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`openct_stream_connect',`
+	gen_require(`
+		type openct_t, openct_var_run_t;
+	')
+
+	files_search_pids($1)
+	allow $1 openct_var_run_t:dir search_dir_perms;
+	allow $1 openct_var_run_t:sock_file write;
+	allow $1 openct_t:unix_stream_socket connectto;
+')
+
+########################################
+## <summary>
+##	Send openct a null signal.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`openct_signull',`
+	gen_require(`
+		type openct_t;
+	')
+
+	allow $1 openct_t:process signull;
+')
policy/modules/services/openct.te +4 -0
@@ -21,9 +21,13 @@
 dontaudit openct_t self:capability sys_tty_config;
 allow openct_t self:process signal_perms;
 
+can_exec(openct_t,openct_exec_t)
+
 manage_files_pattern(openct_t,openct_var_run_t,openct_var_run_t)
 files_pid_filetrans(openct_t,openct_var_run_t,file)
 
+corecmd_search_bin(openct_t)
+
 kernel_read_kernel_sysctls(openct_t)
 kernel_list_proc(openct_t)
 kernel_read_proc_symlinks(openct_t)

policy/modules/services/openct.te line 41

Quoted 7 lines
policy/modules/services/openct.te +2 -0
@@ -31,6 +35,8 @@
 dev_read_sysfs(openct_t)
 # openct asks for this
 dev_rw_usbfs(openct_t)
+dev_rw_smartcard(openct_t)
+dev_rw_generic_usb_dev(openct_t)
 
 domain_use_interactive_fds(openct_t)

Merged with some adjustments.

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.