Conditionally allow ssh to use gpg-agent
PATCH 1/1 Conditionally allow ssh to use gpg-agent
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(+)
policy/modules/services/ssh.if +7 -0
@@ -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) + ') + ') ') ########################################
policy/modules/services/ssh.te +13 -0
@@ -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
Signature · 1 line
1.8.5.3
PATCH 1/1 Conditionally allow ssh to use gpg-agent
Quoted 2 lines · On Sun, 2 Feb 2014 01:19:05 +0100 Luis Ressel <[email protected]> wrote:
(quoted diff) +1
-0+ stream_connect_pattern(ssh_t, gpg_agent_tmp_t,
gpg_agent_tmp_t,gpg_agent_t)
Sorry, I forgot again to add a proper interface for that.
--
Luis Ressel <[email protected]>
GPG fpr: F08D 2AF6 655E 25DE 52BC E53D 08F5 7F90 3029 B5BD
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 966 bytes
Desc: not available
Url : http://oss.tresys.com/pipermail/refpolicy/attachments/20140202/3fab5427/attachment.bin
PATCH v2 1/1 gpg: Create gpg_agent_connect interface
--- gpg.if | 18 ++++++++++++++++++ gpg.te | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-)
gpg.if +18 -0
@@ -193,6 +193,24 @@ interface(`gpg_rw_agent_pipes',` ######################################## ## <summary> +## Connect to gpg agent socket +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`gpg_agent_connect',` + gen_require(` + type gpg_agent_t, gpg_agent_tmp_t; + ') + + stream_connect_pattern($1, gpg_agent_tmp_t, gpg_agent_tmp_t, gpg_agent_t) +') + +######################################## +## <summary> ## Send messages to and from gpg ## pinentry over DBUS. ## </summary>
gpg.te +1 -1
@@ -93,7 +93,7 @@ manage_files_pattern(gpg_t, gpg_secret_t, gpg_secret_t) manage_lnk_files_pattern(gpg_t, gpg_secret_t, gpg_secret_t) userdom_user_home_dir_filetrans(gpg_t, gpg_secret_t, dir) -stream_connect_pattern(gpg_t, gpg_agent_tmp_t, gpg_agent_tmp_t, gpg_agent_t) +gpg_agent_connect(gpg_t) domtrans_pattern(gpg_t, gpg_agent_exec_t, gpg_agent_t) domtrans_pattern(gpg_t, gpg_helper_exec_t, gpg_helper_t)
Signature · 1 line
1.8.5.3
PATCH v2 1/1 gpg: Create gpg_agent_connect interface
Quoted 39 lines · Luis Ressel
--- gpg.if | 18 ++++++++++++++++++ gpg.te | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-)gpg.if +18
-0@@ -193,6 +193,24 @@ interface(`gpg_rw_agent_pipes',` ######################################## ## <summary> +## Connect to gpg agent socket +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`gpg_agent_connect',` + gen_require(` + type gpg_agent_t, gpg_agent_tmp_t; + ') + + stream_connect_pattern($1, gpg_agent_tmp_t, gpg_agent_tmp_t, gpg_agent_t) +') + +######################################## +## <summary> ## Send messages to and from gpg ## pinentry over DBUS. ## </summary>gpg.te +0
-0
gpg.te manage_files_pattern(gpg_t, gpg_secret_t, gpg_secret_t) · line 99
Quoted 8 lines
gpg.te +1
-1@@ -93,7 +93,7 @@ manage_files_pattern(gpg_t, gpg_secret_t, gpg_secret_t) manage_lnk_files_pattern(gpg_t, gpg_secret_t, gpg_secret_t) userdom_user_home_dir_filetrans(gpg_t, gpg_secret_t, dir) -stream_connect_pattern(gpg_t, gpg_agent_tmp_t, gpg_agent_tmp_t, gpg_agent_t) +gpg_agent_connect(gpg_t) domtrans_pattern(gpg_t, gpg_agent_exec_t, gpg_agent_t) domtrans_pattern(gpg_t, gpg_helper_exec_t, gpg_helper_t)
Merged. I renamed the interface to gpg_stream_connect_agent().
Signature · 3 lines
Chris PeBenito Tresys Technology, LLC www.tresys.com | oss.tresys.com
PATCH v2 1/1 Conditionally allow ssh to use gpg-agent
In reply to Luis Resselgpg-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(+)
policy/modules/services/ssh.if +7 -0
@@ -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 + gpg_agent_connect($3) + ') + ') ') ########################################
policy/modules/services/ssh.te +13 -0
@@ -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',` + gpg_agent_connect(ssh_t) + ') +') + ############################## # # ssh_keysign_t local policy
Signature · 1 line
1.8.5.3
PATCH v2 1/1 Conditionally allow ssh to use gpg-agent
Quoted 46 lines · Luis Ressel
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(+)policy/modules/services/ssh.if +7
-0@@ -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 + gpg_agent_connect($3) + ') + ') ') ########################################policy/modules/services/ssh.te +7
-0@@ -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) ')
policy/modules/services/ssh.te optional_policy(` · line 220
Quoted 10 lines
policy/modules/services/ssh.te +6
-0+optional_policy(` + tunable_policy(`ssh_use_gpg_agent',` + gpg_agent_connect(ssh_t) + ') +') + ############################## # # ssh_keysign_t local policy
Merged.
Signature · 3 lines
Chris PeBenito Tresys Technology, LLC www.tresys.com | oss.tresys.com