Bug 662143

Summary: SELinux is preventing /usr/sbin/certmonger "read write" access to /etc/httpd/alias/cert8.db.
Product: [Fedora] Fedora Reporter: Dmitri Pal <dpal>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 13CC: dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: selinux-policy-3.7.19-80.fc13 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-12-21 23:59:09 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:

Description Dmitri Pal 2010-12-10 18:20:47 UTC
Summary:

SELinux is preventing /usr/sbin/certmonger "read write" access to
/etc/httpd/alias/cert8.db.

Detailed Description:

SELinux denied access requested by certmonger. /etc/httpd/alias/cert8.db may be
a mislabeled. /etc/httpd/alias/cert8.db default SELinux type is cert_t, but its
current type is httpd_config_t. Changing this file back to the default type, may
fix your problem.

File contexts can be assigned to a file in the following ways.

  * Files created in a directory receive the file context of the parent
    directory by default.
  * The SELinux policy might override the default label inherited from the
    parent directory by specifying a process running in context A which creates
    a file in a directory labeled B will instead create the file with label C.
    An example of this would be the dhcp client running with the dhclient_t type
    and creating a file in the directory /etc. This file would normally receive
    the etc_t type due to parental inheritance but instead the file is labeled
    with the net_conf_t type because the SELinux policy specifies this.
  * Users can change the file context on a file using tools such as chcon, or
    restorecon.

This file could have been mislabeled either by user error, or if an normally
confined application was run under the wrong domain.

However, this might also indicate a bug in SELinux because the file should not
have been labeled with this type.

If you believe this is a bug, please file a bug report against this package.

Allowing Access:

You can restore the default system context to this file by executing the
restorecon command. restorecon '/etc/httpd/alias/cert8.db', if this file is a
directory, you can recursively restore using restorecon -R
'/etc/httpd/alias/cert8.db'.

Fix Command:

/sbin/restorecon '/etc/httpd/alias/cert8.db'

Additional Information:

Source Context                unconfined_u:system_r:certmonger_t:s0
Target Context                unconfined_u:object_r:httpd_config_t:s0
Target Objects                /etc/httpd/alias/cert8.db [ file ]
Source                        certmonger
Source Path                   /usr/sbin/certmonger
Port                          <Unknown>
Host                          lenovo.home
Source RPM Packages           certmonger-0.32-0.2010113022gitc2be99c.fc13
Target RPM Packages           mod_nss-1.0.8-6.fc13
Policy RPM                    selinux-policy-3.7.19-74.fc13
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Plugin Name                   restorecon
Host Name                     lenovo.home
Platform                      Linux lenovo.home 2.6.34.7-63.fc13.i686 #1 SMP Fri
                              Dec 3 12:35:44 UTC 2010 i686 i686
Alert Count                   10
First Seen                    Fri 10 Dec 2010 01:12:30 PM EST
Last Seen                     Fri 10 Dec 2010 01:12:45 PM EST
Local ID                      c075c3d4-6093-4387-87e6-906106db0ba5
Line Numbers                  

Raw Audit Messages            

node=lenovo.home type=AVC msg=audit(1292004765.241:64577): avc:  denied  { read write } for  pid=14132 comm="certmonger" name="cert8.db" dev=dm-0 ino=263087 scontext=unconfined_u:system_r:certmonger_t:s0 tcontext=unconfined_u:object_r:httpd_config_t:s0 tclass=file

node=lenovo.home type=SYSCALL msg=audit(1292004765.241:64577): arch=40000003 syscall=5 success=no exit=-13 a0=9966648 a1=242 a2=180 a3=99666f0 items=0 ppid=14128 pid=14132 auid=500 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=1 comm="certmonger" exe="/usr/sbin/certmonger" subj=unconfined_u:system_r:certmonger_t:s0 key=(null)

Comment 1 Dmitri Pal 2010-12-10 18:28:07 UTC
The issue is found during IPA installation.

Comment 2 Daniel Walsh 2010-12-10 20:38:22 UTC
Miroslav add 

/etc/httpd/alias(/.*)?          gen_context(system_u:object_r:cert_t,s0)

to miscfiles.fc on F13,F14,RHEL6

Comment 3 Daniel Walsh 2010-12-10 20:38:56 UTC
*** Bug 662146 has been marked as a duplicate of this bug. ***

Comment 4 Daniel Walsh 2010-12-10 20:39:44 UTC
*** Bug 662145 has been marked as a duplicate of this bug. ***

Comment 5 Daniel Walsh 2010-12-10 20:48:51 UTC
*** Bug 662141 has been marked as a duplicate of this bug. ***

Comment 6 Daniel Walsh 2010-12-10 20:48:59 UTC
*** Bug 662144 has been marked as a duplicate of this bug. ***

Comment 7 Daniel Walsh 2010-12-10 20:49:11 UTC
*** Bug 662147 has been marked as a duplicate of this bug. ***

Comment 8 Miroslav Grepl 2010-12-13 14:27:55 UTC
*** Bug 662142 has been marked as a duplicate of this bug. ***

Comment 9 Miroslav Grepl 2010-12-15 14:03:01 UTC
Fixed in selinux-policy-3.9.7-17.fc14

Comment 10 Fedora Update System 2010-12-16 15:54:21 UTC
selinux-policy-3.9.7-18.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/selinux-policy-3.9.7-18.fc14

Comment 11 Fedora Update System 2010-12-17 08:36:33 UTC
selinux-policy-3.9.7-18.fc14 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update selinux-policy'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/selinux-policy-3.9.7-18.fc14

Comment 12 Dmitri Pal 2010-12-17 17:35:40 UTC
Please build for F13 too.

Comment 13 Miroslav Grepl 2010-12-20 13:57:47 UTC
Fixed in selinux-policy-3.7.19-77.fc13

Comment 14 Fedora Update System 2010-12-20 18:37:29 UTC
selinux-policy-3.7.19-77.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/selinux-policy-3.7.19-77.fc13

Comment 15 Fedora Update System 2010-12-21 23:58:26 UTC
selinux-policy-3.9.7-18.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 16 Fedora Update System 2011-02-02 19:26:12 UTC
selinux-policy-3.7.19-80.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.