diff -N -u -r nsaserefpolicy/policy/modules/apps/gitosis.fc serefpolicy-3.5.13/policy/modules/apps/gitosis.fc
--- nsaserefpolicy/policy/modules/apps/gitosis.fc	1970-01-01 01:00:00.000000000 +0100
+++ serefpolicy-3.5.13/policy/modules/apps/gitosis.fc	2009-03-11 20:39:50.000000000 +0100
@@ -0,0 +1,4 @@
+
+/usr/bin/gitosis-serve			--        gen_context(system_u:object_r:gitosis_exec_t,s0)
+
+/var/lib/gitosis(/.*)?                            gen_context(system_u:object_r:gitosis_var_lib_t,s0)
diff -N -u -r nsaserefpolicy/policy/modules/apps/gitosis.if serefpolicy-3.5.13/policy/modules/apps/gitosis.if
--- nsaserefpolicy/policy/modules/apps/gitosis.if	1970-01-01 01:00:00.000000000 +0100
+++ serefpolicy-3.5.13/policy/modules/apps/gitosis.if	2009-03-11 20:39:59.000000000 +0100
@@ -0,0 +1,94 @@
+## <summary>gitosis interface</summary>
+
+#######################################
+## <summary>
+##      Execute a domain transition to run gitosis.
+## </summary>
+## <param name="domain">
+## <summary>
+##      Domain allowed to transition.
+## </summary>
+## </param>
+#
+interface(`gitosis_domtrans',`
+        gen_require(`
+                type gitosis_t, gitosis_exec_t;
+        ')
+
+        domtrans_pattern($1, gitosis_exec_t, gitosis_t)
+')
+
+#######################################
+## <summary>
+##      Execute gitosis-serve in the gitosis domain, and
+##      allow the specified role the gitosis domain.
+## </summary>
+## <param name="domain">
+##      <summary>
+##      Domain allowed access
+##      </summary>
+## </param>
+## <param name="role">
+##      <summary>
+##      The role to be allowed the gpsd domain.
+##      </summary>
+## </param>
+## <param name="terminal">
+##      <summary>
+##      The type of the role's terminal.
+##      </summary>
+## </param>
+#
+interface(`gitosis_run',`
+        gen_require(`
+                type gitosis_t;
+        ')
+
+        gitosis_domtrans($1)
+        role $2 types gitosis_t;
+        allow gitosis_t $3:chr_file rw_term_perms;
+')
+
+#######################################
+## <summary>
+##      Allow the specified domain to read
+##      gitosis lib files.
+## </summary>
+## <param name="domain">
+##      <summary>
+##      Domain allowed access.
+##      </summary>
+## </param>
+#
+interface(`gitosis_read_var_lib',`
+        gen_require(`
+                type gitosis_var_lib_t;
+
+        ')
+
+        read_files_pattern($1, gitosis_var_lib_t, gitosis_var_lib_t)
+	read_lnk_files_pattern($1, gitosis_var_lib_t, gitosis_var_lib_t)
+        list_dirs_pattern($1, gitosis_var_lib_t, gitosis_var_lib_t)
+')
+
+######################################
+## <summary>
+##      Allow the specified domain to manage
+##      gitosis lib files.
+## </summary>
+## <param name="domain">
+##      <summary>
+##      Domain allowed access.
+##      </summary>
+## </param>
+#
+interface(`gitosis_manage_var_lib',`
+        gen_require(`
+                type gitosis_var_lib_t;
+
+        ')
+
+        manage_files_pattern($1, gitosis_var_lib_t, gitosis_var_lib_t)
+        manage_lnk_files_pattern($1, gitosis_var_lib_t, gitosis_var_lib_t)
+	manage_dirs_pattern($1, gitosis_var_lib_t, gitosis_var_lib_t)
+')
diff -N -u -r nsaserefpolicy/policy/modules/apps/gitosis.te serefpolicy-3.5.13/policy/modules/apps/gitosis.te
--- nsaserefpolicy/policy/modules/apps/gitosis.te	1970-01-01 01:00:00.000000000 +0100
+++ serefpolicy-3.5.13/policy/modules/apps/gitosis.te	2009-03-11 20:39:26.000000000 +0100
@@ -0,0 +1,43 @@
+policy_module(gitosis,1.0.0)
+
+########################################
+#
+# Declarations
+#
+
+type gitosis_t;
+type gitosis_exec_t;
+application_domain(gitosis_t, gitosis_exec_t)
+role system_r types gitosis_t;
+
+type gitosis_var_lib_t;
+files_type(gitosis_var_lib_t)
+
+########################################
+#
+# gitosis local policy
+#
+
+allow gitosis_t self:fifo_file rw_fifo_file_perms;
+
+exec_files_pattern(gitosis_t,gitosis_var_lib_t,gitosis_var_lib_t)
+manage_files_pattern(gitosis_t,gitosis_var_lib_t,gitosis_var_lib_t)
+manage_lnk_files_pattern(gitosis_t,gitosis_var_lib_t,gitosis_var_lib_t)
+manage_dirs_pattern(gitosis_t,gitosis_var_lib_t,gitosis_var_lib_t)
+
+corecmd_exec_bin(gitosis_t) 
+corecmd_exec_shell(gitosis_t)
+
+kernel_read_system_state(gitosis_t)
+
+files_read_usr_files(gitosis_t)
+files_search_var_lib(gitosis_t)
+
+libs_use_ld_so(gitosis_t)
+libs_use_shared_libs(gitosis_t)
+
+miscfiles_read_localization(gitosis_t)
+
+optional_policy(`
+	ssh_rw_pipes(gitosis_t)
+')
diff -N -u -r nsaserefpolicy/policy/modules/services/ssh.if serefpolicy-3.5.13/policy/modules/services/ssh.if
--- nsaserefpolicy/policy/modules/services/ssh.if	2009-03-11 20:38:45.000000000 +0100
+++ serefpolicy-3.5.13/policy/modules/services/ssh.if	2009-03-11 20:42:23.000000000 +0100
@@ -619,6 +619,25 @@
 	allow $1 sshd_t:tcp_socket rw_stream_socket_perms;
 ')
 
+#######################################
+## <summary>
+##      Allow attempts to read and write to
+##      sshd unnamed pipes.
+## </summary>
+## <param name="domain">
+##      <summary>
+##      Domain allowed access.
+##      </summary>
+## </param>
+#
+interface(`ssh_rw_pipes',`
+        gen_require(`
+                type sshd_t;
+        ')
+
+        allow $1 sshd_t:fifo_file rw_fifo_file_perms;
+')
+
 ########################################
 ## <summary>
 ##	Do not audit attempts to read and write
diff -N -u -r nsaserefpolicy/policy/modules/services/ssh.te serefpolicy-3.5.13/policy/modules/services/ssh.te
--- nsaserefpolicy/policy/modules/services/ssh.te	2009-03-11 20:38:45.000000000 +0100
+++ serefpolicy-3.5.13/policy/modules/services/ssh.te	2009-03-11 20:41:30.000000000 +0100
@@ -132,6 +132,10 @@
 ')
 
 optional_policy(`
+	gitosis_read_var_lib(sshd_t)
+')
+
+optional_policy(`
 	inetd_tcp_service_domain(sshd_t, sshd_exec_t)
 ')
 
diff -N -u -r nsaserefpolicy/policy/modules/system/unconfined.te serefpolicy-3.5.13/policy/modules/system/unconfined.te
--- nsaserefpolicy/policy/modules/system/unconfined.te	2009-03-11 20:38:45.000000000 +0100
+++ serefpolicy-3.5.13/policy/modules/system/unconfined.te	2009-03-11 20:40:34.000000000 +0100
@@ -183,6 +183,10 @@
 ')
 
 optional_policy(`
+       gitosis_run(unconfined_t, unconfined_r, { unconfined_tty_device_t unconfined_devpts_t })
+')
+
+optional_policy(`
         gpsd_run(unconfined_t, unconfined_r, { unconfined_tty_device_t unconfined_devpts_t })
 ')
 
