Bug 1039737

Summary: SELinux is preventing /usr/bin/certwatch from 'write' accesses on the directory ca-trust-source.
Product: [Fedora] Fedora Reporter: Eric Blake <eblake>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: dominick.grift, dwalsh, eblake, lvrabec, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:04369ad8d43ca1e909df95f5c899d317066fb6a65d2d323dc964aa3fbaaa4465
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-10 07:56:53 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Eric Blake 2013-12-09 21:30:59 UTC
Description of problem:
SELinux is preventing /usr/bin/certwatch from 'write' accesses on the directory ca-trust-source.

*****  Plugin catchall_labels (83.8 confidence) suggests   *******************

If you want to allow certwatch to have write access on the ca-trust-source directory
Then you need to change the label on ca-trust-source
Do
# semanage fcontext -a -t FILE_TYPE 'ca-trust-source'
where FILE_TYPE is one of the following: auth_cache_t, cert_t, var_t. 
Then execute: 
restorecon -v 'ca-trust-source'


*****  Plugin catchall (17.1 confidence) suggests   **************************

If you believe that certwatch should be allowed write access on the ca-trust-source 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 certwatch /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:certwatch_t:s0-s0:c0.c1023
Target Context                system_u:object_r:usr_t:s0
Target Objects                ca-trust-source [ dir ]
Source                        certwatch
Source Path                   /usr/bin/certwatch
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           crypto-utils-2.4.1-44.fc20.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-90.fc20.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.11.10-300.fc20.x86_64 #1 SMP Fri
                              Nov 29 19:16:48 UTC 2013 x86_64 x86_64
Alert Count                   5
First Seen                    2013-12-09 14:30:02 MST
Last Seen                     2013-12-09 14:30:02 MST
Local ID                      7602291d-0577-4367-862e-96d133ed94e3

Raw Audit Messages
type=AVC msg=audit(1386624602.516:575): avc:  denied  { write } for  pid=3440 comm="certwatch" name="ca-trust-source" dev="dm-2" ino=1050709 scontext=system_u:system_r:certwatch_t:s0-s0:c0.c1023 tcontext=system_u:object_r:usr_t:s0 tclass=dir


type=SYSCALL msg=audit(1386624602.516:575): arch=x86_64 syscall=access success=no exit=EACCES a0=116dbc0 a1=2 a2=0 a3=0 items=0 ppid=3414 pid=3440 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=2 tty=(none) comm=certwatch exe=/usr/bin/certwatch subj=system_u:system_r:certwatch_t:s0-s0:c0.c1023 key=(null)

Hash: certwatch,certwatch_t,usr_t,dir,write

Additional info:
reporter:       libreport-2.1.9
hashmarkername: setroubleshoot
kernel:         3.11.10-300.fc20.x86_64
type:           libreport

Comment 1 Miroslav Grepl 2013-12-10 07:54:13 UTC
*** Bug 1039741 has been marked as a duplicate of this bug. ***

Comment 2 Miroslav Grepl 2013-12-10 07:55:07 UTC
*** Bug 1039751 has been marked as a duplicate of this bug. ***

Comment 3 Miroslav Grepl 2013-12-10 07:56:53 UTC
It looks your system is mislabeled.

Try to run

# fixfiles restore

to fix labeling.

Did you do an upgrade from F19?

Comment 4 Eric Blake 2013-12-10 15:25:58 UTC
(In reply to Miroslav Grepl from comment #3)
> It looks your system is mislabeled.
> 
> Try to run
> 
> # fixfiles restore
> 
> to fix labeling.
> 
> Did you do an upgrade from F19?

an upgrade from F18, actually, done via fedup.  The upgrade process included a relabel before booting, though, so I'm not sure why another relabel is still needed... At any rate, I've done the requested relabel, so hopefully the AVCs go away.