Bug 887271

Summary: SELinux is preventing /usr/bin/gpg from 'write' accesses on the directory /home/christensene/.gnupg.
Product: [Fedora] Fedora Reporter: eric
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: dominick.grift, dwalsh, mgrepl, tomspur
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:79c349a4a2a5771e66f175def71eb20ad0cd0bdd95db0520ae30bf85126865df
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-05 20:55:52 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
File: type
none
File: hashmarkername none

Description eric 2012-12-14 14:11:48 UTC
Additional info:
libreport version: 2.0.18
kernel:         3.6.9-2.fc17.x86_64

description:
:SELinux is preventing /usr/bin/gpg from 'write' accesses on the directory /home/christensene/.gnupg.
:
:*****  Plugin catchall (100. confidence) suggests  ***************************
:
:If you believe that gpg should be allowed write access on the .gnupg directory by default.
:Then you should report this as a bug.
:You can generate a local policy module to allow this access.
:Do
:allow this access for now by executing:
:# grep gpg /var/log/audit/audit.log | audit2allow -M mypol
:# semodule -i mypol.pp
:
:Additional Information:
:Source Context                unconfined_u:unconfined_r:mozilla_plugin_t:s0-s0:c
:                              0.c1023
:Target Context                unconfined_u:object_r:gpg_secret_t:s0
:Target Objects                /home/christensene/.gnupg [ dir ]
:Source                        gpg
:Source Path                   /usr/bin/gpg
:Port                          <Unknown>
:Host                          (removed)
:Source RPM Packages           gnupg-1.4.12-1.fc17.x86_64
:Target RPM Packages           
:Policy RPM                    selinux-policy-3.10.0-161.fc17.noarch
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Enforcing
:Host Name                     (removed)
:Platform                      Linux (removed) 3.6.9-2.fc17.x86_64 #1 SMP Tue Dec
:                              4 13:26:04 UTC 2012 x86_64 x86_64
:Alert Count                   84
:First Seen                    2012-12-10 18:05:36 EST
:Last Seen                     2012-12-14 09:10:15 EST
:Local ID                      756eda59-65d7-46c2-a9de-6cd371a55e38
:
:Raw Audit Messages
:type=AVC msg=audit(1355494215.371:77): avc:  denied  { write } for  pid=2043 comm="gpg" name=".gnupg" dev="dm-3" ino=1310947 scontext=unconfined_u:unconfined_r:mozilla_plugin_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:gpg_secret_t:s0 tclass=dir
:
:
:type=SYSCALL msg=audit(1355494215.371:77): arch=x86_64 syscall=open success=no exit=EACCES a0=7f8d790fd3f0 a1=c1 a2=1a4 a3=ffffffff items=0 ppid=1 pid=2043 auid=1000 uid=1000 gid=1000 euid=1000 suid=1000 fsuid=1000 egid=1000 sgid=1000 fsgid=1000 tty=(none) ses=2 comm=gpg exe=/usr/bin/gpg subj=unconfined_u:unconfined_r:mozilla_plugin_t:s0-s0:c0.c1023 key=(null)
:
:Hash: gpg,mozilla_plugin_t,gpg_secret_t,dir,write
:
:audit2allow
:
:#============= mozilla_plugin_t ==============
:#!!!! The source type 'mozilla_plugin_t' can write to a 'dir' of the following types:
:# user_home_dir_t, mplayer_home_t, mozilla_plugin_tmp_t, tmpfs_t, tmp_t, user_fonts_cache_t, user_tmp_t, mozilla_plugin_tmpfs_t, user_home_t, pulseaudio_home_t, data_home_t, gnome_home_type, xdm_tmp_t, gconf_home_t, gnome_home_t, home_cert_t, mozilla_home_t, admin_home_t
:
:allow mozilla_plugin_t gpg_secret_t:dir write;
:
:audit2allow -R
:
:#============= mozilla_plugin_t ==============
:#!!!! The source type 'mozilla_plugin_t' can write to a 'dir' of the following types:
:# user_home_dir_t, mplayer_home_t, mozilla_plugin_tmp_t, tmpfs_t, tmp_t, user_fonts_cache_t, user_tmp_t, mozilla_plugin_tmpfs_t, user_home_t, pulseaudio_home_t, data_home_t, gnome_home_type, xdm_tmp_t, gconf_home_t, gnome_home_t, home_cert_t, mozilla_home_t, admin_home_t
:
:allow mozilla_plugin_t gpg_secret_t:dir write;
:

Comment 1 eric 2012-12-14 14:11:51 UTC
Created attachment 663606 [details]
File: type

Comment 2 eric 2012-12-14 14:11:53 UTC
Created attachment 663607 [details]
File: hashmarkername

Comment 3 Miroslav Grepl 2012-12-17 11:22:49 UTC
Do you know what you were doing when this happened?

Comment 4 eric 2012-12-17 16:48:27 UTC
I believe I just had logged into my box when I saw the SEAlert pop up.  I'm not quite sure why gnupg wouldn't have access to my ~/.gnupg directory as that is where the data is kept.  Perhaps I'm reading the SEAlert incorrectly?

Comment 5 Fedora End Of Life 2013-07-04 00:54:33 UTC
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '17'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 is end of life. If you 
would still like  to see this bug fixed and are able to reproduce it 
against a later version  of Fedora, you are encouraged  change the 
'version' to a later Fedora version prior to Fedora 17's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 6 Thomas Spura 2013-09-05 09:57:48 UTC
(In reply to Miroslav Grepl from comment #3)
> Do you know what you were doing when this happened?

This looks like the WebPG plugin in firefox is causing this, see bug #1004707.

(In reply to Eric Christensen from comment #4)
> I believe I just had logged into my box when I saw the SEAlert pop up.  I'm
> not quite sure why gnupg wouldn't have access to my ~/.gnupg directory as
> that is where the data is kept.  Perhaps I'm reading the SEAlert incorrectly?

WebPG calls /usr/bin/gpg and therefore SELinux blocks it.

At least in my case, might this also be the reason on your machine?

Comment 7 Daniel Walsh 2013-09-05 15:35:34 UTC
*** Bug 1004707 has been marked as a duplicate of this bug. ***

Comment 8 Daniel Walsh 2013-09-05 15:35:50 UTC
It is openeing the directory for write.

You probably need to turn off the transition if you want this plugin to work.  Since we really do not want plugins having the ability to write to this directory, we probably do not want them to read here either.