All of lore.kernel.org
 help / color / mirror / Atom feed
From: dac.override@gmail.com (Dominick Grift)
To: refpolicy@oss.tresys.com
Subject: [refpolicy] [PATCH] gpg: manage user runtime socket files and directories
Date: Tue, 23 May 2017 08:43:31 +0200	[thread overview]
Message-ID: <20170523064331.GA23273@julius.enp8s0.d30> (raw)
In-Reply-To: <1F5CB8FD-2213-4ADC-B078-EDD507FA9500@trentalancia.com>

On Tue, May 23, 2017 at 03:04:52AM +0200, Guido Trentalancia via refpolicy wrote:
> Hello and thanks for getting back... 
> 
> On the 23rd of May 2017 01:24:59 CEST, Chris PeBenito <pebenito@ieee.org> wrote:
> >On 05/21/2017 12:21 PM, Guido Trentalancia via refpolicy wrote:
> >> Update the gpg module so that it can correctly manage socket files
> >> and directories in the user runtime directories.
> >>
> >> Some other minor fixes are also included in this patch.
> >>
> >> Signed-off-by: Guido Trentalancia <guido@trentalancia.com>
> >> ---
> >>  policy/modules/contrib/gpg.te |   10 +++++++++-
> >>  1 file changed, 9 insertions(+), 1 deletion(-)
> >>
> >> --- a/policy/modules/contrib/gpg.te	2017-04-26 17:47:20.555423022
> >+0200
> >> +++ b/policy/modules/contrib/gpg.te	2017-05-21 18:13:36.728343506
> >+0200
> >> @@ -124,6 +124,8 @@ miscfiles_read_localization(gpg_t)
> >>
> >>  userdom_use_user_terminals(gpg_t)
> >>
> >> +userdom_manage_user_runtime_dirs(gpg_t)
> >> +userdom_manage_user_tmp_dirs(gpg_t)
> >>  userdom_manage_user_tmp_files(gpg_t)
> >>  userdom_manage_user_home_content_files(gpg_t)
> >>  userdom_user_home_dir_filetrans_user_home_content(gpg_t, file)
> >> @@ -247,10 +249,14 @@ fs_dontaudit_list_inotifyfs(gpg_agent_t)
> >>
> >>  miscfiles_read_localization(gpg_agent_t)
> >>
> >> +userdom_manage_user_runtime_dirs(gpg_agent_t)
> >> +userdom_manage_user_tmp_dirs(gpg_agent_t)
> >> +userdom_manage_user_tmp_files(gpg_agent_t)
> >
> >It's not clear whats going on here, but perhaps these make more sense
> >as 
> >a new gpg_runtime_t?
> 
> The agent should be able to create a gnupg directory in /var/run/user/USERID/ and manage socket files in that directory... 

the agent can't create USERID because its parent is owned by root and gpg-agent does not have permission to add directory entries to /var/run/user. systemd-logind , or some other privileged process, creates USERID generally on behalf of the user
also the sockets should not go to /var/run/user/USERID/ , but instead should go to /var/run/user/USERID/gnupg/ and gnupg can be creeted with an automatic type transition

> 
> >>  userdom_use_user_terminals(gpg_agent_t)
> >>  userdom_search_user_home_dirs(gpg_agent_t)
> >>  userdom_search_user_runtime(gpg_agent_t)
> >> -userdom_user_runtime_filetrans(gpg_agent_t, gpg_agent_tmp_t, dir)
> >> +userdom_user_runtime_filetrans(gpg_agent_t, gpg_agent_tmp_t, { dir
> >file sock_file })
> >>
> >>  ifdef(`hide_broken_symptoms',`
> >>  	userdom_dontaudit_read_user_tmp_files(gpg_agent_t)
> >> @@ -310,6 +316,7 @@ fs_tmpfs_filetrans(gpg_pinentry_t, gpg_p
> >>
> >>  can_exec(gpg_pinentry_t, gpg_pinentry_exec_t)
> >>
> >> +kernel_dontaudit_search_sysctl(gpg_pinentry_t)
> >>  kernel_read_system_state(gpg_pinentry_t)
> >>
> >>  corecmd_exec_shell(gpg_pinentry_t)
> >> @@ -327,6 +334,7 @@ domain_use_interactive_fds(gpg_pinentry_
> >>
> >>  files_read_usr_files(gpg_pinentry_t)
> >>
> >> +fs_dontaudit_getattr_xattr_fs(gpg_pinentry_t)
> >>  fs_dontaudit_list_inotifyfs(gpg_pinentry_t)
> >>
> >>  auth_use_nsswitch(gpg_pinentry_t)
> 
> _______________________________________________
> refpolicy mailing list
> refpolicy at oss.tresys.com
> http://oss.tresys.com/mailman/listinfo/refpolicy

-- 
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8  02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
Url : http://oss.tresys.com/pipermail/refpolicy/attachments/20170523/17d871b0/attachment.bin 

  reply	other threads:[~2017-05-23  6:43 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-21 16:21 [refpolicy] [PATCH] gpg: manage user runtime socket files and directories Guido Trentalancia
2017-05-22 23:24 ` Chris PeBenito
2017-05-23  1:04   ` Guido Trentalancia
2017-05-23  6:43     ` Dominick Grift [this message]
2017-05-23 14:59       ` Guido Trentalancia
2017-05-23  7:06     ` Dominick Grift
2017-05-23 15:12       ` Guido Trentalancia
2017-05-23 15:59         ` Dominick Grift
2017-05-23 17:14           ` Christian Göttsche
2017-05-23 17:19             ` Dominick Grift
2017-05-24  0:18           ` Chris PeBenito
2017-05-24  0:41             ` Guido Trentalancia
2017-05-24  5:36               ` Dominick Grift
2017-05-23 21:20   ` Guido Trentalancia
2017-05-23 21:21   ` [refpolicy] [PATCH v2] " Guido Trentalancia
2017-05-24 16:32     ` [refpolicy] [PATCH v3] " Guido Trentalancia
2017-05-24 17:37       ` Jason Zaman
2017-05-24 17:41         ` Guido Trentalancia
2017-05-24 17:46         ` Guido Trentalancia
2017-05-24 17:49           ` Dominick Grift
2017-05-24 18:05       ` [refpolicy] [PATCH v4] " Guido Trentalancia
2017-06-05  0:42         ` Chris PeBenito
2017-06-05  7:35           ` Dominick Grift
2017-06-05 12:13             ` Chris PeBenito
2017-06-05 12:49               ` Dominick Grift
2017-06-05 14:42           ` [refpolicy] [PATCH v5] " Guido Trentalancia
2017-06-07  0:03             ` Chris PeBenito

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170523064331.GA23273@julius.enp8s0.d30 \
    --to=dac.override@gmail.com \
    --cc=refpolicy@oss.tresys.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.