Bug 1162235 - SELinux is preventing /usr/bin/mongod from 'name_bind' accesses on the tcp_socket port 27017.
Summary: SELinux is preventing /usr/bin/mongod from 'name_bind' accesses on the tcp_so...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 21
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:80c69be6eabedbddef21f8d6f49...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-11-10 15:38 UTC by Alon Levy
Modified: 2014-11-10 18:04 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-11-10 15:53:45 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Alon Levy 2014-11-10 15:38:47 UTC
Description of problem:
installing mongodb-server and running it fails.

1. dnf install mongodb-server
2. systemctl start mongod

results: SELinux is preventing /usr/bin/mongod from 'name_bind' accesses on the tcp_socket port 27017
SELinux is preventing /usr/bin/mongod from 'name_bind' accesses on the tcp_socket port 27017.

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

If you believe that mongod should be allowed name_bind access on the port 27017 tcp_socket 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 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                port 27017 [ tcp_socket ]
Source                        mongod
Source Path                   /usr/bin/mongod
Port                          27017
Host                          (removed)
Source RPM Packages           mongodb-server-2.4.9-8.fc21.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-92.fc21.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.17.2-300.fc21.x86_64 #1 SMP Thu
                              Oct 30 19:23:48 UTC 2014 x86_64 x86_64
Alert Count                   1
First Seen                    2014-11-10 17:36:29 EET
Last Seen                     2014-11-10 17:36:29 EET
Local ID                      0f2b291e-d80b-45a2-bb3a-a0bed85dda41

Raw Audit Messages
type=AVC msg=audit(1415633789.405:2278): avc:  denied  { name_bind } for  pid=14460 comm="mongod" src=27017 scontext=system_u:system_r:mongod_t:s0 tcontext=system_u:object_r:mongod_port_t:s0 tclass=tcp_socket permissive=0


type=SYSCALL msg=audit(1415633789.405:2278): arch=x86_64 syscall=bind success=no exit=EACCES a0=9 a1=45c0128 a2=10 a3=36d items=0 ppid=1 pid=14460 auid=4294967295 uid=184 gid=983 euid=184 suid=184 fsuid=184 egid=983 sgid=983 fsgid=983 tty=(none) ses=4294967295 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_bind

Version-Release number of selected component:
selinux-policy-3.13.1-92.fc21.noarch

Additional info:
reporter:       libreport-2.3.0
hashmarkername: setroubleshoot
kernel:         3.17.2-300.fc21.x86_64
type:           libreport

Comment 1 Lukas Vrabec 2014-11-10 15:53:45 UTC
#============= mongod_t ==============

#!!!! This avc is allowed in the current policy
allow mongod_t mongod_port_t:tcp_socket name_bind;


rpm -q selinux-policy
selinux-policy-3.13.1-94.fc21.noarch

Please update your selinux-policy package.

Comment 2 Alon Levy 2014-11-10 17:27:50 UTC
my bad for assuming I was running latest without checking. thanks for the fast response.

Comment 3 Lukas Vrabec 2014-11-10 18:04:08 UTC
No problem.


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