Bug 970857 - SELinux is preventing /usr/bin/mongod from 'name_connect' accesses on the tcp_socket .
Summary: SELinux is preventing /usr/bin/mongod from 'name_connect' accesses on the tcp...
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 17
Hardware: x86_64
OS: Unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
Whiteboard: abrt_hash:7ad296e650e0d3237a70ab5625d...
Depends On:
TreeView+ depends on / blocked
Reported: 2013-06-05 06:20 UTC by Raman Gupta
Modified: 2013-07-04 14:28 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2013-07-04 14:28:48 UTC
Type: ---

Attachments (Terms of Use)

Description Raman Gupta 2013-06-05 06:20:49 UTC
Description of problem:
When I tried to use the cloneDatabase function of mongo, my mongodb raised this SELinux alert.
SELinux is preventing /usr/bin/mongod from 'name_connect' accesses on the tcp_socket .

*****  Plugin catchall (100. confidence) suggests  ***************************

If you believe that mongod should be allowed name_connect access on the  tcp_socket by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
allow this access for now by executing:
# grep mongod /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:mongod_t:s0
Target Context                system_u:object_r:mongod_port_t:s0
Target Objects                 [ tcp_socket ]
Source                        mongod
Source Path                   /usr/bin/mongod
Port                          27017
Host                          (removed)
Source RPM Packages           mongodb-server-2.2.3-4.fc17.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.10.0-169.fc17.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.8.13-100.fc17.x86_64 #1 SMP Mon
                              May 13 13:36:17 UTC 2013 x86_64 x86_64
Alert Count                   4
First Seen                    2013-06-05 02:14:12 EDT
Last Seen                     2013-06-05 02:17:14 EDT
Local ID                      3484e248-21fa-4953-a98c-5dcf60d20147

Raw Audit Messages
type=AVC msg=audit(1370413034.287:268): avc:  denied  { name_connect } for  pid=6675 comm="mongod" dest=27017 scontext=system_u:system_r:mongod_t:s0 tcontext=system_u:object_r:mongod_port_t:s0 tclass=tcp_socket

type=SYSCALL msg=audit(1370413034.287:268): arch=x86_64 syscall=connect success=no exit=EACCES a0=f a1=7fa257cf5008 a2=10 a3=0 items=0 ppid=1 pid=6675 auid=4294967295 uid=184 gid=989 euid=184 suid=184 fsuid=184 egid=989 sgid=989 fsgid=989 ses=4294967295 tty=(none) comm=mongod exe=/usr/bin/mongod subj=system_u:system_r:mongod_t:s0 key=(null)

Hash: mongod,mongod_t,mongod_port_t,tcp_socket,name_connect


#============= mongod_t ==============
allow mongod_t mongod_port_t:tcp_socket name_connect;

audit2allow -R

#============= mongod_t ==============
allow mongod_t mongod_port_t:tcp_socket name_connect;

Additional info:
hashmarkername: setroubleshoot
kernel:         3.8.13-100.fc17.x86_64
type:           libreport

Comment 1 Miroslav Grepl 2013-06-07 09:37:42 UTC
Added to all Fedora releases.

Comment 2 Fedora End Of Life 2013-07-04 07:02:10 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.

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