RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1149254 - SELinux prevents mongod from writing and renaming log files
Summary: SELinux prevents mongod from writing and renaming log files
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy
Version: 7.1
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Miroslav Grepl
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-10-03 15:23 UTC by Milos Malik
Modified: 2015-03-05 10:45 UTC (History)
0 users

Fixed In Version: selinux-policy-3.13.1-5.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-05 10:45:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0458 0 normal SHIPPED_LIVE selinux-policy bug fix and enhancement update 2015-03-05 15:17:00 UTC

Description Milos Malik 2014-10-03 15:23:23 UTC
Description of problem:

Version-Release number of selected component (if applicable):
mongodb-server-2.4.9-3.el7ost.x86_64
selinux-policy-3.13.1-1.el7.noarch
selinux-policy-devel-3.13.1-1.el7.noarch
selinux-policy-doc-3.13.1-1.el7.noarch
selinux-policy-minimum-3.13.1-1.el7.noarch
selinux-policy-mls-3.13.1-1.el7.noarch
selinux-policy-sandbox-3.13.1-1.el7.noarch
selinux-policy-targeted-3.13.1-1.el7.noarch

How reproducible:
always

Steps to Reproduce:
1. get a RHEL-7.1 machine with active targeted policy
2. rm -f /var/log/mongodb/mongodb.log*
3. service mongod start
4. service mongod restart
5. search for AVCs

Actual results (enforcing mode):
----
type=PATH msg=audit(10/03/2014 17:13:32.890:922) : item=1 name=/var/log/mongodb/mongodb.log inode=17363574 dev=fd:03 mode=file,644 ouid=mongodb ogid=mongodb rdev=00:00 obj=system_u:object_r:mongod_log_t:s0 objtype=CREATE 
type=PATH msg=audit(10/03/2014 17:13:32.890:922) : item=0 name=/var/log/mongodb/ inode=17363577 dev=fd:03 mode=dir,750 ouid=mongodb ogid=root rdev=00:00 obj=system_u:object_r:mongod_log_t:s0 objtype=PARENT 
type=CWD msg=audit(10/03/2014 17:13:32.890:922) :  cwd=/ 
type=SYSCALL msg=audit(10/03/2014 17:13:32.890:922) : arch=x86_64 syscall=open success=no exit=-13(Permission denied) a0=0x3898c98 a1=O_WRONLY|O_CREAT|O_TRUNC a2=0666 a3=0x7fff0b4a2ba0 items=2 ppid=15111 pid=15112 auid=unset uid=mongodb gid=mongodb euid=mongodb suid=mongodb fsuid=mongodb egid=mongodb sgid=mongodb fsgid=mongodb tty=(none) ses=unset comm=mongod exe=/usr/bin/mongod subj=system_u:system_r:mongod_t:s0 key=(null) 
type=AVC msg=audit(10/03/2014 17:13:32.890:922) : avc:  denied  { write } for  pid=15112 comm=mongod path=/var/log/mongodb/mongodb.log dev="vda3" ino=17363574 scontext=system_u:system_r:mongod_t:s0 tcontext=system_u:object_r:mongod_log_t:s0 tclass=file 
----
type=PATH msg=audit(10/03/2014 17:14:02.051:924) : item=3 name=/var/log/mongodb/mongodb.log.2014-10-03T15-14-02 objtype=CREATE 
type=PATH msg=audit(10/03/2014 17:14:02.051:924) : item=2 name=/var/log/mongodb/mongodb.log inode=17363574 dev=fd:03 mode=file,644 ouid=mongodb ogid=mongodb rdev=00:00 obj=system_u:object_r:mongod_log_t:s0 objtype=DELETE 
type=PATH msg=audit(10/03/2014 17:14:02.051:924) : item=1 name=/var/log/mongodb/ inode=17363577 dev=fd:03 mode=dir,750 ouid=mongodb ogid=root rdev=00:00 obj=system_u:object_r:mongod_log_t:s0 objtype=PARENT 
type=PATH msg=audit(10/03/2014 17:14:02.051:924) : item=0 name=/var/log/mongodb/ inode=17363577 dev=fd:03 mode=dir,750 ouid=mongodb ogid=root rdev=00:00 obj=system_u:object_r:mongod_log_t:s0 objtype=PARENT 
type=CWD msg=audit(10/03/2014 17:14:02.051:924) :  cwd=/ 
type=SYSCALL msg=audit(10/03/2014 17:14:02.051:924) : arch=x86_64 syscall=rename success=no exit=-13(Permission denied) a0=0x2518c98 a1=0x2520748 a2=0x2520740 a3=0x7fff9bbd6270 items=4 ppid=15141 pid=15142 auid=unset uid=mongodb gid=mongodb euid=mongodb suid=mongodb fsuid=mongodb egid=mongodb sgid=mongodb fsgid=mongodb tty=(none) ses=unset comm=mongod exe=/usr/bin/mongod subj=system_u:system_r:mongod_t:s0 key=(null) 
type=AVC msg=audit(10/03/2014 17:14:02.051:924) : avc:  denied  { rename } for  pid=15142 comm=mongod name=mongodb.log dev="vda3" ino=17363574 scontext=system_u:system_r:mongod_t:s0 tcontext=system_u:object_r:mongod_log_t:s0 tclass=file 
----

The same AVCs appear in permissive mode, but success=yes.

Expected results:
 * no AVCs

Comment 1 Miroslav Grepl 2014-10-13 12:50:19 UTC
commit 0e5b389e9a8c62c527627f78464e413a5f8267a3
Author: Miroslav Grepl <mgrepl>
Date:   Mon Oct 13 14:50:00 2014 +0200

    Allow mongodb to manage own log files.

Comment 5 errata-xmlrpc 2015-03-05 10:45:26 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0458.html


Note You need to log in before you can comment on or make changes to this bug.