Bug 740905

Summary: SELinux is preventing /usr/sbin/asterisk from 'name_connect' accesses on the tcp_socket port 5222.
Product: [Fedora] Fedora Reporter: eric
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 15CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:7fd3fc7084d0ffc8d6609e4f0656d6b0541d685ea162c0e6c256896db6e22f80
Fixed In Version: selinux-policy-3.9.16-48.fc15 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-04 02:36:17 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 2011-09-23 17:58:14 UTC
SELinux is preventing /usr/sbin/asterisk from 'name_connect' accesses on the tcp_socket port 5222.

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

If you believe that asterisk should be allowed name_connect access on the port 5222 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 asterisk /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:asterisk_t:s0
Target Context                system_u:object_r:jabber_client_port_t:s0
Target Objects                port 5222 [ tcp_socket ]
Source                        asterisk
Source Path                   /usr/sbin/asterisk
Port                          5222
Host                          (removed)
Source RPM Packages           asterisk-1.8.5.0-1.fc15.2
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.16-38.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux localhost.localdomain 2.6.40.4-5.fc15.x86_64
                              #1 SMP Tue Aug 30 14:38:32 UTC 2011 x86_64 x86_64
Alert Count                   22984
First Seen                    Thu 22 Sep 2011 11:42:51 AM EDT
Last Seen                     Fri 23 Sep 2011 01:57:09 PM EDT
Local ID                      84d018e0-2934-42c6-8163-e5cc2728bee6

Raw Audit Messages
type=AVC msg=audit(1316800629.616:26899): avc:  denied  { name_connect } for  pid=5552 comm="asterisk" dest=5222 scontext=system_u:system_r:asterisk_t:s0 tcontext=system_u:object_r:jabber_client_port_t:s0 tclass=tcp_socket


type=SYSCALL msg=audit(1316800629.616:26899): arch=x86_64 syscall=connect success=no exit=EACCES a0=b a1=7f1190003640 a2=10 a3=1 items=0 ppid=1 pid=5552 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(removed) ses=4294967295 comm=asterisk exe=/usr/sbin/asterisk subj=system_u:system_r:asterisk_t:s0 key=(null)

Hash: asterisk,asterisk_t,jabber_client_port_t,tcp_socket,name_connect

audit2allow

#============= asterisk_t ==============
allow asterisk_t jabber_client_port_t:tcp_socket name_connect;

audit2allow -R

#============= asterisk_t ==============
allow asterisk_t jabber_client_port_t:tcp_socket name_connect;

Comment 1 eric 2011-09-23 18:03:31 UTC
This is because Asterisk now acts as a jabber client.

Comment 2 Miroslav Grepl 2011-09-26 09:44:22 UTC
Fixed in selinux-policy-3.9.16-41.fc15

Comment 3 Fedora Update System 2011-11-16 16:18:01 UTC
selinux-policy-3.9.16-48.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/selinux-policy-3.9.16-48.fc15

Comment 4 Fedora Update System 2011-11-17 23:36:22 UTC
Package selinux-policy-3.9.16-48.fc15:
* should fix your issue,
* was pushed to the Fedora 15 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing selinux-policy-3.9.16-48.fc15'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2011-16023/selinux-policy-3.9.16-48.fc15
then log in and leave karma (feedback).

Comment 5 Fedora Update System 2011-12-04 02:36:17 UTC
selinux-policy-3.9.16-48.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.