All of lore.kernel.org
 help / color / mirror / Atom feed
* [refpolicy] [PATCH] Conditionally allow ssh to use gpg-agent
@ 2014-02-02  0:19 Luis Ressel
  2014-02-02 12:05 ` Luis Ressel
  0 siblings, 1 reply; 6+ messages in thread
From: Luis Ressel @ 2014-02-02  0:19 UTC (permalink / raw)
  To: refpolicy

gpg-agent also offers an ssh-compatible interface. This is useful e.g.
for smartcard authentication.
---
 policy/modules/services/ssh.if |  7 +++++++
 policy/modules/services/ssh.te | 13 +++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/policy/modules/services/ssh.if b/policy/modules/services/ssh.if
index fe0c682..96c7596 100644
--- a/policy/modules/services/ssh.if
+++ b/policy/modules/services/ssh.if
@@ -425,6 +425,13 @@ template(`ssh_role_template',`
 		xserver_use_xdm_fds($1_ssh_agent_t)
 		xserver_rw_xdm_pipes($1_ssh_agent_t)
 	')
+
+	optional_policy(`
+		tunable_policy(`ssh_use_gpg_agent',`
+			# for ssh-add
+			stream_connect_pattern($3, gpg_agent_tmp_t, gpg_agent_tmp_t, gpg_agent_t)
+		')
+	')
 ')
 
 ########################################
diff --git a/policy/modules/services/ssh.te b/policy/modules/services/ssh.te
index 30726f2..0cfdc7b 100644
--- a/policy/modules/services/ssh.te
+++ b/policy/modules/services/ssh.te
@@ -19,6 +19,13 @@ gen_tunable(allow_ssh_keysign, false)
 ## </desc>
 gen_tunable(ssh_sysadm_login, false)
 
+## <desc>
+## <p>
+## Allow ssh to use gpg-agent
+## </p>
+## </desc>
+gen_tunable(ssh_use_gpg_agent, false)
+
 attribute ssh_server;
 attribute ssh_agent_type;
 
@@ -202,6 +209,12 @@ optional_policy(`
 	xserver_domtrans_xauth(ssh_t)
 ')
 
+optional_policy(`
+	tunable_policy(`ssh_use_gpg_agent',`
+		stream_connect_pattern(ssh_t, gpg_agent_tmp_t, gpg_agent_tmp_t, gpg_agent_t)
+	')
+')
+
 ##############################
 #
 # ssh_keysign_t local policy
-- 
1.8.5.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-02-08 13:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-02  0:19 [refpolicy] [PATCH] Conditionally allow ssh to use gpg-agent Luis Ressel
2014-02-02 12:05 ` Luis Ressel
2014-02-02 12:18   ` [refpolicy] [PATCH v2] gpg: Create gpg_agent_connect interface Luis Ressel
2014-02-08 13:31     ` Christopher J. PeBenito
2014-02-02 12:19   ` [refpolicy] [PATCH v2] Conditionally allow ssh to use gpg-agent Luis Ressel
2014-02-08 13:32     ` Christopher J. PeBenito

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.